[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3 of 8] x86/mm: Allow foreign read-only mappings of shared pages
xen/arch/x86/mm.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) Because shared pages are owned by dom_cow, the ownership test while foreign mapping fails. Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> diff -r 2e7c77585adb -r c4b96d2cba06 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -878,7 +878,8 @@ get_page_from_l1e( return 1; } - if ( unlikely(real_pg_owner != pg_owner) ) + if ( unlikely( (real_pg_owner != pg_owner) && + (real_pg_owner != dom_cow) ) ) { /* * Let privileged domains transfer the right to map their target @@ -892,6 +893,11 @@ get_page_from_l1e( pg_owner = real_pg_owner; } + /* Extra paranoid check for shared memory. Writable mappings + * disallowed (unshare first!) */ + if ( (l1f & _PAGE_RW) && (real_pg_owner == dom_cow) ) + goto could_not_pin; + /* 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |