[GIT PULL] KVM fixes for Linux 6.12-rc5

From: Paolo Bonzini
Date: Mon Oct 21 2024 - 13:17:53 EST


Linus,

The following changes since commit c8d430db8eec7d4fd13a6bea27b7086a54eda6da:

Merge tag 'kvmarm-fixes-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD (2024-10-06 03:59:22 -0400)

are available in the Git repository at:

https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus

for you to fetch changes up to e9001a382fa2c256229adc68d55212028b01d515:

Merge tag 'kvmarm-fixes-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD (2024-10-20 12:10:59 -0400)

After seeing your release commentary yesterday, well, this is not
going to make rc5 smaller. The short description is that there is
mostly Arm stuff here (due to me sitting on submaintainer pull requests
for perhaps too long) and a bit of everything for x86 (host, guest,
selftests, docs).

Paolo

----------------------------------------------------------------
ARM64:

* Fix the guest view of the ID registers, making the relevant fields
writable from userspace (affecting ID_AA64DFR0_EL1 and ID_AA64PFR1_EL1)

* Correcly expose S1PIE to guests, fixing a regression introduced
in 6.12-rc1 with the S1POE support

* Fix the recycling of stage-2 shadow MMUs by tracking the context
(are we allowed to block or not) as well as the recycling state

* Address a couple of issues with the vgic when userspace misconfigures
the emulation, resulting in various splats. Headaches courtesy
of our Syzkaller friends

* Stop wasting space in the HYP idmap, as we are dangerously close
to the 4kB limit, and this has already exploded in -next

* Fix another race in vgic_init()

* Fix a UBSAN error when faking the cache topology with MTE
enabled

RISCV:

* RISCV: KVM: use raw_spinlock for critical section in imsic

x86:

* A bandaid for lack of XCR0 setup in selftests, which causes trouble
if the compiler is configured to have x86-64-v3 (with AVX) as the
default ISA. Proper XCR0 setup will come in the next merge window.

* Fix an issue where KVM would not ignore low bits of the nested CR3
and potentially leak up to 31 bytes out of the guest memory's bounds

* Fix case in which an out-of-date cached value for the segments could
by returned by KVM_GET_SREGS.

* More cleanups for KVM_X86_QUIRK_SLOT_ZAP_ALL

* Override MTRR state for KVM confidential guests, making it WB by
default as is already the case for Hyper-V guests.

Generic:

* Remove a couple of unused functions

----------------------------------------------------------------
Cyan Yang (1):
RISCV: KVM: use raw_spinlock for critical section in imsic

Dr. David Alan Gilbert (2):
KVM: Remove unused kvm_vcpu_gfn_to_pfn
KVM: Remove unused kvm_vcpu_gfn_to_pfn_atomic

Ilkka Koskinen (1):
KVM: arm64: Fix shift-out-of-bounds bug

Kirill A. Shutemov (1):
x86/kvm: Override default caching mode for SEV-SNP and TDX

Marc Zyngier (3):
Merge branch kvm-arm64/idregs-6.12 into kvmarm/fixes
KVM: arm64: Don't eagerly teardown the vgic on init error
KVM: arm64: Shave a few bytes from the EL2 idmap code

Mark Brown (1):
KVM: arm64: Expose S1PIE to guests

Maxim Levitsky (1):
KVM: VMX: reset the segment cache after segment init in vmx_vcpu_reset()

Oliver Upton (7):
KVM: arm64: Unregister redistributor for failed vCPU creation
KVM: arm64: nv: Keep reference on stage-2 MMU when scheduled out
KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed
KVM: arm64: nv: Punt stage-2 recycling to a vCPU request
KVM: arm64: nv: Clarify safety of allowing TLBI unmaps to reschedule
KVM: arm64: vgic: Don't check for vgic_ready() when setting NR_IRQS
KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration

Paolo Bonzini (2):
Merge tag 'kvmarm-fixes-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
Merge tag 'kvmarm-fixes-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

Sean Christopherson (5):
KVM: x86/mmu: Zap only SPs that shadow gPTEs when deleting memslot
KVM: x86/mmu: Add lockdep assert to enforce safe usage of kvm_unmap_gfn_range()
KVM: x86: Clean up documentation for KVM_X86_QUIRK_SLOT_ZAP_ALL
KVM: nSVM: Ignore nCR3[4:0] when loading PDPTEs from memory
KVM: selftests: Fix out-of-bounds reads in CPUID test's array lookups

Shameer Kolothum (1):
KVM: arm64: Make the exposed feature bits in AA64DFR0_EL1 writable from userspace

Shaoqin Huang (4):
KVM: arm64: Disable fields that KVM doesn't know how to handle in ID_AA64PFR1_EL1
KVM: arm64: Use kvm_has_feat() to check if FEAT_SSBS is advertised to the guest
KVM: arm64: Allow userspace to change ID_AA64PFR1_EL1
KVM: selftests: aarch64: Add writable test for ID_AA64PFR1_EL1

Vitaly Kuznetsov (1):
KVM: selftests: x86: Avoid using SSE/AVX instructions

Documentation/virt/kvm/api.rst | 16 ++---
Documentation/virt/kvm/locking.rst | 2 +-
arch/arm64/include/asm/kvm_asm.h | 1 +
arch/arm64/include/asm/kvm_host.h | 7 +++
arch/arm64/include/asm/kvm_mmu.h | 3 +-
arch/arm64/include/asm/kvm_nested.h | 4 +-
arch/arm64/kernel/asm-offsets.c | 1 +
arch/arm64/kvm/arm.c | 5 ++
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 52 ++++++++-------
arch/arm64/kvm/hypercalls.c | 12 ++--
arch/arm64/kvm/mmu.c | 15 ++---
arch/arm64/kvm/nested.c | 53 +++++++++++++---
arch/arm64/kvm/sys_regs.c | 77 ++++++++++++++++++++---
arch/arm64/kvm/vgic/vgic-init.c | 41 ++++++++++--
arch/arm64/kvm/vgic/vgic-kvm-device.c | 7 ++-
arch/riscv/kvm/aia_imsic.c | 8 +--
arch/x86/kernel/kvm.c | 4 ++
arch/x86/kvm/mmu/mmu.c | 27 +++++---
arch/x86/kvm/svm/nested.c | 6 +-
arch/x86/kvm/vmx/vmx.c | 6 +-
include/linux/kvm_host.h | 2 -
tools/testing/selftests/kvm/Makefile | 1 +
tools/testing/selftests/kvm/aarch64/set_id_regs.c | 16 ++++-
tools/testing/selftests/kvm/x86_64/cpuid_test.c | 2 +-
virt/kvm/kvm_main.c | 12 ----
25 files changed, 277 insertions(+), 103 deletions(-)