Linear Address Masking (LAM) Emulation — Intel® SDE documentation

# Linear Address Masking (LAM) Emulation

Intel® Linear Address Masking (LAM) is a hardware feature introduced in modern Intel® CPUs that enables software to utilize unused bits in 64-bit linear addresses for metadata storage. In x86-64 architecture, while processors support 64-bit virtual addresses, current implementations typically only use the lower 48 or 57 bits for actual memory addressing, leaving the upper bits unused.

LAM allows applications and system software to repurpose these high-order bits to store additional information such as tags, type identifiers, or other metadata without affecting the underlying memory translation process.

Intel® SDE emulates the LAM feature, allowing developers to test and validate software that utilizes LAM on systems that do not have hardware support for it. This emulation provides a way to ensure that applications can correctly handle LAM functionality and that any software relying on LAM behaves as expected, even in environments where the hardware does not natively support it.

Intel® SDE’s LAM emulation is supported only on Linux platform because it needs to clear the LAM bits in system calls that take memory addresses as parameters, for example, read or mprotect system calls. This is done by intercepting the system calls and clearing the LAM bits in the memory addresses before passing them to the kernel.

Here is a list of options to control the LAM emulation:

`-lam`

  Enable=1 or Disable=0 Intel(R) LAM 57 bits [default 0]

`-lam48`

  Enable=1 or Disable=0 Intel(R) LAM 48 bits [default 0]

`-lam_skip_stack`

  Skip stack-based memory operands [default 1]

`-lam_system_calls`

  Strip system calls arguments in LAM [default 1]