Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbbHEJyO (ORCPT ); Wed, 5 Aug 2015 05:54:14 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:5844 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbbHEJyK (ORCPT ); Wed, 5 Aug 2015 05:54:10 -0400 X-IronPort-AV: E=Sophos;i="5.15,615,1432598400"; d="scan'208";a="291518532" Date: Wed, 5 Aug 2015 10:52:45 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Julien Grall CC: , , , , "Russell King" , Subject: Re: [PATCH v2 3/8] arm/xen: implement correctly pfn_to_mfn In-Reply-To: <1438711972-18752-4-git-send-email-julien.grall@citrix.com> Message-ID: References: <1438711972-18752-1-git-send-email-julien.grall@citrix.com> <1438711972-18752-4-git-send-email-julien.grall@citrix.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 59 On Tue, 4 Aug 2015, Julien Grall wrote: > After the commit introducing convertion between DMA and guest address, ^ addresses > all the callers of pfn_to_mfn are expecting to get a GFN (Guest Frame > Number). On ARM, all the guests are auto-translated so the GFN is equal > to the Linux PFN (Pseudo-physical Frame Number). > > The current implementation may return an MFN if the caller is passing a > PFN associated to a mapped foreign grant. In pratical, I haven't seen ^ practice > the problem on running guest but we should fix it for the sake of > correctness. > > Correct the implementation by always returning the pfn passed in parameter. > > A follow-up patch will take care to rename pfn_to_mfn to a suitable > name. > > Signed-off-by: Julien Grall > Cc: Stefano Stabellini > Cc: Russell King > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Stefano Stabellini > arch/arm/include/asm/xen/page.h | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h > index bc5e77c..087d86e 100644 > --- a/arch/arm/include/asm/xen/page.h > +++ b/arch/arm/include/asm/xen/page.h > @@ -36,14 +36,6 @@ extern struct rb_root phys_to_mach; > > static inline unsigned long pfn_to_mfn(unsigned long pfn) > { > - unsigned long mfn; > - > - if (phys_to_mach.rb_node != NULL) { > - mfn = __pfn_to_mfn(pfn); > - if (mfn != INVALID_P2M_ENTRY) > - return mfn; > - } > - > return pfn; > } > > -- > 2.1.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/