Re: [PATCH v4 06/21] x86/fpu: Ignore APX when copying from/to guest FPU

From: Paolo Bonzini

Date: Fri May 15 2026 - 04:19:48 EST


On Fri, May 15, 2026 at 4:10 AM Chang S. Bae <chang.seok.bae@xxxxxxxxx> wrote:
>
> On 5/14/2026 9:04 AM, Paolo Bonzini wrote:
> >
> > Separately, it's possible to avoid hardcoding APX by passing a mask
> > argument to fpu_copy_uabi_to_guest_fpstate and
> > fpu_copy_guest_fpstate_to_uabi. KVM can then pass
> > ~(u64)XFEATURE_MASK_APX.
>
> Yeah, that’s possible, though it also needs to ensure XSTATE_BV[APX] = 0
> in the UABI buffer to avoid:
>
> if (ustate->xsave.header.xfeatures & ~xcr0)
> return -EINVAL;
>
> V3 previously handled that on the KVM side. Then, V4 moved it to the
> x86/fpu core to make the exclusion more explicit.

Based on Dave's email, I don't think any change is needed as long as
it's clear that the exceptional treatment of APX is transparent for
userspace. But let's wait for him to confirm.

Paolo