Re: [PATCH 3/9] x86: vdso: Introduce asm/vdso/page.h
From: Arnd Bergmann
Date: Sun Sep 08 2024 - 14:48:56 EST
On Fri, Sep 6, 2024, at 18:40, Christophe Leroy wrote:
> Le 06/09/2024 à 21:19, Arnd Bergmann a écrit :
>> On Fri, Sep 6, 2024, at 11:20, Vincenzo Frascino wrote:
>>> Looking at the definition of PAGE_SIZE and PAGE_MASK for each architecture they
>>> all depend on CONFIG_PAGE_SHIFT but they are slightly different, e.g.:
>>>
>>> x86:
>>> #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
>>>
>>> powerpc:
>>> #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
>>>
>>> hence I left to the architecture the responsibility of redefining the constants
>>> for the VSDO.
>>
>> ASM_CONST() is a powerpc-specific macro that is defined the
>> same way as _AC(). We could probably just replace all ASM_CONST()
>> as a cleanup, but for this purpose, just remove the custom PAGE_SIZE
>> and PAGE_SHIFT macros. This can be a single patch fro all
>> architectures.
>>
>
> I'm not worried about _AC versus ASM_CONST, but I am by the 1UL versus 1.
>
>
> This can be a problem on 32 bits platforms with 64 bits phys_addr_t
But that would already be a bug if anything used this, however
none of them do. The only instance of an open-coded
#define PAGE_SIZE (1 << PAGE_SHIFT)
is from openrisc, but that is only used inside of __ASSEMBLY__, for
the same effect as _AC().
Arnd