Re: [PATCH v2 0/4] x86, fpu/kvm: fix crash with AMX

From: Borislav Petkov

Date: Thu Jan 15 2026 - 12:05:38 EST


On Thu, Jan 15, 2026 at 08:39:51AM -0800, Sean Christopherson wrote:
> : 1. vCPU loads non-init XTILE data without ever setting XFD to a non-zero value
> : (KVM only disables XFD interception on writes with a non-zero value).
> : 2. Guest executes WRMSR(MSR_IA32_XFD) to set XFD[18] = 1
> : 3. VM-Exit due to the WRMSR
> : 4. Host IRQ arrives and triggers kernel_fpu_begin()
> : 5. save_fpregs_to_fpstate() saves guest FPU with XFD[18]=0
> : 6. fpu_update_guest_xfd() stuffs guest_fpu->fpstate->xfd = XFD[18]=1
> : 7. vcpu_enter_guest() attempts to load XTILE data with XFD[18]=1

I don't know, maybe I'm missing an important aspect but if not, I'm wondering
how you folks are not seeing the big honking discrepancy here.

*Anything* poking in MSRs under the kernel's feet where the kernel doesn't
know about that poking, is bound to cause trouble. And this is no exception.

Step 5. above should use the updated XFD[18]=1. The guest just disabled that
state! Anything else is bonkers.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette