diff mbox

[1/8] DO NOT APPLY: xen/arm: Correctly support foreign page removing on ARM

Message ID 1386258131-755-2-git-send-email-julien.grall@linaro.org
State Superseded
Headers show

Commit Message

Julien Grall Dec. 5, 2013, 3:42 p.m. UTC
This patch is here to fix "phv dom0: Add and remove foreign pages", I hope it
will be merge to this patch in a later version.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/common/memory.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ae11828..dfda092 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -708,19 +708,21 @@  long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         {
             if ( page )
                 mfn = page_to_mfn(page);
-#ifdef CONFIG_X86
             else
             {
-                p2m_type_t tp;
                 struct domain *foreign_dom;
+#ifdef CONFIG_X86
+                p2m_type_t tp;
 
                 mfn = mfn_x(get_gfn_query(d, xrfp.gpfn, &tp));
-                foreign_dom = page_get_owner(mfn_to_page(mfn));
                 ASSERT(is_pvh_domain(d));
-                ASSERT(d != foreign_dom);
                 ASSERT(p2m_is_foreign(tp));
-            }
+#else
+                mfn = gmfn_to_mfn(d, xrfp.gpfn);
 #endif
+                foreign_dom = page_get_owner(mfn_to_page(mfn));
+                ASSERT(d != foreign_dom);
+            }
             guest_physmap_remove_page(d, xrfp.gpfn, mfn, 0);
             if (page)
                 put_page(page);