Skip to contentSkip to conversation

page flags: prioritize kasan bits over last-cpuid

PATCH Guenter Roeck 2 participants 6 messages Aug 5, 2019 – Aug 6, 2019

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Arnd Bergmann

ARM64 randdconfig builds regularly run into a build error, especially when NUMA_BALANCING and SPARSEMEM are enabled but not SPARSEMEM_VMEMMAP:

#error "KASAN: not enough bits in page flags for tag"

The last-cpuid bits are already contitional on the available space, so the result of the calculation is a bit random on whether they were already left out or not.

Quoted 9 lines

Adding the kasan tag bits before last-cpuid makes it much more likely to end up with a successful build here, and should be reliable for randconfig at least, as long as that does not randomize NR_CPUS or NODES_SHIFT but uses the defaults.

In order for the modified check to not trigger in the x86 vdso32 code where all constants are wrong (building with -m32), enclose all the definitions with an #ifdef.

This results in

./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
#error "Not enough bits in page flags"

when trying to build mipsel64:fuloong2e_defconfig.

Guenter

#1 lore raw
Quoted 21 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann

ARM64 randdconfig builds regularly run into a build error, especially when NUMA_BALANCING and SPARSEMEM are enabled but not SPARSEMEM_VMEMMAP:

#error "KASAN: not enough bits in page flags for tag"

The last-cpuid bits are already contitional on the available space, so the result of the calculation is a bit random on whether they were already left out or not.

Quoted 9 lines

Adding the kasan tag bits before last-cpuid makes it much more likely to end up with a successful build here, and should be reliable for randconfig at least, as long as that does not randomize NR_CPUS or NODES_SHIFT but uses the defaults.

In order for the modified check to not trigger in the x86 vdso32 code where all constants are wrong (building with -m32), enclose all the definitions with an #ifdef.

Quoted 6 lines

This results in

./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
#error "Not enough bits in page flags"

when trying to build mipsel64:fuloong2e_defconfig.

Do you have my follow-up fix applied?

https://ozlabs.org/~akpm/mmots/broken-out/page-flags-prioritize-kasan-bits-over-last-cpuid-fix.patch

Arnd

#2 lore raw
Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann

ARM64 randdconfig builds regularly run into a build error, especially when NUMA_BALANCING and SPARSEMEM are enabled but not SPARSEMEM_VMEMMAP:

#error "KASAN: not enough bits in page flags for tag"

The last-cpuid bits are already contitional on the available space, so the result of the calculation is a bit random on whether they were already left out or not.

Quoted 9 lines

Adding the kasan tag bits before last-cpuid makes it much more likely to end up with a successful build here, and should be reliable for randconfig at least, as long as that does not randomize NR_CPUS or NODES_SHIFT but uses the defaults.

In order for the modified check to not trigger in the x86 vdso32 code where all constants are wrong (building with -m32), enclose all the definitions with an #ifdef.

This results in

Quoted 9 lines
Quoted 4 lines

./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
#error "Not enough bits in page flags"

when trying to build mipsel64:fuloong2e_defconfig.

Do you have my follow-up fix applied?

https://ozlabs.org/~akpm/mmots/broken-out/page-flags-prioritize-kasan-bits-over-last-cpuid-fix.patch

No. I see the failure in next-20190729..next-20190805.

I didn't try to apply that patch, but I don't see
arch/mips/vdso/vdso.h in the tree. I only see

arch/mips/include/asm/vdso.h
arch/mips/include/asm/vdso/vdso.h

Are you sure that your patch can be applied as-is ?

Guenter

#3 lore raw
Quoted 36 lines · Guenter Roeck
Quoted 23 lines · Arnd Bergmann
Quoted 22 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann

ARM64 randdconfig builds regularly run into a build error, especially when NUMA_BALANCING and SPARSEMEM are enabled but not SPARSEMEM_VMEMMAP:

#error "KASAN: not enough bits in page flags for tag"

The last-cpuid bits are already contitional on the available space, so the result of the calculation is a bit random on whether they were already left out or not.

Quoted 9 lines

Adding the kasan tag bits before last-cpuid makes it much more likely to end up with a successful build here, and should be reliable for randconfig at least, as long as that does not randomize NR_CPUS or NODES_SHIFT but uses the defaults.

In order for the modified check to not trigger in the x86 vdso32 code where all constants are wrong (building with -m32), enclose all the definitions with an #ifdef.

This results in

Quoted 9 lines
Quoted 4 lines

./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
#error "Not enough bits in page flags"

when trying to build mipsel64:fuloong2e_defconfig.

Do you have my follow-up fix applied?

https://ozlabs.org/~akpm/mmots/broken-out/page-flags-prioritize-kasan-bits-over-last-cpuid-fix.patch

No. I see the failure in next-20190729..next-20190805.

Quoted 7 lines

I didn't try to apply that patch, but I don't see
arch/mips/vdso/vdso.h in the tree. I only see

arch/mips/include/asm/vdso.h
arch/mips/include/asm/vdso/vdso.h

Are you sure that your patch can be applied as-is ?

Ah, right, we now have support for the generic vdso on mips, so the file got moved from arch/mips/vdso/vdso.h to arch/mips/include/asm/vdso/vdso.h

Try applying it to the new location then. I think it should still apply, but have not tried it.

Arnd

#4 lore raw
Quoted 43 lines · Arnd Bergmann
Quoted 42 lines · Guenter Roeck
Quoted 23 lines · Arnd Bergmann
Quoted 22 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann

ARM64 randdconfig builds regularly run into a build error, especially when NUMA_BALANCING and SPARSEMEM are enabled but not SPARSEMEM_VMEMMAP:

#error "KASAN: not enough bits in page flags for tag"

The last-cpuid bits are already contitional on the available space, so the result of the calculation is a bit random on whether they were already left out or not.

Quoted 9 lines

Adding the kasan tag bits before last-cpuid makes it much more likely to end up with a successful build here, and should be reliable for randconfig at least, as long as that does not randomize NR_CPUS or NODES_SHIFT but uses the defaults.

In order for the modified check to not trigger in the x86 vdso32 code where all constants are wrong (building with -m32), enclose all the definitions with an #ifdef.

This results in

Quoted 9 lines
Quoted 4 lines

./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
#error "Not enough bits in page flags"

when trying to build mipsel64:fuloong2e_defconfig.

Do you have my follow-up fix applied?

https://ozlabs.org/~akpm/mmots/broken-out/page-flags-prioritize-kasan-bits-over-last-cpuid-fix.patch

No. I see the failure in next-20190729..next-20190805.

I didn't try to apply that patch, but I don't see
arch/mips/vdso/vdso.h in the tree. I only see

arch/mips/include/asm/vdso.h
arch/mips/include/asm/vdso/vdso.h

Quoted 9 lines
Quoted 1 line

Are you sure that your patch can be applied as-is ?

Ah, right, we now have support for the generic vdso on mips, so the file got moved from arch/mips/vdso/vdso.h to arch/mips/include/asm/vdso/vdso.h

Try applying it to the new location then. I think it should still apply, but have not tried it.

Turns out it is applied there (it looks like it was merged into the original patch). But it doesn't help; the build failure is still there. Reverting "page flags: prioritize kasan bits over last-cpuid" on top of next-20190805 fixes the problem for me.

Guenter

#5 lore raw
Quoted 18 lines · Guenter Roeck
Quoted 17 lines · Arnd Bergmann
Quoted 11 lines · Guenter Roeck

On Mon, Aug 05, 2019 at 08:35:40PM +0200, Arnd Bergmann wrote:

No. I see the failure in next-20190729..next-20190805.

I didn't try to apply that patch, but I don't see
arch/mips/vdso/vdso.h in the tree. I only see

arch/mips/include/asm/vdso.h
arch/mips/include/asm/vdso/vdso.h

Are you sure that your patch can be applied as-is ?

Ah, right, we now have support for the generic vdso on mips, so the file got moved from arch/mips/vdso/vdso.h to arch/mips/include/asm/vdso/vdso.h

Quoted 8 lines
Quoted 3 lines

Try applying it to the new location then. I think it should still apply, but have not tried it.

Turns out it is applied there (it looks like it was merged into the original patch). But it doesn't help; the build failure is still there. Reverting "page flags: prioritize kasan bits over last-cpuid" on top of next-20190805 fixes the problem for me.

I found the problem now: the vdso conversion added a new file arch/mips/vdso/config-n32-o32-env.c that contains this block

#if defined(CONFIG_MIPS32_O32) || defined(CONFIG_MIPS32_N32) #undef CONFIG_64BIT
#define CONFIG_32BIT 1
#define CONFIG_GENERIC_ATOMIC64 1
#endif

while the header contains

#if _MIPS_SIM != _MIPS_SIM_ABI64 && defined(CONFIG_64BIT)
/* Building 32-bit VDSO for the 64-bit kernel. Fake a 32-bit Kconfig. */ #define BUILD_VDSO32_64
#undef CONFIG_64BIT
#define CONFIG_32BIT 1
#ifndef __ASSEMBLY__
#include <asm-generic/atomic64.h>
#endif
#endif

The lsecond #if check thus never triggers as CONFIG_64BIT is already disabled by the time we get there.

I'll send a fixup.

Arnd