Re: [PATCH 1/4] x86/fpu: Clear XSTATE_BV[i] in save state whenever XFD[i]=1
From: Paolo Bonzini
Date: Wed Jan 07 2026 - 17:33:35 EST
On Wed, Jan 7, 2026 at 1:29 AM Chang S. Bae <chang.seok.bae@xxxxxxxxx> wrote:
>
> 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/
There are two possible "we"s:
1) the code - in the context of this patch this would be "we force
XSTATE_BV[i] to 0" or "we can be preempted", and I agree it's bad form
2) the community, or the maintainers - this is the case in the commit
message, and I think it's acceptable. While I (Paolo) cannot forcibly
come to your computer and clear XSTATE_BV[i], I certainly can decide
that KVM will do so. :)
> > 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>
> Reviewed-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
Thanks!
Paolo