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: 29846 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F4E420534 for ; Thu, 8 May 2014 15:56:18 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf8351276vcb.3 for ; Thu, 08 May 2014 08:56:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:in-reply-to :message-id:references:user-agent:mime-version:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding:content-id; bh=guVWA2Evzb94Uxx5huHUGH3ig7u37cr7kX9Az5NcQ24=; b=lxyMKD40TX0WSQx5u3g0c8/7FwiJQxFo7pU2u/exOJgHS+y8ORtYWXzzXXEymPHFe2 F3diO8MRFJ6i7cOMqbaikJWV98kB/deAOuaDVj9kWePV6xAoy5zXw6yXZxgTyz1W8Gq4 Ji8yv7w2wBEdtMIr6KhMIw9hQiu8e5VZ8/582Ok5iKIqwiI9VqJ5HvHQL9DJDcoiYuz4 Roe6XEjBg52UKofWCR05Rm3etoiL9aWYuCNo7DXm6BMPOnvka09glASaz1h+f/9RL1qC p1oDCzdcr17qcXBxc5UWgbm03ylnULwY8swBaEYPxPR+3WXP80P53E+tMiW5pRnsemzw g3mA== X-Gm-Message-State: ALoCoQl4upZh+ZT18jmi6PB1Yst3Xlt97qOLZKscyjnW6v44OXqsX9Tmv9vShI9rTdSSjuH/PhoC X-Received: by 10.236.136.231 with SMTP id w67mr1705005yhi.37.1399564578208; Thu, 08 May 2014 08:56:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.17.19 with SMTP id 19ls2651576qgc.69.gmail; Thu, 08 May 2014 08:56:18 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr3745552vcb.2.1399564578106; Thu, 08 May 2014 08:56:18 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id gu9si239483vdc.214.2014.05.08.08.56.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 08:56:18 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jw12so3524946veb.34 for ; Thu, 08 May 2014 08:56:18 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr3763811vcb.16.1399564577991; Thu, 08 May 2014 08:56:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp3599vcb; Thu, 8 May 2014 08:56:17 -0700 (PDT) X-Received: by 10.66.66.66 with SMTP id d2mr9271534pat.36.1399564576923; Thu, 08 May 2014 08:56:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iv2si739605pbd.39.2014.05.08.08.56.12 for ; Thu, 08 May 2014 08:56:13 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889AbaEHP4B (ORCPT + 27 others); Thu, 8 May 2014 11:56:01 -0400 Received: from smtp.citrix.com ([66.165.176.89]:38903 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbaEHP4A (ORCPT ); Thu, 8 May 2014 11:56:00 -0400 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 CC: Stefano Stabellini , David Vrabel , Julien Grall , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xenproject.org" , Ian Campbell , "konrad.wilk@oracle.com" 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 X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-ID: 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 *