WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation

To: <gm281@xxxxxxxxx>
Subject: RE: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation
From: dinesh chandrasekaran <dinesh_chan8@xxxxxxxxxxx>
Date: Wed, 22 Apr 2009 04:59:41 +0530
Cc: xen developers community <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 21 Apr 2009 16:30:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
Importance: Normal
In-reply-to: <4cac40570807010246if8c540bibac706239845d6b@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BAY111-W7EF3FBCCB0103D51E4892B19F0@xxxxxxx> <4cac40570807010246if8c540bibac706239845d6b@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • RE: [Xen-users] Re: [Xen-devel] Xen - Guest memory allocation, dinesh chandrasekaran <=