Where is the code that maps the kernel of a DomU into memory? i.e, when you do a xm create <config file> what code is called to actually map the kernel into memory? Is it a python script or is it re-directed to Dom0 to do? Thanks. -Brian --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Security Initiative Team > Sent: 17 April 2007 18:53 > To: xen-users@lists.xensource.com; xen-devel@lists.xensource.com > Subject: [Xen-users] DomU Kernel Mapping > > Where is the code that maps the kernel of a DomU into memory? > > i.e, when you do a xm create <config file> > what code is called to actually map the kernel into memory?It is in .../tools/libxc/xc_dom_compat.c and .../tools/libxc/xc_hvm_build.c for PV and HVM respectively.> > Is it a python script or is it re-directed to Dom0 to do?Ehm, you can only do xm create in dom0, so I''m not sure what you mean by this. xm is written in python, but it calls out to C-functions, which in turn makes hypercalls to the hypervisor to perform for example memory allocation, setting up VCPU(s), creation of the actual domain (empty, to be filled in), starting the domain, etc, etc. The code for "xm create" is in .../tools/python/xen/xm/create.py. -- Mats> > Thanks. > -Brian > > > ________________________________ > > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_ > cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGF > ncwRzbGsDbmV3LWNhcnM-> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: zvoice@snto.ru [mailto:zvoice@snto.ru] > Sent: 18 April 2007 09:58 > To: Petersson, Mats > Subject: RE: [Xen-users] DomU Kernel Mapping > > Hi, can you help me out with my problem. It''s about the speed > between 2 vm''s in 1 domain. Or where is bridge code located > in xen source? Thanks1. Please don''t write to ME personally, unless I initiated such communication (I''m not charging for my advice [I''m paid by AMD to develop the Xen kernel, and as part of that, I monitor the mailing lists and reply when I think I can offer advice.], so it''s not fair that some people get advice that others don''t have access to). Also, I may be an expert on some areas of Xen, but I don''t know everything. Even if I give an answer, someone else may have a BETTER or different answer, and if I''m wrong, someone will most likely say so. If you communicate with only me, you would not get those answers. 2. I did see your question, but I didn''t think I had a good answer to your question - others have (much) more experience with bridge-setups than I do. 3. Bridge-code in Xen is generic bridge code for Linux, so it''s not unique (or in other ways special) to Xen - not even modified. 4. What version of Xen are you running and are you running full-virtualization (HVM) or para-virtualization (PV) guests? -- Mats> > исходное сообщение > Тема: RE: [Xen-users] DomU Kernel Mapping > От: "Petersson, Mats" <Mats.Petersson@amd.com> > Дата: 18.04.2007 08.44 > > > > > -----Original Message----- > > From: xen-users-bounces@lists.xensource.com > > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > > Security Initiative Team > > Sent: 17 April 2007 18:53 > > To: xen-users@lists.xensource.com; xen-devel@lists.xensource.com > > Subject: [Xen-users] DomU Kernel Mapping > > > > Where is the code that maps the kernel of a DomU into memory? > > > > i.e, when you do a xm create <config file> > > what code is called to actually map the kernel into memory? > > > It is in .../tools/libxc/xc_dom_compat.c and > .../tools/libxc/xc_hvm_build.c for PV and HVM respectively. > > > > > Is it a python script or is it re-directed to Dom0 to do? > > Ehm, you can only do xm create in dom0, so I''m not sure what > you mean by > this. > > xm is written in python, but it calls out to C-functions, > which in turn > makes hypercalls to the hypervisor to perform for example memory > allocation, setting up VCPU(s), creation of the actual domain > (empty, to > be filled in), starting the domain, etc, etc. > > The code for "xm create" is in .../tools/python/xen/xm/create.py. > > -- > Mats > > > > Thanks. > > -Brian > > > > > > ________________________________ > > > > Ahhh...imagining that irresistible "new car" smell? > > Check out new cars at Yahoo! Autos. > > <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_ > > cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGF > > ncwRzbGsDbmV3LWNhcnM-> > > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
As Mats says, the code is in tools/libxc. When you load an ELF binary (such as a Linux kernel), the function xc_dom_elfloader.c::xc_dom_load_elf_kernel() performs the mapping and loading of the kernel. The following chain of function calls maps the memory into dom0 for loading the kernel: xc_dom.h::xc_dom_seg_to_ptr() calls xc_dom_core.c::xc_dom_pfn_to_ptr() calls xc_dom_boot.c::xc_dom_boot_domU_map() calls xc_{linux,solaris}.c::xc_map_foreign_ranges() which (for the Linux case) performs an ioctl on the privcmd device, and maps the memory into dom0 user-space using the mmu_update hypercall. A call to libelf-loader.c::elf_load_binary() copies the kernel into domU. I should add that I''m currently working on moving this code to a small, trusted domain. The goal would be to remove dom0''s ability to map arbitrary memory from other guests. Hope this helps. Regards, Derek Murray. On 17 Apr 2007, at 13:53, Security Initiative Team wrote:> Where is the code that maps the kernel of a DomU into memory? > > i.e, when you do a xm create <config file> > what code is called to actually map the kernel into memory? > > Is it a python script or is it re-directed to Dom0 to do? > > Thanks. > -Brian > > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel