linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
@ 2020-09-08 12:58 Michael Ellerman
  2020-09-08 13:11 ` Christophe Leroy
  2020-09-17 11:28 ` Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-09-08 12:58 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: christophe.leroy, msuchanek

When we added the VDSO32 kconfig symbol, which controls building of
the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).

That was because back then COMPAT was always enabled for 64-bit, so
depending on it would have left the 32-bit VDSO always enabled, which
we didn't want.

But since then we have made COMPAT selectable, and off by default for
ppc64le, so VDSO32 should really depend on that.

For most people this makes no difference, none of the defconfigs
change, it's only if someone is building ppc64le with COMPAT=y, they
will now also get VDSO32. If they've enabled COMPAT in order to run
32-bit binaries they presumably also want the 32-bit VDSO.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/Kconfig.cputype | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 87737ec86d39..a80ad0ef436e 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -490,13 +490,12 @@ endmenu
 
 config VDSO32
 	def_bool y
-	depends on PPC32 || CPU_BIG_ENDIAN
+	depends on PPC32 || COMPAT
 	help
 	  This symbol controls whether we build the 32-bit VDSO. We obviously
 	  want to do that if we're building a 32-bit kernel. If we're building
-	  a 64-bit kernel then we only want a 32-bit VDSO if we're building for
-	  big endian. That is because the only little endian configuration we
-	  support is ppc64le which is 64-bit only.
+	  a 64-bit kernel then we only want a 32-bit VDSO if we're also enabling
+	  COMPAT.
 
 choice
 	prompt "Endianness selection"
-- 
2.25.1


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

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
  2020-09-08 12:58 [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit Michael Ellerman
@ 2020-09-08 13:11 ` Christophe Leroy
  2020-09-08 23:32   ` Michael Ellerman
  2020-09-17 11:28 ` Michael Ellerman
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2020-09-08 13:11 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: msuchanek



Le 08/09/2020 à 14:58, Michael Ellerman a écrit :
> When we added the VDSO32 kconfig symbol, which controls building of
> the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
> 
> That was because back then COMPAT was always enabled for 64-bit, so
> depending on it would have left the 32-bit VDSO always enabled, which
> we didn't want.
> 
> But since then we have made COMPAT selectable, and off by default for
> ppc64le, so VDSO32 should really depend on that.
> 
> For most people this makes no difference, none of the defconfigs
> change, it's only if someone is building ppc64le with COMPAT=y, they
> will now also get VDSO32. If they've enabled COMPAT in order to run
> 32-bit binaries they presumably also want the 32-bit VDSO.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Michael, please note that christophe.leroy@c-s.fr is a deprecated 
address that will one day not work anymore. Please use the new one 
whenever possible.

Christophe


> ---
>   arch/powerpc/platforms/Kconfig.cputype | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 87737ec86d39..a80ad0ef436e 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -490,13 +490,12 @@ endmenu
>   
>   config VDSO32
>   	def_bool y
> -	depends on PPC32 || CPU_BIG_ENDIAN
> +	depends on PPC32 || COMPAT
>   	help
>   	  This symbol controls whether we build the 32-bit VDSO. We obviously
>   	  want to do that if we're building a 32-bit kernel. If we're building
> -	  a 64-bit kernel then we only want a 32-bit VDSO if we're building for
> -	  big endian. That is because the only little endian configuration we
> -	  support is ppc64le which is 64-bit only.
> +	  a 64-bit kernel then we only want a 32-bit VDSO if we're also enabling
> +	  COMPAT.
>   
>   choice
>   	prompt "Endianness selection"
> 

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

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
  2020-09-08 13:11 ` Christophe Leroy
@ 2020-09-08 23:32   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-09-08 23:32 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev; +Cc: msuchanek

Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 08/09/2020 à 14:58, Michael Ellerman a écrit :
>> When we added the VDSO32 kconfig symbol, which controls building of
>> the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
>> 
>> That was because back then COMPAT was always enabled for 64-bit, so
>> depending on it would have left the 32-bit VDSO always enabled, which
>> we didn't want.
>> 
>> But since then we have made COMPAT selectable, and off by default for
>> ppc64le, so VDSO32 should really depend on that.
>> 
>> For most people this makes no difference, none of the defconfigs
>> change, it's only if someone is building ppc64le with COMPAT=y, they
>> will now also get VDSO32. If they've enabled COMPAT in order to run
>> 32-bit binaries they presumably also want the 32-bit VDSO.
>> 
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
> Michael, please note that christophe.leroy@c-s.fr is a deprecated 
> address that will one day not work anymore. Please use the new one 
> whenever possible.

OK, I had the old one in my ~/.mailrc, fixed now.

cheers

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

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
  2020-09-08 12:58 [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit Michael Ellerman
  2020-09-08 13:11 ` Christophe Leroy
@ 2020-09-17 11:28 ` Michael Ellerman
  2020-09-22  7:55   ` Srikar Dronamraju
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2020-09-17 11:28 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman; +Cc: christophe.leroy, msuchanek

On Tue, 8 Sep 2020 22:58:50 +1000, Michael Ellerman wrote:
> When we added the VDSO32 kconfig symbol, which controls building of
> the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
> 
> That was because back then COMPAT was always enabled for 64-bit, so
> depending on it would have left the 32-bit VDSO always enabled, which
> we didn't want.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/64: Make VDSO32 track COMPAT on 64-bit
      https://git.kernel.org/powerpc/c/231b232df8f67e7d37af01259c21f2a131c3911e

cheers

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

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
  2020-09-17 11:28 ` Michael Ellerman
@ 2020-09-22  7:55   ` Srikar Dronamraju
  2020-10-08 10:53     ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Srikar Dronamraju @ 2020-09-22  7:55 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, msuchanek, srikar, Stephen Rothwell

* Michael Ellerman <patch-notifications@ellerman.id.au> [2020-09-17 21:28:46]:

> On Tue, 8 Sep 2020 22:58:50 +1000, Michael Ellerman wrote:
> > When we added the VDSO32 kconfig symbol, which controls building of
> > the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
> > 
> > That was because back then COMPAT was always enabled for 64-bit, so
> > depending on it would have left the 32-bit VDSO always enabled, which
> > we didn't want.
> > 
> > [...]
> 
> Applied to powerpc/next.
> 
> [1/1] powerpc/64: Make VDSO32 track COMPAT on 64-bit
>       https://git.kernel.org/powerpc/c/231b232df8f67e7d37af01259c21f2a131c3911e
> 
> cheers

With this commit which is part of powerpc/next and with
/opt/at12.0/bin/gcc --version
gcc (GCC) 8.4.1 20191125 (Advance-Toolchain 12.0-3) [e25f27eea473]
throws up a compile error on a witherspoon/PowerNV with CONFIG_COMPAT.
CONFIG_COMPAT got carried from the distro config. (And looks like most
distros seem to be having this config)

cc1: error: _-m32_ not supported in this configuration
make[4]: *** [arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
make[4]: *** Waiting for unfinished jobs....
cc1: error: _-m32_ not supported in this configuration
make[4]: *** [arch/powerpc/kernel/vdso32/gettimeofday.o] Error 1
make[3]: *** [arch/powerpc/kernel/vdso32] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [arch/powerpc/kernel] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/powerpc] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [__sub-make] Error 2

I don't seem to be facing with other compilers like "gcc (Ubuntu
7.4.0-1ubuntu1~18.04.1) 7.4.0" and I was able to disable CONFIG_COMPAT and
proceed with the build.

-- 
Thanks and Regards
Srikar Dronamraju

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

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
  2020-09-22  7:55   ` Srikar Dronamraju
@ 2020-10-08 10:53     ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-10-08 10:53 UTC (permalink / raw)
  To: Srikar Dronamraju; +Cc: linuxppc-dev, msuchanek, srikar, Stephen Rothwell

Srikar Dronamraju <srikar@linux.vnet.ibm.com> writes:
> * Michael Ellerman <patch-notifications@ellerman.id.au> [2020-09-17 21:28:46]:
>
>> On Tue, 8 Sep 2020 22:58:50 +1000, Michael Ellerman wrote:
>> > When we added the VDSO32 kconfig symbol, which controls building of
>> > the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
>> > 
>> > That was because back then COMPAT was always enabled for 64-bit, so
>> > depending on it would have left the 32-bit VDSO always enabled, which
>> > we didn't want.
>> > 
>> > [...]
>> 
>> Applied to powerpc/next.
>> 
>> [1/1] powerpc/64: Make VDSO32 track COMPAT on 64-bit
>>       https://git.kernel.org/powerpc/c/231b232df8f67e7d37af01259c21f2a131c3911e
>> 
>> cheers
>
> With this commit which is part of powerpc/next and with
> /opt/at12.0/bin/gcc --version
> gcc (GCC) 8.4.1 20191125 (Advance-Toolchain 12.0-3) [e25f27eea473]
> throws up a compile error on a witherspoon/PowerNV with CONFIG_COMPAT.
> CONFIG_COMPAT got carried from the distro config. (And looks like most
> distros seem to be having this config)

This distro config will have it because previously it couldn't be
disabled. But now that it's selectable all LE distros should disable it.

> cc1: error: _-m32_ not supported in this configuration
> make[4]: *** [arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> cc1: error: _-m32_ not supported in this configuration
> make[4]: *** [arch/powerpc/kernel/vdso32/gettimeofday.o] Error 1
> make[3]: *** [arch/powerpc/kernel/vdso32] Error 2
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [arch/powerpc/kernel] Error 2
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [arch/powerpc] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [__sub-make] Error 2
>
> I don't seem to be facing with other compilers like "gcc (Ubuntu
> 7.4.0-1ubuntu1~18.04.1) 7.4.0" and I was able to disable CONFIG_COMPAT and
> proceed with the build.

It seems your compiler doesn't support building 32-bit binaries. I'm
pretty sure the kernel.org ones do, or you can just turn off COMPAT.

cheers

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

end of thread, other threads:[~2020-10-08 11:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 12:58 [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit Michael Ellerman
2020-09-08 13:11 ` Christophe Leroy
2020-09-08 23:32   ` Michael Ellerman
2020-09-17 11:28 ` Michael Ellerman
2020-09-22  7:55   ` Srikar Dronamraju
2020-10-08 10:53     ` Michael Ellerman

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).