From patchwork Thu May 8 15:54:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 4137571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72FC5BFF02 for ; Thu, 8 May 2014 15:58:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CCA320270 for ; Thu, 8 May 2014 15:58:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8821B20253 for ; Thu, 8 May 2014 15:58:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiQgO-00089c-K5; Thu, 08 May 2014 15:56:28 +0000 Received: from smtp.citrix.com ([66.165.176.89]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiQgL-0007tb-9M for linux-arm-kernel@lists.infradead.org; Thu, 08 May 2014 15:56:26 +0000 X-IronPort-AV: E=Sophos; i="4.97,1010,1389744000"; d="scan'208"; a="129026747" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 08 May 2014 15:55:58 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Thu, 8 May 2014 11:55:33 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WiQfI-0005bk-JU; Thu, 08 May 2014 16:55:20 +0100 Date: Thu, 8 May 2014 16:54:57 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Catalin Marinas Subject: Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h In-Reply-To: <20140508110527.GE17344@arm.com> Message-ID: References: <1397836474-10478-1-git-send-email-julien.grall@linaro.org> <535901F0.3010908@citrix.com> <53590845.1090405@linaro.org> <53591B8F.8070300@citrix.com> <536A1CF8.5000309@citrix.com> <20140508110527.GE17344@arm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-ID: X-DLP: MIA2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140508_085625_564077_A7898A79 X-CRM114-Status: GOOD ( 22.88 ) X-Spam-Score: -5.7 (-----) Cc: Ian Campbell , "konrad.wilk@oracle.com" , Stefano Stabellini , Julien Grall , "linux-kernel@vger.kernel.org" , David Vrabel , "xen-devel@lists.xenproject.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 8 May 2014, Catalin Marinas wrote: > On Wed, May 07, 2014 at 05:58:21PM +0100, Stefano Stabellini wrote: > > On Wed, 7 May 2014, David Vrabel wrote: > > > On 07/05/14 12:41, Stefano Stabellini wrote: > > > > On Fri, 25 Apr 2014, Stefano Stabellini wrote: > > > >> On Thu, 24 Apr 2014, David Vrabel wrote: > > > >>> On 24/04/14 13:49, Julien Grall wrote: > > > >>>> Hi David, > > > >>>> > > > >>>> On 04/24/2014 01:22 PM, David Vrabel wrote: > > > >>>>> On 18/04/14 16:54, Julien Grall wrote: > > > >>>>>> virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better > > > >>>>>> virt_to_page() handling" > > > >>>>>> > > > >>>>>> This will result of a compilation warning when CONFIG_XEN is enabled. > > > >>>>>> > > > >>>>>> arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default] > > > >>>>>> #define virt_to_pfn(v) (PFN_DOWN(__pa(v))) > > > >>>>>> ^ > > > >>>>>> In file included from arch/arm/include/asm/page.h:163:0, > > > >>>>>> from arch/arm/include/asm/xen/page.h:4, > > > >>>>>> from include/xen/page.h:4, > > > >>>>>> from arch/arm/xen/grant-table.c:33: > > > >>>>>> > > > >>>>>> The definition in memory.h is nearly the same (it directly expand PFN_DOWN), > > > >>>>>> so we can safely drop virt_to_pfn in xen include. > > > >>>>> > > > >>>>> > > > >>>>> This breaks the arm build for me. > > > >>>>> > > > >>>>> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c: In function > > > >>>>> ‘setup_blkring’: > > > >>>>> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c:1236:2: > > > >>>>> error: implicit declaration of function ‘virt_to_pfn’ > > > >>>>> [-Werror=implicit-function-declaration] > > > >>>>> err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring)); > > > >>>>> ^ > > > >>>> > > > >>>> I don't have any issue to build the following branch with this patch on: > > > >>>> - v3.15-rc2 > > > >>>> - xentip master > > > >>>> - xentip for-linus-3.16 > > > >>> > > > >>> Applied to devel/for-linus-3.16. > > > >>> > > > >>> If something else turns up for 3.15 (and I remember) I'll take it for > > > >>> 3.15 instead. > > > >> > > > >> David, > > > >> thank you very much for taking the patch in my absence. > > > >> > > > >> Considering that the problem is affecting everybody enabling CONFIG_XEN > > > >> on ARM on v3.15, I don't think we can wait for the next merge window to > > > >> send this fix upstream. > > > >> Too many warnings for too many people. > > > > > > > > Unfortunately this commit breaks arm64 compilation, as virt_to_pfn has > > > > not been introduced to arm64/include/asm/memory.h. > > > > Has the patch been sent upstream yet? > > > > > > No. > > > > > > > We need this additional change for arm64: > > > > > > > > diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h > > > > index e94f945..993bce5 100644 > > > > --- a/arch/arm64/include/asm/memory.h > > > > +++ b/arch/arm64/include/asm/memory.h > > > > @@ -138,6 +138,7 @@ static inline void *phys_to_virt(phys_addr_t x) > > > > #define __pa(x) __virt_to_phys((unsigned long)(x)) > > > > #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) > > > > #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) > > > > +#define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys(x)) > > > > > > This would need an ack from an arm64 maintainer. > > > > Certainly. Catalin is in CC. > > Acked-by: Catalin Marinas Thanks! I'll add the following patch to the xentip queue: commit be0000f4d132cd6db37babd0fd3fb5d1029f9515 Author: Stefano Stabellini Date: Thu May 8 15:48:13 2014 +0000 arm64: introduce virt_to_pfn virt_to_pfn has been defined in arch/arm/include/asm/memory.h by commit e26a9e0 "ARM: Better virt_to_page() handling" and Xen has come to rely on it. Introduce virt_to_pfn on arm64 too. Signed-off-by: Stefano Stabellini Acked-by: Catalin Marinas diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index e94f945..993bce5 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -138,6 +138,7 @@ static inline void *phys_to_virt(phys_addr_t x) #define __pa(x) __virt_to_phys((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) +#define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys(x)) /* * virt_to_page(k) convert a _valid_ virtual address to struct page *