Re: [PATCH v4 3/7] KVM: x86: Add LASS violation checks during instruction emulation

Binbin Wu <[email protected]>
Newsgroups org.kernel.vger.kvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
On 8/6/2026 9:15 AM, Sohil Mehta wrote:
> From: Zeng Guang <[email protected]>
> 
> When Linear Address Space Separation (LASS) is enabled, the processor
> applies a LASS violation check on every access to a linear address. To
> align with hardware behavior, KVM needs to perform the same check during
> instruction emulation before consulting the page tables.
> 
> Add a new callback to x86_emulate_ops to let the emulator query whether
> an access would trigger a LASS violation. The callback takes the linear
> address and the size that describe the memory access, plus a set of
> flags that convey the type of access.
> 
> Add the LASS violation check to __linearize() so that every explicit
> guest memory access is validated along with the other linear address
> checks. The SDM (June 2026), Vol3, Chapter 4, specifically states that
> there is no relative ordering between the canonicality check and the
> LASS violation check. Also, there is no prioritization specified between
> the faults generated by alignment checks and LASS violations.
> 
> Implicit supervisor accesses bypass __linearize(). So, add LASS checks
> for those in linear_read_system() and linear_write_system() and tag the
> access as implicit.
> 
> For now, emulator_is_lass_violation() is a no-op. Later, it will be
> wired up to the VMX implementation.
> 
> Signed-off-by: Zeng Guang <[email protected]>
> Signed-off-by: Binbin Wu <[email protected]>

My SoB can be dropped.

> Signed-off-by: Sohil Mehta <[email protected]>

Reviewed-by: Binbin Wu <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.