Re: [PATCH v8 03/20] KVM: x86: Support APX state for XSAVE ABI

From: Chang S. Bae

Date: Fri Nov 06 2026 - 01:00:14 EST


On 11/5/2026 9:46 PM, Jim Mattson wrote:

Look at the lines immediately preceding the ones you quoted in
copy_uabi_to_xstate():

/*
* The state that came in from userspace was user-state only.
* Mask all the user states out of 'xfeatures':
*/
xsave->header.xfeatures &= XFEATURE_MASK_SUPERVISOR_ALL;

/*
* Add back in the features that came in from userspace:
*/
xsave->header.xfeatures |= hdr.xfeatures;

All user-state bits in xsave->header.xfeatures are cleared before
hdr.xfeatures is ORed in. If userspace clears bit i for any user state
component in hdr.xfeatures, bit i in xsave->header.xfeatures is cleared,
and the component is reset to its initial state.

Ah, right. Looks like sticking to what I thought before...