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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] x86: stub domains and page ownership for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: stub domains and page ownership for mapping in dom0
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2008 05:40:54 -0700
Delivery-date: Thu, 20 Mar 2008 05:44:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1205856924 0
# Node ID 6ac99b961bffcdf50131fe4f2be1714f51b44db9
# Parent  4b157affc08f75cb0e2d69954357cfb1630e798c
x86: stub domains and page ownership for mapping in dom0

In the case of an ioemu stubdomain with SDL or vnc server running in
dom0, we want to have the stubdomain expose the HVM guest's video RAM
through PVFB.

However, to map the pages from dom0, xenfb uses xc_map_foreign_pages
with the stubdomain ID as domid (since that is what is advertised in
the PVFB protocol, and needed for other parts of the protocol), and
thus get_page_from_l1e() complains because the stubdomain is not the
owner of the pages.  In such case, this patch checks that the
stubdomain has privileges on the actual owner of the pages, and then
accept the mapping.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
 xen/arch/x86/mm.c |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -r 4b157affc08f -r 6ac99b961bff xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Mar 18 16:05:24 2008 +0000
+++ b/xen/arch/x86/mm.c Tue Mar 18 16:15:24 2008 +0000
@@ -645,6 +645,7 @@ get_page_from_l1e(
     struct page_info *page = mfn_to_page(mfn);
     uint32_t l1f = l1e_get_flags(l1e);
     struct vcpu *curr = current;
+    struct domain *owner = page_get_owner(page);
     int okay;
     if ( !(l1f & _PAGE_PRESENT) )
@@ -672,6 +673,16 @@ get_page_from_l1e(
         return 1;
+    /*
+     * Let privileged domains transfer the right to map their target
+     * domain's pages. This is used to allow stub-domain pvfb export to dom0,
+     * until pvfb supports granted mappings. At that time this minor hack
+     * can go away.
+     */
+    if ( unlikely(d != owner) && (owner != NULL) &&
+         (d != curr->domain) && IS_PRIV_FOR(d, owner) )
+        d = owner;
     /* Foreign mappings into guests in shadow external mode don't
      * contribute to writeable mapping refcounts.  (This allows the

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: stub domains and page ownership for mapping in dom0, Xen patchbot-unstable <=