All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] MM: stub domains and page ownership for mapping in dom0
@ 2008-03-06 18:52 Samuel Thibault
  2008-03-17 10:53 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2008-03-06 18:52 UTC (permalink / raw)
  To: xen-devel

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.

Any red flag?

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>

diff -r fb74347d80c3 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Mar 05 12:20:40 2008 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 06 18:35:55 2008 +0000
@@ -673,6 +673,14 @@ get_page_from_l1e
         return 1;
     }
 
+    /* Let privileged domains transfer the right to map their target domain's
+     * pages */
+    {
+        struct domain *owner = page_get_owner(page);
+        if (d != owner && 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
      * qemu-dm helper process in dom0 to map the domain's memory without

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] MM: stub domains and page ownership for mapping in dom0
  2008-03-06 18:52 [RFC] MM: stub domains and page ownership for mapping in dom0 Samuel Thibault
@ 2008-03-17 10:53 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2008-03-17 10:53 UTC (permalink / raw)
  To: Samuel Thibault, xen-devel; +Cc: Pat Campbell

On 6/3/08 18:52, "Samuel Thibault" <samuel.thibault@eu.citrix.com> wrote:

> 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.
> 
> Any red flag?

Really pvfb protocol should be using grants for foreign mappings. Didn't Pat
Campbell have a patch for that?

This patch is probably a reasonable stopgap however.

 -- Keir

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-17 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 18:52 [RFC] MM: stub domains and page ownership for mapping in dom0 Samuel Thibault
2008-03-17 10:53 ` Keir Fraser

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.