[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
 
 
Hi Milos,                 Now the domU have access to the MMIO region using iomem_permit_access(). It can read and write successfully to this region.
  But when I tried to allocate the region for booting up a domU, I get the following error
  Using config file "/home/domU_confs/Linux_VM1.conf". Error: (4, 'Out of memory', "xc_dom_boot_mem_init: can't allocate low memory for domain\n")
  the mem allocation code in /xen/common/memory.c is modified to be,
  if(d->is_privileged) {                 page = alloc_domheap_pages(d, a->extent_order, a->memflags);                 mfn = page_to_mfn(page);         }
         else {                 mfn = maddr_to_mfn(mem_start);                 mem_start += PAGE_SIZE;        }
  where mem_start is the MMIO starting address (0x90000000).
  >However, you'll > have to teach the domain build tools to recognise the difference > between RAM and MMIO (it might be as simple as patching > direct_remap_pfn_range in linux kernel to use DOMID_IO)
  By this do you mean that I should modify the Dom0 kernel. Correct me I am wrong (I guess it is the domU kernel).
  regards, Dinesh C
  > Date: Tue, 1 Jul 2008 10:46:12 +0100 > From:  > To: dinesh_chan8@xxxxxxxxxxx > Subject: Re: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation >  > > Okay. > >               But I want to use 'I/O pages: memory in the memory mapped IO > > regions obtained by reading the BAR value from the pci device' > > as the 'real' memory for all DomUs since I have 256MB behind that device. >  > The problem you'll have to face is the ownership model that Xen uses. > By default when RAM is allocated to a domain it is only accessible to > the domain itself + Dom0 (via foreign mapping mechanism). All non-RAM > ranges are allocated to a synthetic domain called dom_io. Any > pagetables that reference this memory are verified against the > permitted iomem range (look iomem_access_permitted()). By default > Dom0's access is permitted, so you are fine there. However, you'll > have to teach the domain build tools to recognise the difference > between RAM and MMIO (it might be as simple as patching > direct_remap_pfn_range in linux kernel to use DOMID_IO). Also, another > concern I'd have, is if the CPU will be happy to use MMIO for code and > stack segments. I don't know enough about that to answer. >  > CHeers > Gr(z)egor(z)
 
  Windows Live Messenger.  Multitasking at its finest.
 |  
 _______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 
 
    
     |