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-ppc-devel

[Xen-devel] dom0 auto-translate mmap()

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] dom0 auto-translate mmap()
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Mon, 11 Jun 2007 11:42:09 -0500
Cc: xen-ppc-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 11 Jun 2007 09:40:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
Reply-to: Hollis Blanchard <hollisb@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, as I'm porting the PPC patches to the current Linux tree, I noticed
this code in privcmd.c:
        
        static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
        {
                /* Unsupported for auto-translate guests. */
                if (xen_feature(XENFEAT_auto_translated_physmap))
                        return -ENOSYS;
        
                ... allow mmap to succeed ...
        }

All addresses provided to Xen by an autotranslate guest are guest
physical addresses, which Xen then translates to machine: (domid, gpfn)
-> (mfn). The problem is that dom0 actually needs to address memory
outside of its own domain allocation, but how can you distinguish a gpfn
from an mfn in this case?

PowerPC runs all domains, including dom0, in "autotranslate mode", and
so we have a workaround for this problem. When we know we're trying to
map machine addresses (which is what the builder tools do), we simply
set the high bit in "pfn" before passing it down to Xen. Xen then knows
it's a machine address.

This limits autotranslate domains to 32 + 12 - 1 = 43 bits of address
space, which I think is reasonable, especially since most "64-bit"
processors don't use many more bits than that anyways...



The net is that I would like to remove the above test. I wonder why it
was added in the first place? Somebody has a privileged autotranslate
domain and mistakenly tried to run the domain building tools?

-- 
Hollis Blanchard
IBM Linux Technology Center


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>