Re: [RFC PATCH 02/34] ARM: mm: make 2-level pgd_t a scalar

"David Hildenbrand (Arm)" <[email protected]> Tue, 14 Jul 2026 15:03:28 +0200
Newsgroups org.kernel.vger.linux-csky,dev.linux.lists.loongarch,org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-mips,org.kernel.vger.linux-openrisc,org.kvack.linux-mm
Message-ID <[email protected]>
On 7/14/26 14:34, David Laight wrote:
> On Mon, 13 Jul 2026 14:55:41 +0100
> Yeoreum Yun <[email protected]> wrote:
> 
>> From: "David Hildenbrand (Arm)" <[email protected]>
>>
>> We don't want pgd_t to be an array, as it prohibits returning it from a
>> function, like pgdp_get().
> 
> If you use a two element structure the compiler/ABI might be able to
> return that from a function in two registers.
> That might make the entire mess more readable ...

The patch description states:

"
As an alternative, we could use the STRICT_MM_TYPECHECKS approach here
as well, but using an u64 looks conceptually cleaner, even though
pgd_val() gets a bit more involved.
"

Arnd replied on that in more detail.

Maybe I should just go back to using bit shifts and handing endianess.

-- 
Cheers,

David