Re: [PATCH v4 4/7] KVM: VMX: Implement LASS violation check
From: Binbin Wu
Date: Wed Aug 19 2026 - 04:50:05 EST
On 8/6/2026 9:15 AM, Sohil Mehta wrote:
> From: Zeng Guang <guang.zeng@xxxxxxxxx>
>
> Add a VMX implementation of the is_lass_violation() hook to let KVM
> detect Linear Address Space Separation (LASS) violations on linear
> addresses generated during emulation. LASS uses bit 63 of the linear
> address to determine which half of the address space is being targeted,
> and reports a violation when that half doesn't match the current
> privilege level.
>
> Note, LASS takes effect only in IA-32e mode; it is ignored in legacy
> mode. LASS enforcement for supervisor-mode data accesses additionally
> requires SMAP to be enabled, and is suppressed for explicit accesses
> when RFLAGS.AC=1.
>
> Enforce LASS violations on emulated instruction fetches and data
> accesses, including implicit supervisor accesses, so that the mode-based
> protections are applied before paging. Also enforce LASS on the linear
> addresses consumed by emulated VMX and SGX ENCLS instructions.
>
> Linear addresses used for TLB invalidation (INVLPG, INVPCID, and
> INVVPID) and branch targets are not subject to LASS enforcement.
>
> Signed-off-by: Zeng Guang <guang.zeng@xxxxxxxxx>
> Signed-off-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
> Signed-off-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>