Thread (53 messages) 53 messages, 5 authors, 2025-11-18

Re: [PATCH v6 12/18] x86/mm: LAM compatible non-canonical definition

From: Alexander Potapenko <glider@google.com>
Date: 2025-11-11 09:08:28
Also in: linux-doc, linux-kbuild, lkml, llvm

On Wed, Oct 29, 2025 at 9:08 PM Maciej Wieczor-Retman
[off-list ref] wrote:
From: Maciej Wieczor-Retman <redacted>

For an address to be canonical it has to have its top bits equal to each
other. The number of bits depends on the paging level and whether
they're supposed to be ones or zeroes depends on whether the address
points to kernel or user space.

With Linear Address Masking (LAM) enabled, the definition of linear
address canonicality is modified. Not all of the previously required
bits need to be equal, only the first and last from the previously equal
bitmask. So for example a 5-level paging kernel address needs to have
bits [63] and [56] set.

Change the canonical checking function to use bit masks instead of bit
shifts.

Signed-off-by: Maciej Wieczor-Retman <redacted>
Acked-by: Alexander Potapenko <glider@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help