Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v3 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt
@ 2026-11-30  8:48 Dan Carpenter
  2026-11-30  8:48 ` [PATCH v3 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Dan Carpenter @ 2026-11-30  8:48 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, Fuad Tabba, Joey Gouly, Steffen Eiden,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	Mark Rutland, Rusty Russell, Marcelo Tosatti, James Morse,
	Sebastian Ott, Eric Auger, Paolo Bonzini, Sean Christopherson,
	Shuah Khan
  Cc: Dan Carpenter, Karthik Bhargavan, Clément Blaudeau,
	linux-arm-kernel, kvmarm, linux-kernel, kvm, linux-kselftest,
	Sashiko, stable

Our formal proof work at Pereq found a way to trigger a WARN() by
injecting two SErrors.  That single patch evolved into 8 fixes and
a self test.

Changes in v3:
  PATCH 1: KVM: arm64: nv: Use a vcpu request to reprogram the PMU
  This is a new patch.  Sashiko found a sleeping in atomic bug.  Move
  kvm_pmu_nested_transition() to a vCPU request to fix this as Oliver
  Upton suggested.

  PATCH 3: KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 when resetting a vcpu
  Do this in kvm_reset_vcpu_core() which is the shared helper with s390
  as Suzuki Poulose suggested.

  PATCH 6: KVM: arm64: nv: Replace a pending SError when injecting a new one
  Improve the commit message as Oliver requested

Changes in v2:
  Added 7 new bug fixes and a selftest.
- Link to v2: https://lore.kernel.org/all/20261125-double_exception-v2-0-224689d8a764@pereq.eu/

Included in v1:
  [PATCH v2 7/8] KVM: arm64: nv: Re-inject a stored SError after the exit is handled
- Link to v1: https://patch.msgid.link/20261123-double_exception-v1-1-cd82b59a232d@pereq.eu

Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
To: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oupton@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
To: Joey Gouly <joey.gouly@arm.com>
To: Steffen Eiden <seiden@linux.ibm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Zenghui Yu <yuzenghui@huawei.com>
To: Catalin Marinas <catalin.marinas@arm.com>
To: Will Deacon <will@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
To: Marcelo Tosatti <mtosatti@redhat.com>
To: James Morse <james.morse@arm.com>
To: Sebastian Ott <sebott@redhat.com>
To: Eric Auger <eric.auger@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
To: Shuah Khan <shuah@kernel.org>
Cc: Karthik Bhargavan <karthik@pereq.eu>
Cc: Clément Blaudeau <clement@cryspen.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: kvmarm@lists.linux.dev
Cc: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>

---
Dan Carpenter (9):
      KVM: arm64: nv: Use a vcpu request to reprogram the PMU
      KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu
      KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 when resetting a vcpu
      KVM: arm64: Discard a pending SError when resetting a vcpu
      KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu()
      KVM: arm64: nv: Replace a pending SError when injecting a new one
      KVM: arm64: nv: Don't deliver a pending SError to the wrong guest
      KVM: arm64: nv: Re-inject a stored SError after the exit is handled
      KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state

 arch/arm64/include/asm/kvm_emulate.h           |   9 ++
 arch/arm64/include/asm/kvm_host.h              |   1 +
 arch/arm64/kvm/arm.c                           |   4 +
 arch/arm64/kvm/emulate-nested.c                |  18 ++-
 arch/arm64/kvm/inject_fault.c                  |  10 ++
 arch/arm64/kvm/nested.c                        |  16 +-
 arch/arm64/kvm/reset.c                         |   5 +
 tools/testing/selftests/kvm/Makefile.kvm       |   1 +
 tools/testing/selftests/kvm/arm64/vcpu_reset.c | 210 +++++++++++++++++++++++++
 9 files changed, 262 insertions(+), 12 deletions(-)
---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261130-double_exception_v3-a92fc5e456b4

Best regards,
--  
Dan Carpenter <dan@pereq.eu>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-30 13:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  8:48 [PATCH v3 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 3/9] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 " Dan Carpenter
2026-11-30 13:36   ` Steffen Eiden
2026-11-30  8:48 ` [PATCH v3 4/9] KVM: arm64: Discard a pending SError " Dan Carpenter
2026-11-30 13:38   ` Steffen Eiden
2026-11-30  8:48 ` [PATCH v3 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 6/9] KVM: arm64: nv: Replace a pending SError when injecting a new one Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
2026-11-30  8:48 ` [PATCH v3 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox