[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] x86: mapping from Dom0 to DomU


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • Date: Fri, 21 Apr 2017 16:04:19 +0300
  • Delivery-date: Fri, 21 Apr 2017 13:04:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi, all!

I am working on a zero-copy scenario for x86

and for that I am mapping pages from Dom0 to DomU

(yes, I know there are at least security concerns).

Everything is just fine, e.g. I can map grefs from Dom0 in DomU

with gnttab_map_refs, until I try to mmap those pages in DomU

with vm_insert_page and Xen starts to complain:

(XEN) mm.c:989:d1v0 pg_owner 1 l1e_owner 1, but real_pg_owner 0
(XEN) mm.c:1061:d1v0 Error getting mfn 20675a (pfn 1ac8de) from L1 entry 800000020675a027 for l1e_owner=1, pg_owner=1

So, the offending(?) code is at [1] which doesn't allow the mapping

I want. When removed with

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f35e3116bb25..aeb93be8b529 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -980,6 +980,7 @@ get_page_from_l1e(
          * dom0, until pvfb supports granted mappings. At that time this
          * minor hack can go away.
          */
+#if 0
         if ( (real_pg_owner == NULL) || (pg_owner == l1e_owner) ||
              xsm_priv_mapping(XSM_TARGET, pg_owner, real_pg_owner) )
         {
@@ -988,6 +989,7 @@ get_page_from_l1e(
real_pg_owner?real_pg_owner->domain_id:-1);
             goto could_not_pin;
         }
+#endif
         pg_owner = real_pg_owner;
     }
I can successfully mmap and use pages from Dom0 in DomU.

Can anybody please explain why the use-case I am trying to implement

is treated as error from Xen's POV and what would be the right way to

do so?

Thank you,

Oleksandr

[1] http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/x86/mm.c;h=96bc28065076cb5c742a00fa0a5ffe07e9cd6e7c;hb=HEAD#l1001


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.