Re: [PATCH v2 16/16] KVM: x86: selftests: Add APX state handling and XCR0 sanity checks

From: Sean Christopherson

Date: Wed Mar 04 2026 - 23:28:24 EST


On Mon, Jan 12, 2026, Chang S. Bae wrote:
> Now that KVM exposes the APX feature to guests on APX-capable systems,
> extend the selftests to validate XCR0 configuration and state management.
>
> Since APX repurposes the XSAVE area previously used by MPX in the
> non-compacted format, add a check to ensure that MPX states are not set
> when APX is enabled.
>
> Also, load non-init APX state data in the guest so that XSTATE_BV[APX] is
> set, allowing validation of APX state testing.

I assume/hope there a more tests coming in future versions...

KVM-Unit-Tests' x86/xsave.c would be a good fit, or at least a good reference
for what we should be testing as far as EGPR accesses are concerned.