* [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code
@ 2016-08-22 22:07 Aaro Koskinen
2016-08-22 22:55 ` David Daney
0 siblings, 1 reply; 5+ messages in thread
From: Aaro Koskinen @ 2016-08-22 22:07 UTC (permalink / raw)
To: Ralf Baechle
Cc: David Daney, Steven J. Hill, David Daney, linux-mips, Alex Smith,
Aaro Koskinen
Commit 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq()
usage.") added bitwise shift operations that assume that unsigned long
is always 64-bits. This broke the build of VDSO code, as it gets compiled
also in "faked" 32-bit mode. Althought the failing inline functions are
never executed in 32-bit mode, they still need to pass the compilation.
Fix by using 64-bit types explicitly.
The patch fixes the following build failure:
CC arch/mips/vdso/gettimeofday-o32.o
In file included from los/git/devel/linux/arch/mips/include/asm/io.h:32:0,
from los/git/devel/linux/arch/mips/include/asm/page.h:194,
from los/git/devel/linux/arch/mips/vdso/vdso.h:26,
from los/git/devel/linux/arch/mips/vdso/gettimeofday.c:11:
los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h: In function '__should_swizzle_bits':
los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h:19:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
unsigned long did = ((unsigned long)a >> 40) & 0xff;
^~
Fixes: 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq() usage.")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
arch/mips/include/asm/mach-cavium-octeon/mangle-port.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
index 0cf5ac1..8ff2cbd 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
@@ -15,8 +15,8 @@
static inline bool __should_swizzle_bits(volatile void *a)
{
extern const bool octeon_should_swizzle_table[];
+ u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
- unsigned long did = ((unsigned long)a >> 40) & 0xff;
return octeon_should_swizzle_table[did];
}
@@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a)
#define __should_swizzle_bits(a) false
-static inline bool __should_swizzle_addr(unsigned long p)
+static inline bool __should_swizzle_addr(u64 p)
{
/* boot bus? */
return ((p >> 40) & 0xff) == 0;
--
2.9.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code
2016-08-22 22:07 [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code Aaro Koskinen
@ 2016-08-22 22:55 ` David Daney
2016-08-22 22:55 ` David Daney
2016-08-24 16:50 ` Steven J. Hill
0 siblings, 2 replies; 5+ messages in thread
From: David Daney @ 2016-08-22 22:55 UTC (permalink / raw)
To: Aaro Koskinen, Steven J. Hill
Cc: Ralf Baechle, David Daney, linux-mips, Alex Smith
On 08/22/2016 03:07 PM, Aaro Koskinen wrote:
> Commit 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq()
> usage.") added bitwise shift operations that assume that unsigned long
> is always 64-bits. This broke the build of VDSO code, as it gets compiled
> also in "faked" 32-bit mode. Althought the failing inline functions are
> never executed in 32-bit mode, they still need to pass the compilation.
> Fix by using 64-bit types explicitly.
>
> The patch fixes the following build failure:
>
> CC arch/mips/vdso/gettimeofday-o32.o
> In file included from los/git/devel/linux/arch/mips/include/asm/io.h:32:0,
> from los/git/devel/linux/arch/mips/include/asm/page.h:194,
> from los/git/devel/linux/arch/mips/vdso/vdso.h:26,
> from los/git/devel/linux/arch/mips/vdso/gettimeofday.c:11:
> los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h: In function '__should_swizzle_bits':
> los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h:19:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
> unsigned long did = ((unsigned long)a >> 40) & 0xff;
> ^~
>
> Fixes: 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq() usage.")
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
This looks like it should work.
Steven, can you test this patch for us to get independent confirmation
that it works?
If testing shows that it is good, please add Acked-by: David Daney
<david.daney@cavium.com>
> ---
> arch/mips/include/asm/mach-cavium-octeon/mangle-port.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> index 0cf5ac1..8ff2cbd 100644
> --- a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> +++ b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> @@ -15,8 +15,8 @@
> static inline bool __should_swizzle_bits(volatile void *a)
> {
> extern const bool octeon_should_swizzle_table[];
> + u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
>
> - unsigned long did = ((unsigned long)a >> 40) & 0xff;
> return octeon_should_swizzle_table[did];
> }
>
> @@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a)
>
> #define __should_swizzle_bits(a) false
>
> -static inline bool __should_swizzle_addr(unsigned long p)
> +static inline bool __should_swizzle_addr(u64 p)
> {
> /* boot bus? */
> return ((p >> 40) & 0xff) == 0;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code
2016-08-22 22:55 ` David Daney
@ 2016-08-22 22:55 ` David Daney
2016-08-24 16:50 ` Steven J. Hill
1 sibling, 0 replies; 5+ messages in thread
From: David Daney @ 2016-08-22 22:55 UTC (permalink / raw)
To: Aaro Koskinen, Steven J. Hill
Cc: Ralf Baechle, David Daney, linux-mips, Alex Smith
On 08/22/2016 03:07 PM, Aaro Koskinen wrote:
> Commit 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq()
> usage.") added bitwise shift operations that assume that unsigned long
> is always 64-bits. This broke the build of VDSO code, as it gets compiled
> also in "faked" 32-bit mode. Althought the failing inline functions are
> never executed in 32-bit mode, they still need to pass the compilation.
> Fix by using 64-bit types explicitly.
>
> The patch fixes the following build failure:
>
> CC arch/mips/vdso/gettimeofday-o32.o
> In file included from los/git/devel/linux/arch/mips/include/asm/io.h:32:0,
> from los/git/devel/linux/arch/mips/include/asm/page.h:194,
> from los/git/devel/linux/arch/mips/vdso/vdso.h:26,
> from los/git/devel/linux/arch/mips/vdso/gettimeofday.c:11:
> los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h: In function '__should_swizzle_bits':
> los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h:19:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
> unsigned long did = ((unsigned long)a >> 40) & 0xff;
> ^~
>
> Fixes: 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq() usage.")
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
This looks like it should work.
Steven, can you test this patch for us to get independent confirmation
that it works?
If testing shows that it is good, please add Acked-by: David Daney
<david.daney@cavium.com>
> ---
> arch/mips/include/asm/mach-cavium-octeon/mangle-port.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> index 0cf5ac1..8ff2cbd 100644
> --- a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> +++ b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
> @@ -15,8 +15,8 @@
> static inline bool __should_swizzle_bits(volatile void *a)
> {
> extern const bool octeon_should_swizzle_table[];
> + u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
>
> - unsigned long did = ((unsigned long)a >> 40) & 0xff;
> return octeon_should_swizzle_table[did];
> }
>
> @@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a)
>
> #define __should_swizzle_bits(a) false
>
> -static inline bool __should_swizzle_addr(unsigned long p)
> +static inline bool __should_swizzle_addr(u64 p)
> {
> /* boot bus? */
> return ((p >> 40) & 0xff) == 0;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code
2016-08-22 22:55 ` David Daney
2016-08-22 22:55 ` David Daney
@ 2016-08-24 16:50 ` Steven J. Hill
2016-08-24 16:50 ` Steven J. Hill
1 sibling, 1 reply; 5+ messages in thread
From: Steven J. Hill @ 2016-08-24 16:50 UTC (permalink / raw)
To: Aaro Koskinen
Cc: David Daney, Ralf Baechle, David Daney, linux-mips, Alex Smith
On 08/22/2016 05:55 PM, David Daney wrote:
>
> This looks like it should work.
>
> Steven, can you test this patch for us to get independent confirmation
> that it works?
>
> If testing shows that it is good, please add Acked-by: David Daney
> <david.daney@cavium.com>
>
Hey Aaro.
Patch tests out good. Go ahead add David's ack. Thanks.
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code
2016-08-24 16:50 ` Steven J. Hill
@ 2016-08-24 16:50 ` Steven J. Hill
0 siblings, 0 replies; 5+ messages in thread
From: Steven J. Hill @ 2016-08-24 16:50 UTC (permalink / raw)
To: Aaro Koskinen
Cc: David Daney, Ralf Baechle, David Daney, linux-mips, Alex Smith
On 08/22/2016 05:55 PM, David Daney wrote:
>
> This looks like it should work.
>
> Steven, can you test this patch for us to get independent confirmation
> that it works?
>
> If testing shows that it is good, please add Acked-by: David Daney
> <david.daney@cavium.com>
>
Hey Aaro.
Patch tests out good. Go ahead add David's ack. Thanks.
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-24 16:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 22:07 [PATCH] MIPS: OCTEON: mangle-port: fix build failure with VDSO code Aaro Koskinen
2016-08-22 22:55 ` David Daney
2016-08-22 22:55 ` David Daney
2016-08-24 16:50 ` Steven J. Hill
2016-08-24 16:50 ` Steven J. Hill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox