From: Hollis Blanchard <hollisb@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>
Cc: xen-ppc-devel <xen-ppc-devel@lists.xensource.com>
Subject: dom0 auto-translate mmap()
Date: Mon, 11 Jun 2007 11:42:09 -0500 [thread overview]
Message-ID: <1181580129.20281.32.camel@basalt> (raw)
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
next reply other threads:[~2007-06-11 16:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-11 16:42 Hollis Blanchard [this message]
2007-06-11 16:51 ` dom0 auto-translate mmap() Keir Fraser
2007-06-11 16:57 ` Keir Fraser
2007-06-11 17:50 ` Hollis Blanchard
2007-06-11 18:14 ` [XenPPC] " Jimi Xenidis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1181580129.20281.32.camel@basalt \
--to=hollisb@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
--cc=xen-ppc-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.