Re: [PATCH v5 0/9] x86/bugs: KVM: L1TF and MMIO Stale Data cleanups

From: Sean Christopherson

Date: Fri Nov 21 2025 - 13:56:27 EST


On Thu, 13 Nov 2025 15:37:37 -0800, Sean Christopherson wrote:
> Clean up KVM's handling of L1TF and MMIO Stale data, as the code has bit
> rotted a bit and is harder than it should be to understand, and has a few
> warts.
>
> TL;DR:
>
> - Unify L1TF flushing under per-CPU variable
> - Bury L1TF L1D flushing under CONFIG_CPU_MITIGATIONS=y
> - Move MMIO Stale Data into asm, and do VERW at most once per VM-Enter
>
> [...]

Applied to kvm-x86 misc, with fixups for Boris' feedback.

[1/9] KVM: VMX: Use on-stack copy of @flags in __vmx_vcpu_run()
https://github.com/kvm-x86/linux/commit/844afc1af3a9
[2/9] x86/bugs: Use VM_CLEAR_CPU_BUFFERS in VMX as well
https://github.com/kvm-x86/linux/commit/aba7de6088be
[3/9] x86/bugs: Decouple ALTERNATIVE usage from VERW macro definition
https://github.com/kvm-x86/linux/commit/afb99ffbd582
[4/9] x86/bugs: Use an x86 feature to track the MMIO Stale Data mitigation
https://github.com/kvm-x86/linux/commit/f6106d41ec84
[5/9] KVM: VMX: Handle MMIO Stale Data in VM-Enter assembly via ALTERNATIVES_2
https://github.com/kvm-x86/linux/commit/e6ff1d61de51
[6/9] x86/bugs: KVM: Move VM_CLEAR_CPU_BUFFERS into SVM as SVM_CLEAR_CPU_BUFFERS
https://github.com/kvm-x86/linux/commit/fc704b578976
[7/9] KVM: VMX: Bundle all L1 data cache flush mitigation code together
https://github.com/kvm-x86/linux/commit/0abd9610d6c6
[8/9] KVM: VMX: Disable L1TF L1 data cache flush if CONFIG_CPU_MITIGATIONS=n
https://github.com/kvm-x86/linux/commit/05bd63959a9d
[9/9] KVM: x86: Unify L1TF flushing under per-CPU variable
https://github.com/kvm-x86/linux/commit/38ee66cb1845

--
https://github.com/kvm-x86/linux/tree/next