Intel Gets Back To Working On Linear Address Masking Support For The Linux Kernel
Back in December 2020 Intel's programming reference manual was updated to cover Linear Address Masking (LAM) as a future CPU feature and there was some GNU toolchain activity around LAM while not much to report on the effort since then -- until today. A revised "request for comments" has been posted on the Intel Linear Address Masking enabling for the Linux kernel that allows for using untranslated address bits of 64-bit linear addresses to be used for storing arbitrary software metadata.
These patches succeed the original Intel LAM RFC patches for the kernel that came out in early 2021 following that December 2020 Intel PRM update. The revised patches out today allow for the untranslated address bits of user-space addresses to be used for metadata.The new kernel code offers a arch_prctl-based API, exposes the status of LAM and other features now under /proc/$PID/arch_status, and the code should work against the latest upstream kernel code.
Linear Address Masking can be enabled from user-space using the "ARCH_THREAD_FEATURE_ENABLE" feature with arch_prctl() for X86_THREAD_LAM_U48 enabling LAM or X86_THREAD_LAM_U57 for mappings above 47 bits.
Intel PRM graphic on LAM.
There is a QEMU patch exposing LAM for testing purposes but is not upstream. It's likely the LAM functionality will be found with forthcoming Xeon "Sapphire Rapids" processors. AMD meanwhile is working on an Upper Address Ignore (UAI) feature with Zen 4 that sounds similar to Intel LAM.
See the new Linux kernel patches for Intel LAM on the LKML. With this patch series still being under a "RFC" flag, it will still likely face further revisions before hopefully being mainlined -- hopefully with a quicker turnaround between iterations than from the original patch series more than one year ago.