From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 1/8] DO NOT APPLY: xen/arm: Correctly support foreign page removing on ARM Date: Thu, 5 Dec 2013 15:42:04 +0000 Message-ID: <1386258131-755-2-git-send-email-julien.grall@linaro.org> References: <1386258131-755-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vob4N-0001pU-Uw for xen-devel@lists.xenproject.org; Thu, 05 Dec 2013 15:42:28 +0000 Received: by mail-wi0-f173.google.com with SMTP id hn9so5721056wib.0 for ; Thu, 05 Dec 2013 07:42:24 -0800 (PST) In-Reply-To: <1386258131-755-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Keir Fraser , ian.campbell@citrix.com, patches@linaro.org, Julien Grall , Jan Beulich , stefano.stabellini@citrix.com, time@xen.org List-Id: xen-devel@lists.xenproject.org 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 Cc: Keir Fraser Cc: Jan Beulich Cc: Mukesh Rathor --- xen/common/memory.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); -- 1.7.10.4