Re: [PATCH 1/4] x86/fpu: Clear XSTATE_BV[i] in save state whenever XFD[i]=1

From: Chang S. Bae

Date: Tue Jan 06 2026 - 19:28:59 EST


On 1/1/2026 1:05 AM, Paolo Bonzini wrote:

Therefore, XFD can only go out of sync with XSTATE_BV in the above
interrupt case, or in similar scenarios involving preemption on

This seems to restate the scenario already described above; I’m not sure
whether the repetition is intentional.

preemptible kernels, and it we can consider it (de facto) part of KVM
^^^^^
I assume you meant 'we' here though, you might want to slightly rephrase it, given the previous debate:

https://lore.kernel.org/all/87iko54f42.ffs@tglx/

ABI that KVM_GET_XSAVE returns XSTATE_BV[i]=0 for XFD-disabled features.

On my side, testing on AMX systems, I was able to reproduce the issue described and confirm that this patch resolves it:

Tested-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>

The added guards on these paths also look reasonable to me with the established KVM ABI. So,

Reviewed-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>

Thanks,
Chang