Skip to content

Fixes for various (mostly x86) KVM vulnerabilities

Paolo Bonzini kvm lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17KVM: x86/mmu: Flush TLBs if child SPTE is zapped when splitting a huge SPTEarch/x86/kvm/mmu/mmu.c+16 -50 replies
2/17KVM: x86/mmu: Propagate the return from kvm_zap_all_rmap_sptes() out of __rmap_add()arch/x86/kvm/mmu/mmu.c+3 -40 replies
3/17KVM: x86: Disable hypervisor (VMX Preemption) timer if TSC deadline wrapsarch/x86/kvm/lapic.c+24 -130 replies
4/17KVM: x86: Reset local APIC timer metadata on RESET, INIT, and KVM_SET_LAPICarch/x86/kvm/lapic.c+22 -80 replies
5/17RISC-V: KVM: Flush TLBs *before* dropping mmu_lock, e.g. when yieldingarch/riscv/kvm/gstage.c arch/riscv/kvm/mmu.c+9 -20 replies
6/17LoongArch: KVM: Flush TLBs *before* dropping mmu_lockarch/loongarch/kvm/mmu.c+5 -70 replies
7/17KVM: x86/mmu: Flush all TLB entries, not a precise range, when yieldingarch/x86/kvm/mmu/mmu.c+6 -20 replies
8/17KVM: x86/mmu: Flush TLBs in kvm_unmap_gfn_range() if the unmap may block/yieldarch/x86/kvm/mmu/mmu.c+15 -00 replies
9/17KVM: x86/xen: Pin kvm->mm prior to borrowing mm when setting event channelarch/x86/kvm/xen.c+6 -10 replies
10/17KVM: Fold kvm_flush_shadow_all() into kvm_mmu_notifier_release()virt/kvm/kvm_main.c+2 -70 replies
11/17KVM: WARN if there are in-flight memslot updates when a VM's process exitsvirt/kvm/kvm_main.c+8 -10 replies
12/17KVM: Set mn_active_invalidate_count when the VM's mm is releasedvirt/kvm/kvm_main.c+28 -140 replies
13/17KVM: Invalidate all GFN=>PFN caches when VM and/or its process is dyingvirt/kvm/kvm_main.c virt/kvm/kvm_mm.h virt/kvm/pfncache.c+15 -00 replies
14/17x86/fpu: Bail early from guest XFD update if XFD isn't supportedarch/x86/kernel/fpu/core.c+5 -00 replies
15/17x86/fpu: Clear XSTATE_BV[i] in guest XSAVE state if guest FPU isn't in-usearch/x86/kernel/fpu/core.c+17 -60 replies
16/17x86/fpu: Ensure guest FPU is resident in hardware when updating actual XFD MSRarch/x86/kernel/fpu/core.c+10 -110 replies
17/17KVM: VMX: Ensure pCPU is valid before sending IPI to deliver posted IRQarch/x86/kvm/vmx/common.h arch/x86/kvm/vmx/tdx.c arch/x86/kvm/x86.c+6 -50 replies

Reviews trailers per patch

2 of 17 patches have a Reviewed-by or Acked-by.

PatchDave HansenJim Mattson
1/17
2/17
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17A-b R-b
16/17A-b
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/17] Fixes for various (mostly x86) KVM vulnerabilities

Loongarch:
- Flush TLBs *before* dropping mmu_lock

RISC-V:
- Flush TLBs *before* dropping mmu_lock

x86:
- Flush TLB *before* dropping mmu_lock, and flush them entirely
- Flush TLBs if child SPTE is zapped when splitting a huge SPTE
- Pin kvm->mm prior to borrowing mm when setting event channel
- Disable hypervisor (VMX Preemption) timer if TSC deadline wraps
- Reset local APIC timer metadata on RESET, INIT, and KVM_SET_LAPIC
- Ensure guest FPU is resident in hardware when updating actual XFD MSR
- Ensure pCPU is valid before sending IPI to deliver posted IRQ

Generic:
- Invalidate all GFN=>PFN caches when VM and/or its process is dying

Paolo

Kyle Zeng (3):
RISC-V: KVM: Flush TLBs *before* dropping mmu_lock, e.g. when yielding
LoongArch: KVM: Flush TLBs *before* dropping mmu_lock
KVM: x86/mmu: Flush all TLB entries, not a precise range, when
yielding

Sean Christopherson (14):
KVM: x86/mmu: Flush TLBs if child SPTE is zapped when splitting a huge
SPTE
KVM: x86/mmu: Propagate the return from kvm_zap_all_rmap_sptes() out

    of __rmap_add()

KVM: x86: Disable hypervisor (VMX Preemption) timer if TSC deadline
wraps
KVM: x86: Reset local APIC timer metadata on RESET, INIT, and
KVM_SET_LAPIC
KVM: x86/mmu: Flush TLBs in kvm_unmap_gfn_range() if the unmap may
block/yield
KVM: x86/xen: Pin kvm->mm prior to borrowing mm when setting event
channel
KVM: Fold kvm_flush_shadow_all() into kvm_mmu_notifier_release()
KVM: WARN if there are in-flight memslot updates when a VM's process
exits
KVM: Set mn_active_invalidate_count when the VM's mm is released
KVM: Invalidate all GFN=>PFN caches when VM and/or its process is
dying
x86/fpu: Bail early from guest XFD update if XFD isn't supported x86/fpu: Clear XSTATE_BV[i] in guest XSAVE state if guest FPU isn't
in-use
x86/fpu: Ensure guest FPU is resident in hardware when updating actual
XFD MSR
KVM: VMX: Ensure pCPU is valid before sending IPI to deliver posted
IRQ

 arch/loongarch/kvm/mmu.c   | 12 +++----
 arch/riscv/kvm/gstage.c    |  9 ++++-
 arch/riscv/kvm/mmu.c       |  2 +-
 arch/x86/kernel/fpu/core.c | 37 ++++++++++++++-------
 arch/x86/kvm/lapic.c       | 67 ++++++++++++++++++++++++++------------
 arch/x86/kvm/mmu/mmu.c     | 49 ++++++++++++++++++++++------
 arch/x86/kvm/vmx/common.h  |  5 +--
 arch/x86/kvm/vmx/tdx.c     |  4 +--
 arch/x86/kvm/x86.c         |  2 +-
 arch/x86/kvm/xen.c         |  7 +++-
 virt/kvm/kvm_main.c        | 61 +++++++++++++++++++++-------------
 virt/kvm/kvm_mm.h          |  2 ++
 virt/kvm/pfncache.c        | 12 +++++++
 13 files changed, 190 insertions(+), 79 deletions(-)
Signature · 1 line
2.56.1