Date: Fri, 11 Oct 2024 14:27:56 +0100 From: Marc Zyngier To: Paolo Bonzini Cc: Alexander Potapenko , Joey Gouly , Mark Brown , Oliver Upton , Shameer Kolothum , Shaoqin Huang , Suzuki K Poulose , Zenghui Yu , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [GIT PULL] KVM/arm64 fixes for 6.12, take #2 Paolo, Here's the second set of fixes for 6.12. We have a handful of fixes for the ID register configuration (I had originally queued them for -rc1, and somehow managed to accidentally drop the branch on the floor), our NV shadow page tables, the vgic, and a fix for a regression introduced in -rc1. As usual, details in the tag. Please pull, M. The following changes since commit a1d402abf8e3ff1d821e88993fc5331784fac0da: KVM: arm64: Fix kvm_has_feat*() handling of negative features (2024-10-03 19:35:27 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-6.12-2 for you to fetch changes up to df5fd75ee305cb5927e0b1a0b46cc988ad8db2b1: KVM: arm64: Don't eagerly teardown the vgic on init error (2024-10-11 13:40:25 +0100) ---------------------------------------------------------------- KVM/arm64 fixes for 6.12, take #2 - 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 ---------------------------------------------------------------- Marc Zyngier (2): Merge branch kvm-arm64/idregs-6.12 into kvmarm/fixes KVM: arm64: Don't eagerly teardown the vgic on init error Mark Brown (1): KVM: arm64: Expose S1PIE to guests Oliver Upton (5): 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 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 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/kvm/arm.c | 5 ++ arch/arm64/kvm/hypercalls.c | 12 ++-- arch/arm64/kvm/mmu.c | 15 ++--- arch/arm64/kvm/nested.c | 53 +++++++++++++--- arch/arm64/kvm/sys_regs.c | 75 +++++++++++++++++++++-- arch/arm64/kvm/vgic/vgic-init.c | 28 +++++++-- tools/testing/selftests/kvm/aarch64/set_id_regs.c | 16 ++++- 10 files changed, 183 insertions(+), 35 deletions(-) . Date: Thu, 17 Oct 2024 10:09:56 +0100 From: Marc Zyngier To: Paolo Bonzini Cc: Anshuman Khandual , Gavin Shan , Ilkka Koskinen , Nathan Chancellor , Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [GIT PULL] KVM/arm64 fixes for 6.12, take #3 Paolo, Here's another set of fixes for KVM/arm64, addressing another vgic init race as well as a build error (full details in the tag below). I notice that you haven't pulled [1] yet, so hopefully this will also serve as a gentle reminder. Please pull, M. [1] https://lore.kernel.org/r/20241011132756.3793137-1-maz@kernel.org The following changes since commit df5fd75ee305cb5927e0b1a0b46cc988ad8db2b1: KVM: arm64: Don't eagerly teardown the vgic on init error (2024-10-11 13:40:25 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-6.12-3 for you to fetch changes up to 78a00555550042ed77b33ace7423aced228b3b4e: KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration (2024-10-17 09:20:48 +0100) ---------------------------------------------------------------- KVM/arm64 fixes for 6.12, take #3 - 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 ---------------------------------------------------------------- Ilkka Koskinen (1): KVM: arm64: Fix shift-out-of-bounds bug Marc Zyngier (1): KVM: arm64: Shave a few bytes from the EL2 idmap code Oliver Upton (2): KVM: arm64: vgic: Don't check for vgic_ready() when setting NR_IRQS KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/kernel/asm-offsets.c | 1 + arch/arm64/kvm/hyp/nvhe/hyp-init.S | 52 +++++++++++++++++++---------------- arch/arm64/kvm/sys_regs.c | 2 +- arch/arm64/kvm/vgic/vgic-init.c | 13 +++++++-- arch/arm64/kvm/vgic/vgic-kvm-device.c | 7 ++++- 6 files changed, 49 insertions(+), 27 deletions(-) .