linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
@ 2014-04-18 15:54 Julien Grall
  2014-04-24 12:22 ` David Vrabel
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Grall @ 2014-04-18 15:54 UTC (permalink / raw)
  To: stefano.stabellini
  Cc: linux-arm-kernel, linux-kernel, xen-devel, ian.campbell,
	david.vrabel, konrad.wilk, Julien Grall

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.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 arch/arm/include/asm/xen/page.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index cf4f3e8..ded062f 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -77,7 +77,6 @@ static inline xpaddr_t machine_to_phys(xmaddr_t machine)
 }
 /* VIRT <-> MACHINE conversion */
 #define virt_to_machine(v)	(phys_to_machine(XPADDR(__pa(v))))
-#define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
 #define virt_to_mfn(v)		(pfn_to_mfn(virt_to_pfn(v)))
 #define mfn_to_virt(m)		(__va(mfn_to_pfn(m) << PAGE_SHIFT))
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-04-18 15:54 [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h Julien Grall
@ 2014-04-24 12:22 ` David Vrabel
  2014-04-24 12:49   ` Julien Grall
  0 siblings, 1 reply; 10+ messages in thread
From: David Vrabel @ 2014-04-24 12:22 UTC (permalink / raw)
  To: Julien Grall
  Cc: stefano.stabellini, linux-arm-kernel, linux-kernel, xen-devel,
	ian.campbell, konrad.wilk

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));
  ^

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-04-24 12:22 ` David Vrabel
@ 2014-04-24 12:49   ` Julien Grall
  2014-04-24 14:11     ` David Vrabel
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Grall @ 2014-04-24 12:49 UTC (permalink / raw)
  To: David Vrabel
  Cc: stefano.stabellini, linux-arm-kernel, linux-kernel, xen-devel,
	ian.campbell, konrad.wilk

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

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-04-24 12:49   ` Julien Grall
@ 2014-04-24 14:11     ` David Vrabel
  2014-04-25 17:05       ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: David Vrabel @ 2014-04-24 14:11 UTC (permalink / raw)
  To: Julien Grall
  Cc: stefano.stabellini, linux-arm-kernel, linux-kernel, xen-devel,
	ian.campbell, konrad.wilk

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.

Thanks.

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-04-24 14:11     ` David Vrabel
@ 2014-04-25 17:05       ` Stefano Stabellini
  2014-05-07 11:41         ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: Stefano Stabellini @ 2014-04-25 17:05 UTC (permalink / raw)
  To: David Vrabel
  Cc: Julien Grall, stefano.stabellini, linux-arm-kernel, linux-kernel,
	xen-devel, ian.campbell, konrad.wilk

[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]

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.

Cheers,

Stefano

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-04-25 17:05       ` Stefano Stabellini
@ 2014-05-07 11:41         ` Stefano Stabellini
  2014-05-07 11:46           ` David Vrabel
  0 siblings, 1 reply; 10+ messages in thread
From: Stefano Stabellini @ 2014-05-07 11:41 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: David Vrabel, Julien Grall, linux-arm-kernel, linux-kernel,
	xen-devel, Ian Campbell, konrad.wilk, Catalin Marinas

[-- Attachment #1: Type: text/plain, Size: 2892 bytes --]

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?

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))
 
 /*
  *  virt_to_page(k)	convert a _valid_ virtual address to struct page *

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-05-07 11:41         ` Stefano Stabellini
@ 2014-05-07 11:46           ` David Vrabel
  2014-05-07 16:58             ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: David Vrabel @ 2014-05-07 11:46 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Julien Grall, linux-arm-kernel, linux-kernel, xen-devel,
	Ian Campbell, konrad.wilk, Catalin Marinas

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.

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-05-07 11:46           ` David Vrabel
@ 2014-05-07 16:58             ` Stefano Stabellini
  2014-05-08 11:05               ` Catalin Marinas
  0 siblings, 1 reply; 10+ messages in thread
From: Stefano Stabellini @ 2014-05-07 16:58 UTC (permalink / raw)
  To: David Vrabel
  Cc: Stefano Stabellini, Julien Grall, linux-arm-kernel, linux-kernel,
	xen-devel, Ian Campbell, konrad.wilk, Catalin Marinas

[-- Attachment #1: Type: text/plain, Size: 3131 bytes --]

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-05-07 16:58             ` Stefano Stabellini
@ 2014-05-08 11:05               ` Catalin Marinas
  2014-05-08 15:54                 ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: Catalin Marinas @ 2014-05-08 11:05 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: David Vrabel, Julien Grall, linux-arm-kernel, linux-kernel,
	xen-devel, Ian Campbell, konrad.wilk

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 <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h
  2014-05-08 11:05               ` Catalin Marinas
@ 2014-05-08 15:54                 ` Stefano Stabellini
  0 siblings, 0 replies; 10+ messages in thread
From: Stefano Stabellini @ 2014-05-08 15:54 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Stefano Stabellini, David Vrabel, Julien Grall, linux-arm-kernel,
	linux-kernel, xen-devel, Ian Campbell, konrad.wilk

[-- Attachment #1: Type: text/plain, Size: 4777 bytes --]

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 <catalin.marinas@arm.com>

Thanks!
I'll add the following patch to the xentip queue:

commit be0000f4d132cd6db37babd0fd3fb5d1029f9515
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
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 <stefano.stabellini@eu.citrix.com>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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 *

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-08 15:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 15:54 [PATCH] arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h Julien Grall
2014-04-24 12:22 ` David Vrabel
2014-04-24 12:49   ` Julien Grall
2014-04-24 14:11     ` David Vrabel
2014-04-25 17:05       ` Stefano Stabellini
2014-05-07 11:41         ` Stefano Stabellini
2014-05-07 11:46           ` David Vrabel
2014-05-07 16:58             ` Stefano Stabellini
2014-05-08 11:05               ` Catalin Marinas
2014-05-08 15:54                 ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).