Re: [PATCH v1 4/9] powerpc/vdso: Remove unnecessary ifdefs in vdso_pagelist initialization

From: Christophe Leroy
Date: Fri Aug 28 2020 - 01:46:22 EST




Le 28/08/2020 à 07:40, Christophe Leroy a écrit :


Le 27/08/2020 à 15:19, Michael Ellerman a écrit :
Christophe Leroy <christophe.leroy@xxxxxxxxxx> writes:
On 08/26/2020 02:58 PM, Michael Ellerman wrote:
Christophe Leroy <christophe.leroy@xxxxxxxxxx> writes:
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index daef14a284a3..bbb69832fd46 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -718,16 +710,14 @@ static int __init vdso_init(void)
...
-
-#ifdef CONFIG_VDSO32
       vdso32_kbase = &vdso32_start;
       /*
@@ -735,8 +725,6 @@ static int __init vdso_init(void)
        */
       vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT;
       DBG("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages);
-#endif

This didn't build for ppc64le:

/opt/cross/gcc-8.20_binutils-2.32/powerpc64-unknown-linux-gnu/bin/powerpc64-unknown-linux-gnu-ld: arch/powerpc/kernel/vdso.o:(.toc+0x0): undefined reference to `vdso32_end'
/opt/cross/gcc-8.20_binutils-2.32/powerpc64-unknown-linux-gnu/bin/powerpc64-unknown-linux-gnu-ld: arch/powerpc/kernel/vdso.o:(.toc+0x8): undefined reference to `vdso32_start'
    make[1]: *** [/scratch/michael/build/maint/Makefile:1166: vmlinux] Error 1
    make: *** [Makefile:185: __sub-make] Error 2

So I just put that ifdef back.


The problem is because is_32bit() can still return true even when
CONFIG_VDSO32 is not set.

Hmm, you're right. My config had CONFIG_COMPAT enabled.

But that seems like a bug, if someone enables COMPAT on ppc64le they are
almost certainly going to want VDSO32 as well.

So I think I'll do a lead up patch as below.

Ah yes, and with that then no need to consider the case where is_32bit_task() is true and CONFIG_VDSO32 is not selected.

I'll update my leading series accordingly.

I meant follow up series.

Christophe

Christophe


cheers

diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index d4fd109f177e..cf2da1e401ef 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -501,13 +501,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"