Re: [PATCH 1/1] x86/vdso: use the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel

From: Dave Hansen
Date: Mon Mar 13 2023 - 11:22:50 EST


On 3/11/23 00:48, Xin Li wrote:
> #define GDT_ENTRY_ESPFIX_SS 26
> #define GDT_ENTRY_PERCPU 27
> +#ifndef BUILD_VDSO32_64
> #define GDT_ENTRY_CPUNODE 28
> +#else
> +#define GDT_ENTRY_CPUNODE 15
> +#endif

Isn't this kinda a hack?

First, it means that we'll now have two duplicate versions of this:

#define GDT_ENTRY_CPUNODE 15

in the same file.

Second, if any other users of fake_32bit_build.h for the VDSO show up,
they'll need a similar #ifdef.

I think I'd much rather if we define all of the GDT_ENTRY_* macros in
*one* place, then make that *one* place depend on BUILD_VDSO32_64.

Also, about the *silent* failure... Do we not have a selftest for this
somewhere?