dinesh chandrasekaran
2008-Jun-23 00:20 UTC
FW: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
Yeah milos, But the PCI device should be allowed access by all DomUs. Hiding the device from Dom0 is not what I really want to achieve. I have to stick to xen source code (and not dom0 or domU) to make this possible. As ou said in the previous mail, Im working on the populate _physmap() to force xen allocate memory for all domUs from the memory available behind the PCI device. I could not understand how hiding the PCI device from Dom0 related to my goal. Thanks alot, Dinesh C> Date: Fri, 20 Jun 2008 18:03:20 +0100 > From: gm281@cam.ac.uk > To: dinesh_chan8@hotmail.com > Subject: Re: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation > CC: xen-devel@lists.xensource.com; xen-users@lists.xensource.com > > >> Why do you want to restrict DomU to use frames from certain range > >> only? What''s the logic behind that? > > > > Im trying to allocate memory for domUs from memory behind a PCI device. The > > machine_addr_start is obtained by probing the device (as I know the vendor > > and device info) during xen boot-up. > > That''s what I was suspecting. I think you should give PCI passthrough > a go first. > PCI passthrough allows a PCI device to be hidden away from Dom0 and > exported to a DomU. You achieve the first by passing > pciback.hide=(XX:XX.X) option to Dom0 kernel and adding pci = [ > ''XX:XX.X′ ] to DomU config file. You''ll also need > CONFIG_XEN_PCIDEV_FRONTEND=y and CONFIG_XEN_PCIDEV_BACKEND=y in your > DomU and Dom0 kernel configs. > > Hope this helps > Gr(z)egor(z)CoolHotmail : Your crazy personality deserves a unique email identity like yourname@iamcrazy.in. Choose from this and hundreds other unique email ids now Try it! _________________________________________________________________ Timely update on all current affairs, sports, events and all thats in News here on MSN videos. http://video.msn.com/?mkt=en-in _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Grzegorz Miłoś
2008-Jun-23 11:39 UTC
Re: FW: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
> Yeah milos, > But the PCI device should be allowed access by all DomUs.As I said, PCI passthrough allows to assign a PCI device to _a_ DomU. If you want multiple DomUs, it will not work. You might be able to salvage some of the PCI passthrough code though (PCI configuration space logic?). What kind of a device are we talking about? It is some sort of a clever NIC? Gr(z)egor(z) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
dinesh chandrasekaran
2008-Jun-27 15:56 UTC
[Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
Hi, if I use the following inside the populate_physmap() inside xen/common/memory.c, unsigned long maddr_pci = 0xdf000000; //since I know the machine address of the mememory behind my pci device <xm dmesg> static void populate_physmap(struct memop_args *a) { /****** for(i=a->nr_done; i<a->nr_extents; i++) { /************* if(d->is_privilaged) page = alloc_domheap_pages(d, a->extent_order, a->memflags | MEMF_node(node)); else { page = maddr_to_page(maddr_pci); maddr_pci = ((maddr + PAGE_SIZE-1) &PAGE_MASK);` } /*************** } printk("a->nr_done: %lx", a->nr_done); } The printk says "a->nr_done: 2000" when ''xm dmesg'' is used (which is correct since I allocated 32MB for DomU = 8192 pages = 0x2000)but exits with the following error: ''dmesg'' says : Using config file "/home/guest/Guest.conf". Error: (1, ''Internal error'', ''xc_dom_boot_domU_map: failed to mmap domU pages 0x200+0x2e3 [xenctl, rc=-1]\n'' ''xm dmesg'' says: <G><1>mm.c:671:d0 Non-privileged (1) attempt to map I/O space 000df1ff Thanks, Dinesh C From: dinesh_chan8@hotmail.com To: xen-devel@lists.xensource.com; xen-users@lists.xensource.com Date: Mon, 23 Jun 2008 05:50:44 +0530 Subject: FW: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation Yeah milos, But the PCI device should be allowed access by all DomUs. Hiding the device from Dom0 is not what I really want to achieve. I have to stick to xen source code (and not dom0 or domU) to make this possible. As ou said in the previous mail, Im working on the populate _physmap() to force xen allocate memory for all domUs from the memory available behind the PCI device. I could not understand how hiding the PCI device from Dom0 related to my goal. Thanks alot, Dinesh C> Date: Fri, 20 Jun 2008 18:03:20 +0100 > From: gm281@cam.ac.uk > To: dinesh_chan8@hotmail.com > Subject: Re: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation > CC: xen-devel@lists.xensource.com; xen-users@lists.xensource.com > > >> Why do you want to restrict DomU to use frames from certain range > >> only? What''s the logic behind that? > > > > Im trying to allocate memory for domUs from memory behind a PCI device. The > > machine_addr_start is obtained by probing the device (as I know the vendor > > and device info) during xen boot-up. > > That''s what I was suspecting. I think you should give PCI passthrough > a go first. > PCI passthrough allows a PCI device to be hidden away from Dom0 and > exported to a DomU. You achieve the first by passing > pciback.hide=(XX:XX.X) option to Dom0 kernel and adding pci = [ > ''XX:XX.X′ ] to DomU config file. You''ll also need > CONFIG_XEN_PCIDEV_FRONTEND=y and CONFIG_XEN_PCIDEV_BACKEND=y in your > DomU and Dom0 kernel configs. > > Hope this helps > Gr(z)egor(z)CoolHotmail : Your crazy personality deserves a unique email identity like yourname@iamcrazy.in. Choose from this and hundreds other unique email ids now Try it! Placements ? No Problem. Register Here! Try it! _________________________________________________________________ No Harvard, No Oxford. We are here. Find out !! http://ss1.richmedia.in/recurl.asp?pid=500 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Grzegorz Miłoś
2008-Jun-28 15:50 UTC
Re: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
> Hi, > > if I use the following inside the populate_physmap() inside > xen/common/memory.c, > > unsigned long maddr_pci = 0xdf000000; //since I know the machine > address of the mememory behind my pci device <xm dmesg> > > static void populate_physmap(struct memop_args *a) > { > /****** > > for(i=a->nr_done; i<a->nr_extents; i++) > { > /************* > &nb sp; if(d->is_privilaged) > > page = alloc_domheap_pages(d, a->extent_order, a->memflags | > MEMF_node(node)); > else > { > page = maddr_to_page(maddr_pci);This is going to assign DomU IO pages _only_.> maddr_pci = ((maddr + PAGE_SIZE-1) &PAGE_MASK);What is maddr here? Did you mean maddr_pci? Also, (page_aligned_x + PAGE_SIZE - 1) & PAGE_MASK = page_aligned_x, in other words you are stuck on the same page.> > `   ; } > /*************** > } > printk("a->nr_done: %lx", a->nr_done); > } > > The printk says "a->nr_done: 2000" when ''xm dmesg'' is used (which is correct > since I allocated 32MB for DomU = 8192 pages = 0x2000) > > but exits with the following error: > > & n bsp; ''dmesg'' says : Using config file > "/home/guest/Guest.conf". > Error: (1, ''Internal error'', ''xc_dom_boot_domU_map: > failed to mmap domU pages 0x200+0x2e3 [xenctl, rc=-1]\n'' > > ''xm dmesg'' says: <G><1>mm.c:671:d0 Non-privileged (1) attempt > to map I/O space 000df1ffDom0 tried map DomU memory in order to load the kernel + other boot info. This fails because you''ve only allocated IO pages to DomU. Cheers Gr(z)egor(z) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel