[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8868ef2c-6bfb-4ab7-ac5e-640e05658ee1@app.fastmail.com>
Date: Sun, 08 Sep 2024 20:48:06 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Christophe Leroy" <christophe.leroy@...roup.eu>,
"Vincenzo Frascino" <vincenzo.frascino@....com>,
linux-kernel@...r.kernel.org, Linux-Arch <linux-arch@...r.kernel.org>,
linux-mm@...ck.org
Cc: "Andy Lutomirski" <luto@...nel.org>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Jason A . Donenfeld" <Jason@...c4.com>,
"Michael Ellerman" <mpe@...erman.id.au>,
"Nicholas Piggin" <npiggin@...il.com>, "Naveen N Rao" <naveen@...nel.org>,
"Ingo Molnar" <mingo@...hat.com>, "Borislav Petkov" <bp@...en8.de>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, "Theodore Ts'o" <tytso@....edu>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Steven Rostedt" <rostedt@...dmis.org>,
"Masami Hiramatsu" <mhiramat@...nel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 3/9] x86: vdso: Introduce asm/vdso/page.h
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
Powered by blists - more mailing lists