* [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt
@ 2026-12-04 8:48 Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter,
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 v4:
Remove a pointless comment from patch 3.
Add Steffen's R-b tag to patches, 3 and 4.
Fix a Sashiko bug in the selftest.
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>
---
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 | 8 +
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 | 211 +++++++++++++++++++++++++
9 files changed, 262 insertions(+), 12 deletions(-)
---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261203-double_exception_v4-b889e07f1911
Best regards,
--
Dan Carpenter <dan@pereq.eu>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
` (7 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter,
Sashiko, stable
Sashiko pointed out a sleeping in atomic bug in
kvm_pmu_nested_transition().
BUG: sleeping function called from invalid context at ./include/linux/sched/mm.h:322
kmem_cache_alloc_node_noprof (mm/slub.c:4679)
perf_event_alloc (kernel/events/core.c:13522)
perf_event_create_kernel_counter (kernel/events/core.c:14500 kernel/events/core.c:14477)
kvm_pmu_create_perf_event (arch/arm64/kvm/pmu-emul.c:743 (discriminator 1))
kvm_pmu_nested_transition (arch/arm64/kvm/pmu-emul.c:1360)
kvm_inject_nested (arch/arm64/kvm/emulate-nested.c:2932)
kvm_inject_nested_serror (arch/arm64/kvm/emulate-nested.c:2984)
kvm_inject_serror_esr (arch/arm64/kvm/inject_fault.c:365)
kvm_nested_sync_hwstate (arch/arm64/kvm/nested.c:2245 (discriminator 1))
kvm_arch_vcpu_ioctl_run (arch/arm64/kvm/arm.c:1560)
The problem is that kvm_arch_vcpu_ioctl_run() calls preempt_disable()
and perf_event_alloc() does a sleeping allocation. Fix this by moving
the transition into a vCPU request. It is safe to delay the transition
because the request is still handled before the vcpu runs again.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-232776@kernel.org/
Suggested-by: Oliver Upton <oupton@kernel.org>
Fixes: ae323e035801 ("KVM: arm64: nv: Reprogram PMU events affected by nested transition")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: New patch
---
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/kvm/arm.c | 3 +++
arch/arm64/kvm/emulate-nested.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 0614c3b3a40d..6a22156c9107 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -62,6 +62,7 @@
#define KVM_REQ_MAP_L1_VNCR_EL2 KVM_ARCH_REQ(10)
#define KVM_REQ_VGIC_PROCESS_UPDATE KVM_ARCH_REQ(11)
#define KVM_REQ_RELOAD_GICv5 KVM_ARCH_REQ(12)
+#define KVM_REQ_NESTED_PMU_TRANSITION KVM_ARCH_REQ(13)
/* Bit indices for kvm_arch::flags */
enum {
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index a148e80d0aef..fe5e4e47b935 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1310,6 +1310,9 @@ static int check_vcpu_requests(struct kvm_vcpu *vcpu)
return 0;
check_nested_vcpu_requests(vcpu);
+
+ if (kvm_check_request(KVM_REQ_NESTED_PMU_TRANSITION, vcpu))
+ kvm_pmu_nested_transition(vcpu);
}
return 1;
diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index 39136a89d74b..ee71dfc4b861 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -2837,7 +2837,7 @@ void kvm_emulate_nested_eret(struct kvm_vcpu *vcpu)
preempt_enable();
if (kvm_vcpu_has_pmu(vcpu))
- kvm_pmu_nested_transition(vcpu);
+ kvm_make_request(KVM_REQ_NESTED_PMU_TRANSITION, vcpu);
}
static void kvm_inject_el2_exception(struct kvm_vcpu *vcpu, u64 esr_el2,
@@ -2929,7 +2929,7 @@ static int kvm_inject_nested(struct kvm_vcpu *vcpu, u64 esr_el2,
preempt_enable();
if (kvm_vcpu_has_pmu(vcpu))
- kvm_pmu_nested_transition(vcpu);
+ kvm_make_request(KVM_REQ_NESTED_PMU_TRANSITION, vcpu);
return 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:24 ` Steffen Eiden
2026-12-04 8:48 ` [PATCH v4 3/9] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 " Dan Carpenter
` (6 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter, stable
When a vcpu exits to userspace for an MMIO access, the next KVM_RUN
completes it. So for a read, the next run increments the PC counter
and copies data from userspace to the destination vcpu register.
A reset should cancel the MMIO read/write access. Otherwise the next
run will copy memory from userspace to the vcpu and increment the PC
which skips the first instruction.
Clear vcpu->mmio_needed in kvm_reset_vcpu().
Fixes: 45e96ea6b369 ("KVM: ARM: Handle I/O aborts")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: no change
v2: new patch
---
arch/arm64/kvm/reset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index 10eb7249aa9e..26081d273408 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -199,6 +199,7 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
/* Reset core registers */
kvm_reset_vcpu_core(vcpu);
+ vcpu->mmio_needed = false;
/* Reset system registers */
kvm_reset_sys_regs(vcpu);
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 3/9] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 when resetting a vcpu
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 4/9] KVM: arm64: Discard a pending SError " Dan Carpenter
` (5 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter, stable
Resetting a vcpu keeps the old values of SP_EL1, ELR_EL1 and SPSR_EL1.
Commit e47c2055c68e ("KVM: arm64: Make struct kvm_regs userspace-only")
changed the reset to only clear the general purpose registers, SP, PC
and PSTATE, and later commits moved these three registers to the system
register array without a reset value. Commit 85d703746154 ("KVM: arm64:
Fully zero the vcpu state on reset") fixed the FP registers and the
32-bit SPSRs the same commit missed, but not these three.
The impact is that the guest that boots next can read the previous
kernel's stack pointer and exception return address. KVM_GET_ONE_REG
also returns the old values to userspace, and a rebooted VM doesn't
start in the same state as a new one.
Zero them in kvm_reset_vcpu_core(), which pkvm_reset_vcpu() also uses
when a protected vcpu is turned on with PSCI CPU_ON.
Fixes: e47c2055c68e ("KVM: arm64: Make struct kvm_regs userspace-only")
Fixes: 9d4ec80be2eb ("KVM: arm64: Handle PSCI calls for protected VMs at EL2")
Cc: stable@vger.kernel.org
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: Drop the "NULL on s390" comment (Steffen Eiden)
v3: Suzuki K Poulose pointed out this should be done in
kvm_reset_vcpu_core() instead of kvm_reset_vcpu().
v2: new patch
---
arch/arm64/include/asm/kvm_emulate.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index 2d7c82cfb8a4..b66689818515 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -777,6 +777,8 @@ static inline void kvm_reset_fpsimd(struct kvm_vcpu *vcpu)
/* Reset a vcpu's core registers. */
static inline void kvm_reset_vcpu_core(struct kvm_vcpu *vcpu)
{
+ u64 *elr_el1 = __ctxt_sys_reg(&vcpu->arch.ctxt, ELR_EL1);
+ u64 *spsr_el1 = __ctxt_sys_reg(&vcpu->arch.ctxt, SPSR_EL1);
u32 pstate;
if (vcpu_el1_is_32bit(vcpu))
@@ -790,6 +792,11 @@ static inline void kvm_reset_vcpu_core(struct kvm_vcpu *vcpu)
memset(vcpu_gp_regs(vcpu), 0, sizeof(vcpu_gp_regs(vcpu)));
*vcpu_pc(vcpu) = 0;
*vcpu_sp_el0(vcpu) = 0;
+ *vcpu_sp_el1(vcpu) = 0;
+ if (elr_el1)
+ *elr_el1 = 0;
+ if (spsr_el1)
+ *spsr_el1 = 0;
kvm_reset_fpsimd(vcpu);
vcpu->arch.ctxt.spsr_abt = 0;
vcpu->arch.ctxt.spsr_und = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 4/9] KVM: arm64: Discard a pending SError when resetting a vcpu
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (2 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 3/9] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 " Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:03 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
` (4 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter, stable
Resetting a vcpu with the KVM_ARM_VCPU_INIT ioctl keeps a pending
SError. We used to rely on vcpu_reset_hcr() to clear the SError but
commit f1ff3fc5209a ("KVM: arm64: unify code to prepare traps") changed
it to only reset HCR_EL2 before the vcpu's very first KVM_RUN.
If we reboot a guest while there is a pending SError then KVM delivers
it to the freshly booted guest.
Clear HCR_EL2.VSE in kvm_reset_vcpu().
Fixes: f1ff3fc5209a ("KVM: arm64: unify code to prepare traps")
Cc: stable@vger.kernel.org
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: no change
v2: new patch
---
arch/arm64/kvm/reset.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index 26081d273408..4b1917b48edc 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -204,6 +204,9 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
/* Reset system registers */
kvm_reset_sys_regs(vcpu);
+ /* Discard a pending SError */
+ vcpu->arch.hcr_el2 &= ~HCR_EL2_VSE;
+
/*
* Additional reset state handling that PSCI may have imposed on us.
* Must be done after all the sys_reg reset.
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu()
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (3 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 4/9] KVM: arm64: Discard a pending SError " Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:03 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 6/9] KVM: arm64: nv: Replace a pending SError when injecting a new one Dan Carpenter
` (3 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter, stable
Vanilla KVM stores a pending SError in ->hcr_el2 but nested KVM stores
it in the NESTED_SERROR_PENDING flag. Clear the flag for nested
SErrors when we reset the vcpu.
Fixes: 77ee70a07357 ("KVM: arm64: nv: Honor SError exception routing / masking")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: no change
v2: New patch. I split it up like this to make backporting easier.
---
arch/arm64/kvm/reset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index 4b1917b48edc..1899d927164c 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -206,6 +206,7 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
/* Discard a pending SError */
vcpu->arch.hcr_el2 &= ~HCR_EL2_VSE;
+ vcpu_clear_flag(vcpu, NESTED_SERROR_PENDING);
/*
* Additional reset state handling that PSCI may have imposed on us.
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 6/9] KVM: arm64: nv: Replace a pending SError when injecting a new one
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (4 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
` (2 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter,
Sashiko, stable
The kvm_inject_serror_esr() function injects SErrors as the name
implies. The bug is that it doesn't handle already pending errors
correctly in nested virtualization.
In vanilla KVM the kvm_inject_serror_esr() function always sets
the SError to pending. However with nested KVM, it might set it
to pending or it might deliver the SError directly. We can only
have one pending error at a time. Imagine we enter the function
with an SError pending already. In the current code if we decide
to pend the new error that's fine, everything works. However if
we decide to deliver it directly then the pend flags should be
cleared but they are not. So we deliver the SError directly and
then deliver the SError that was pending on the next exit or entry.
This bug can be triggered in the current code, however in a later patch
in this series "KVM: arm64: nv: Re-inject a stored SError after the exit
is handled" the bug will become much easier to trigger.
In the current code this can only happen when userspace changes where
the SError goes between two KVM_RUN calls. For example, userspace
injects an SError with the KVM_SET_VCPU_EVENTS ioctl while the vcpu is
at vEL2 with SErrors masked, so KVM sets HCR_EL2.VSE. Then userspace
uses KVM_SET_ONE_REG to move the vcpu to L2 and injects a second SError.
L1 takes SErrors from L2, so KVM delivers the second SError to L1
straight away, but HCR_EL2.VSE is still set. When L1 unmasks SErrors,
it takes the first SError as well.
After the "KVM: arm64: nv: Re-inject a stored SError after the exit
is handled" commit then kvm_nested_sync_hwstate() only stores a pending
SError when the guest exits. Then kvm_nested_flush_hwstate() re-injects
the SError before the next entry. In between, KVM handles the exit and
may return to userspace. If userspace injects an SError during that
time, for example on an MMIO exit, the stored SError is still pending,
without any change to the routing or masking. So this patch has to come
first before the re-inject path.
Clear the pend flags unconditionally at the start of the function.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-229065@kernel.org/
Fixes: ce66109cec86 ("KVM: arm64: nv: Take "masked" aborts to EL2 when HCRX_EL2.TMEA is set")
Fixes: 77ee70a07357 ("KVM: arm64: nv: Honor SError exception routing / masking")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: Add how the bug is triggered to the commit message
v2: New patch
---
arch/arm64/kvm/inject_fault.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c
index aa2011cc0d5a..0f6a89b65074 100644
--- a/arch/arm64/kvm/inject_fault.c
+++ b/arch/arm64/kvm/inject_fault.c
@@ -361,6 +361,10 @@ int kvm_inject_serror_esr(struct kvm_vcpu *vcpu, u64 esr)
{
lockdep_assert_held(&vcpu->mutex);
+ /* A new SError replaces any that is already pending. */
+ vcpu_clear_flag(vcpu, NESTED_SERROR_PENDING);
+ *vcpu_hcr(vcpu) &= ~HCR_EL2_VSE;
+
if (is_nested_ctxt(vcpu) && kvm_serror_target_is_el2(vcpu))
return kvm_inject_nested_serror(vcpu, esr);
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (5 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 6/9] KVM: arm64: nv: Replace a pending SError when injecting a new one Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:17 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter,
Sashiko, stable
With nested virtualization, when we inject an SError that the guest
has masked, we set the VSE bit in ->hcr_el2 and the CPU delivers it once
the guest unmasks SErrors. The problem is that the bit stays set when
we switch between L1 and L2, so an SError meant for L2 can be delivered
to L1, and the other way around.
When we switch, clear the VSE bit and set NESTED_SERROR_PENDING instead.
This matches what kvm_nested_sync_hwstate() does after every guest exit.
Then kvm_nested_flush_hwstate() injects the SError again and decides
where it should go in the new context.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-229065@kernel.org/
Fixes: 77ee70a07357 ("KVM: arm64: nv: Honor SError exception routing / masking")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: no change
v2: new patch
---
arch/arm64/kvm/emulate-nested.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index ee71dfc4b861..d1446081fbbf 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -2792,6 +2792,18 @@ static u64 kvm_check_illegal_exception_return(struct kvm_vcpu *vcpu, u64 spsr)
return spsr;
}
+/*
+ * HCR_EL2.VSE was set for the context we are leaving. Store the SError
+ * instead, so that kvm_nested_flush_hwstate() routes it in the new context.
+ */
+static void kvm_nested_stash_serror(struct kvm_vcpu *vcpu)
+{
+ if (*vcpu_hcr(vcpu) & HCR_EL2_VSE) {
+ *vcpu_hcr(vcpu) &= ~HCR_EL2_VSE;
+ vcpu_set_flag(vcpu, NESTED_SERROR_PENDING);
+ }
+}
+
void kvm_emulate_nested_eret(struct kvm_vcpu *vcpu)
{
u64 spsr, elr, esr;
@@ -2823,6 +2835,7 @@ void kvm_emulate_nested_eret(struct kvm_vcpu *vcpu)
preempt_disable();
vcpu_set_flag(vcpu, IN_NESTED_ERET);
kvm_arch_vcpu_put(vcpu);
+ kvm_nested_stash_serror(vcpu);
if (!esr_iss_is_eretax(esr))
elr = __vcpu_sys_reg(vcpu, ELR_EL2);
@@ -2909,6 +2922,7 @@ static int kvm_inject_nested(struct kvm_vcpu *vcpu, u64 esr_el2,
__kvm_adjust_pc(vcpu);
kvm_arch_vcpu_put(vcpu);
+ kvm_nested_stash_serror(vcpu);
kvm_inject_el2_exception(vcpu, esr_el2, type);
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (6 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:22 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter, stable
KVM only has room for one pending exception or PC increment per vcpu.
If something is already pending and we try to add another through
kvm_pend_exception() or kvm_incr_pc(), it triggers a WARN(). If we add
an exception on top of an exception, the first one is lost. If we add a
PC increment on top of an exception, the PC increment is lost and the
trapped instruction runs again.
Normally an exit handler records an exception or a PC increment, and
__kvm_adjust_pc() commits it before the next guest entry. However, with
nested virtualization kvm_nested_sync_hwstate() can add an exception
before the exit handler runs. It re-injects a stored SError after the
guest exits but before handle_exit(), which can pend the SError as an
exception. The exit handler then records its own on top, for example an
HVC forwarded to the guest hypervisor, the FPAC for a failed ERETAA, or
the PC increment for a trapped instruction it has emulated. This
triggers the WARN().
In this situation where we have two exceptions, the correct order is to
handle the exit first and then the SError. Change the
kvm_nested_sync_hwstate() function to only store the SError. Then
kvm_nested_flush_hwstate() uses __kvm_adjust_pc() to commit the exit
handler's exception or PC increment, re-injects the SError, and the
guest is entered. The early re-injection was there so that a pending
SError wakes the vcpu from WFI, so kvm_arch_vcpu_runnable() now treats
a deliverable stored SError as a wakeup.
Fixes: 77ee70a07357 ("KVM: arm64: nv: Honor SError exception routing / masking")
Fixes: ce66109cec86 ("KVM: arm64: nv: Take "masked" aborts to EL2 when HCRX_EL2.TMEA is set")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: no change
v3: No change
v2: No change
---
arch/arm64/include/asm/kvm_emulate.h | 1 +
arch/arm64/kvm/arm.c | 1 +
arch/arm64/kvm/inject_fault.c | 6 ++++++
arch/arm64/kvm/nested.c | 16 ++++++----------
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index b66689818515..3d6f9d022a5d 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -48,6 +48,7 @@ void kvm_skip_instr32(struct kvm_vcpu *vcpu);
void kvm_inject_undefined(struct kvm_vcpu *vcpu);
void kvm_inject_sync(struct kvm_vcpu *vcpu, u64 esr);
int kvm_inject_serror_esr(struct kvm_vcpu *vcpu, u64 esr);
+bool kvm_nested_serror_deliverable(struct kvm_vcpu *vcpu);
int kvm_inject_sea(struct kvm_vcpu *vcpu, bool iabt, u64 addr);
int kvm_inject_dabt_excl_atomic(struct kvm_vcpu *vcpu, u64 addr);
void kvm_inject_size_fault(struct kvm_vcpu *vcpu);
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index fe5e4e47b935..8923d28185c7 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -966,6 +966,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
{
bool irq_lines = *vcpu_hcr(v) & (HCR_EL2_VI | HCR_EL2_VF | HCR_EL2_VSE);
+ irq_lines |= kvm_nested_serror_deliverable(v);
irq_lines |= (!irqchip_in_kernel(v->kvm) &&
(kvm_timer_should_notify_user(v) ||
kvm_pmu_should_notify_user(v)));
diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c
index 0f6a89b65074..1d5dfd4b9e00 100644
--- a/arch/arm64/kvm/inject_fault.c
+++ b/arch/arm64/kvm/inject_fault.c
@@ -357,6 +357,12 @@ static bool kvm_serror_undeliverable_at_el2(struct kvm_vcpu *vcpu)
return !(vcpu_el2_tge_is_set(vcpu) || vcpu_el2_amo_is_set(vcpu));
}
+bool kvm_nested_serror_deliverable(struct kvm_vcpu *vcpu)
+{
+ return vcpu_get_flag(vcpu, NESTED_SERROR_PENDING) &&
+ !(vcpu_is_el2(vcpu) && kvm_serror_undeliverable_at_el2(vcpu));
+}
+
int kvm_inject_serror_esr(struct kvm_vcpu *vcpu, u64 esr)
{
lockdep_assert_held(&vcpu->mutex);
diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index 78d5b18dbd2d..f063c01c565a 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -2213,8 +2213,11 @@ void kvm_nested_flush_hwstate(struct kvm_vcpu *vcpu)
if (!vcpu_has_nv(vcpu))
return;
- if (unlikely(vcpu_test_and_clear_flag(vcpu, NESTED_SERROR_PENDING)))
+ if (unlikely(vcpu_test_and_clear_flag(vcpu, NESTED_SERROR_PENDING))) {
+ /* Commit the exit handler's exception first */
+ __kvm_adjust_pc(vcpu);
kvm_inject_serror_esr(vcpu, vcpu_get_vsesr(vcpu));
+ }
vgic_v3_nested_update_mi(vcpu);
@@ -2231,18 +2234,11 @@ void kvm_nested_sync_hwstate(struct kvm_vcpu *vcpu)
/*
* We previously decided that an SError was deliverable to the guest.
- * Reap the pending state from HCR_EL2 and...
+ * Reap the pending state from HCR_EL2, and re-inject it from
+ * kvm_nested_flush_hwstate() once the exit has been handled.
*/
if (unlikely(__test_and_clear_bit(__ffs(HCR_EL2_VSE), hcr)))
vcpu_set_flag(vcpu, NESTED_SERROR_PENDING);
-
- /*
- * Re-attempt SError injection in case the deliverability has changed,
- * which is necessary to faithfully emulate WFI the case of a pending
- * SError being a wakeup condition.
- */
- if (unlikely(vcpu_test_and_clear_flag(vcpu, NESTED_SERROR_PENDING)))
- kvm_inject_serror_esr(vcpu, vcpu_get_vsesr(vcpu));
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
` (7 preceding siblings ...)
2026-12-04 8:48 ` [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
@ 2026-12-04 8:48 ` Dan Carpenter
2026-12-04 9:20 ` sashiko-bot
8 siblings, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 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, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan
Cc: Karthik Bhargavan, Clément Blaudeau, linux-arm-kernel,
kvmarm, linux-kernel, kvm, linux-kselftest, Dan Carpenter
Add a test to check that KVM_ARM_VCPU_INIT (which resets a vcpu) has
reset all the things it was supposed to.
The test dirties as much of the vcpu state as it can, resets the vcpu,
and compares every register in KVM_GET_REG_LIST with a freshly
initialised vcpu. There are a few things which we must not clear such as
MPIDR_EL1, CLIDR_EL1 and CCSIDR, which userspace configures and the
reset keeps, and the timer counters which keep counting.
The test runs with and without EL2.
Signed-off-by: Dan Carpenter <dan@pereq.eu>
---
v4: Inject the SError before the run, so the EL2 case tests that
NESTED_SERROR_PENDING is cleared, and fix the register names in the
comment and the commit message (Sashiko)
v3: No change
v2: New patch
---
tools/testing/selftests/kvm/Makefile.kvm | 1 +
tools/testing/selftests/kvm/arm64/vcpu_reset.c | 211 +++++++++++++++++++++++++
2 files changed, 212 insertions(+)
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 95867977beb3..cbd05070a2e3 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -201,6 +201,7 @@ TEST_GEN_PROGS_arm64 += arm64/sea_to_user
TEST_GEN_PROGS_arm64 += arm64/set_id_regs
TEST_GEN_PROGS_arm64 += arm64/smccc_filter
TEST_GEN_PROGS_arm64 += arm64/stage2_block_transitions
+TEST_GEN_PROGS_arm64 += arm64/vcpu_reset
TEST_GEN_PROGS_arm64 += arm64/vcpu_width_config
TEST_GEN_PROGS_arm64 += arm64/vgic_init
TEST_GEN_PROGS_arm64 += arm64/vgic_irq
diff --git a/tools/testing/selftests/kvm/arm64/vcpu_reset.c b/tools/testing/selftests/kvm/arm64/vcpu_reset.c
new file mode 100644
index 000000000000..dcf5215df865
--- /dev/null
+++ b/tools/testing/selftests/kvm/arm64/vcpu_reset.c
@@ -0,0 +1,211 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * vcpu_reset - Test that resetting a vcpu that has run with KVM_ARM_VCPU_INIT
+ * puts it back in the state of a new vcpu.
+ *
+ * Before the reset, the vcpu has an MMIO read waiting for userspace and a
+ * pending SError, and userspace has written to every register it can. After
+ * the reset, every register must match a new vcpu's, except the ones in
+ * is_preserved(), which must keep the value userspace wrote, and the
+ * counters, which keep counting. No SError may be pending, and the next
+ * KVM_RUN must not complete the MMIO read.
+ */
+#include "kvm_util.h"
+#include "processor.h"
+#include "test_util.h"
+
+#define MMIO_ADDR 0x8000000ULL
+#define MAX_REG_SIZE 256
+
+/*
+ * Registers that a reset keeps: the configuration that userspace sets for the
+ * vcpu, and the counters, which are VM-wide and change on their own.
+ */
+#define DEMUX_CCSIDR (KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_DEMUX | \
+ KVM_REG_ARM_DEMUX_ID_CCSIDR)
+
+static bool is_preserved(u64 id)
+{
+ if ((id & ~(u64)KVM_REG_ARM_DEMUX_VAL_MASK) == DEMUX_CCSIDR)
+ return true;
+
+ switch (id) {
+ case KVM_ARM64_SYS_REG(SYS_MPIDR_EL1):
+ case KVM_ARM64_SYS_REG(SYS_CLIDR_EL1):
+ return true;
+ }
+ return false;
+}
+
+static bool is_counter(u64 id)
+{
+ return id == KVM_REG_ARM_TIMER_CNT || id == KVM_REG_ARM_PTIMER_CNT;
+}
+
+static void guest_code(void)
+{
+ READ_ONCE(*(u64 *)MMIO_ADDR);
+ GUEST_FAIL("The MMIO read completed");
+}
+
+struct regs {
+ struct kvm_reg_list *list;
+ u8 (*val)[MAX_REG_SIZE];
+};
+
+static void get_regs(struct kvm_vcpu *vcpu, struct regs *r)
+{
+ u64 i;
+
+ r->list = vcpu_get_reg_list(vcpu);
+ r->val = calloc(r->list->n, MAX_REG_SIZE);
+ TEST_ASSERT(r->val, "calloc() failed");
+ for (i = 0; i < r->list->n; i++) {
+ TEST_ASSERT(KVM_REG_SIZE(r->list->reg[i]) <= MAX_REG_SIZE,
+ "Register 0x%llx is too big", r->list->reg[i]);
+ TEST_ASSERT(!__vcpu_get_reg(vcpu, r->list->reg[i], r->val[i]),
+ "Can't read register 0x%llx", r->list->reg[i]);
+ }
+}
+
+static void free_regs(struct regs *r)
+{
+ free(r->list);
+ free(r->val);
+}
+
+/* Write the inverse of each register, or failing that, flip its bit 0 */
+static void dirty_regs(struct kvm_vcpu *vcpu)
+{
+ struct kvm_reg_list *list = vcpu_get_reg_list(vcpu);
+ u8 val[MAX_REG_SIZE];
+ struct kvm_one_reg reg = { .addr = (u64)val };
+ u64 i, j, size;
+
+ for (i = 0; i < list->n; i++) {
+ reg.id = list->reg[i];
+ size = KVM_REG_SIZE(reg.id);
+ if (__vcpu_get_reg(vcpu, reg.id, val))
+ continue;
+ for (j = 0; j < size; j++)
+ val[j] = ~val[j];
+ if (!__vcpu_ioctl(vcpu, KVM_SET_ONE_REG, ®))
+ continue;
+ for (j = 0; j < size; j++)
+ val[j] = ~val[j];
+ val[0] ^= 1;
+ __vcpu_ioctl(vcpu, KVM_SET_ONE_REG, ®);
+ }
+ free(list);
+}
+
+static void assert_reg_eq(u64 id, const u8 *got, const u8 *want, const char *what)
+{
+ u64 size = KVM_REG_SIZE(id);
+ u64 g = 0, w = 0;
+
+ if (!memcmp(got, want, size))
+ return;
+
+ memcpy(&g, got, size < 8 ? size : 8);
+ memcpy(&w, want, size < 8 ? size : 8);
+ TEST_FAIL("Register 0x%llx is 0x%lx after the reset, %s 0x%lx",
+ (unsigned long long)id, (unsigned long)g, what, (unsigned long)w);
+}
+
+static struct kvm_vm *create_vcpu(bool el2, struct kvm_vcpu **vcpu)
+{
+ struct kvm_vcpu_init init;
+ struct kvm_vm *vm;
+
+ vm = vm_create(1);
+ kvm_get_default_vcpu_target(vm, &init);
+ if (el2)
+ init.features[0] |= BIT(KVM_ARM_VCPU_HAS_EL2);
+ else
+ init.features[0] &= ~BIT(KVM_ARM_VCPU_HAS_EL2);
+ *vcpu = aarch64_vcpu_add(vm, 0, &init, guest_code);
+ kvm_arch_vm_finalize_vcpus(vm);
+ return vm;
+}
+
+static void test_reset(bool el2)
+{
+ struct kvm_vcpu_events events = {};
+ struct regs new, before, after;
+ struct kvm_vcpu *vcpu, *ref;
+ struct kvm_vm *vm, *ref_vm;
+ u64 i, id;
+
+ /*
+ * A new vcpu: initialised again to undo what the library set up, and
+ * through its first KVM_RUN without running any code.
+ */
+ ref_vm = create_vcpu(el2, &ref);
+ vcpu_ioctl(ref, KVM_ARM_VCPU_INIT, &ref->init);
+ vcpu_run_complete_io(ref);
+ get_regs(ref, &new);
+
+ vm = create_vcpu(el2, &vcpu);
+ virt_map(vm, MMIO_ADDR, MMIO_ADDR, 1);
+
+ /* With EL2, the exit moves the masked SError to NESTED_SERROR_PENDING */
+ events.exception.serror_pending = true;
+ vcpu_events_set(vcpu, &events);
+
+ vcpu_run(vcpu);
+ TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_MMIO);
+ TEST_ASSERT(!vcpu->run->mmio.is_write, "Expected an MMIO read");
+ memset(vcpu->run->mmio.data, 0x5a, sizeof(vcpu->run->mmio.data));
+
+ dirty_regs(vcpu);
+ get_regs(vcpu, &before);
+
+ vcpu_ioctl(vcpu, KVM_ARM_VCPU_INIT, &vcpu->init);
+
+ vcpu_events_get(vcpu, &events);
+ TEST_ASSERT(!events.exception.serror_pending, "An SError is still pending");
+
+ /* Completes the MMIO read if it is still pending */
+ vcpu_run_complete_io(vcpu);
+ get_regs(vcpu, &after);
+
+ TEST_ASSERT_EQ(new.list->n, after.list->n);
+ TEST_ASSERT_EQ(before.list->n, after.list->n);
+ for (i = 0; i < after.list->n; i++) {
+ id = after.list->reg[i];
+ TEST_ASSERT_EQ(id, new.list->reg[i]);
+ TEST_ASSERT_EQ(id, before.list->reg[i]);
+
+ if (is_counter(id))
+ continue;
+ if (is_preserved(id))
+ assert_reg_eq(id, after.val[i], before.val[i], "userspace wrote");
+ else
+ assert_reg_eq(id, after.val[i], new.val[i], "a new vcpu has");
+ }
+
+ free_regs(&new);
+ free_regs(&before);
+ free_regs(&after);
+ kvm_vm_free(vm);
+ kvm_vm_free(ref_vm);
+}
+
+int main(void)
+{
+ bool el2 = test_supports_el2();
+
+ ksft_print_header();
+ ksft_set_plan(el2 ? 2 : 1);
+
+ test_reset(false);
+ ksft_test_result_pass("reset without EL2\n");
+
+ if (el2) {
+ test_reset(true);
+ ksft_test_result_pass("reset with EL2\n");
+ }
+
+ ksft_finished();
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu()
2026-12-04 8:48 ` [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
@ 2026-12-04 9:03 ` sashiko-bot
0 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-12-04 9:03 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] KVM: arm64: non-atomic hcr_el2 RMW in kvm_reset_vcpu() races
with IRQ line
--
commit 5201009befa259c3dab07b05344d615312140b11
Author: Dan Carpenter <dan@pereq.eu>
KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu()
This commit clears the NESTED_SERROR_PENDING flag in kvm_reset_vcpu() so
that pending nested SErrors are discarded on vCPU reset.
> diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
> index 4b1917b48edcb..1899d927164c1 100644
> --- a/arch/arm64/kvm/reset.c
> +++ b/arch/arm64/kvm/reset.c
> @@ -206,6 +206,7 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
>
> /* Discard a pending SError */
> vcpu->arch.hcr_el2 &= ~HCR_EL2_VSE;
> + vcpu_clear_flag(vcpu, NESTED_SERROR_PENDING);
[Severity: Medium]
Can the non-atomic update to vcpu->arch.hcr_el2 (from commit "KVM: arm64:
Discard a pending SError when resetting a vcpu") lose a concurrent virtual
IRQ or FIQ line transition?
For a VM without an in-kernel irqchip, KVM_IRQ_LINE runs without
vcpu->mutex and calls vcpu_interrupt_line(), which atomically sets or
clears HCR_EL2_VI or HCR_EL2_VF in vcpu->arch.hcr_el2:
CPU0 CPU1
kvm_reset_vcpu() kvm_vm_ioctl(KVM_IRQ_LINE)
/* holds vcpu->mutex */ kvm_vm_ioctl_irq_line()
load vcpu->arch.hcr_el2 vcpu_interrupt_line()
test_and_set_bit(VI, hcr)
store hcr_el2 & ~HCR_EL2_VSE <-- overwrites HCR_EL2_VI
When that happens, the concurrent interrupt line update is silently
overwritten, leaving the guest with a missed or stuck virtual interrupt.
Using clear_bit(__ffs(HCR_EL2_VSE), vcpu_hcr(vcpu)) would avoid this data
race.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-double_exception_v4-v4-0-523921511673@pereq.eu?part=5
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 4/9] KVM: arm64: Discard a pending SError when resetting a vcpu
2026-12-04 8:48 ` [PATCH v4 4/9] KVM: arm64: Discard a pending SError " Dan Carpenter
@ 2026-12-04 9:03 ` sashiko-bot
0 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-12-04 9:03 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] KVM: arm64: non-atomic hcr_el2 RMW in kvm_reset_vcpu() races
with KVM_IRQ_LINE
--
commit 410049e49c865f69ca46cd29eb464dfffe46ce36
Author: Dan Carpenter <dan@pereq.eu>
KVM: arm64: Discard a pending SError when resetting a vcpu
This commit clears HCR_EL2_VSE in kvm_reset_vcpu() so a pending SError is
discarded when resetting a vCPU.
> diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
> index 26081d2734087..4b1917b48edcb 100644
> --- a/arch/arm64/kvm/reset.c
> +++ b/arch/arm64/kvm/reset.c
> @@ -204,6 +204,9 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
> /* Reset system registers */
> kvm_reset_sys_regs(vcpu);
>
> + /* Discard a pending SError */
> + vcpu->arch.hcr_el2 &= ~HCR_EL2_VSE;
[Severity: Medium]
Can this non-atomic read-modify-write on vcpu->arch.hcr_el2 race with
KVM_IRQ_LINE?
For a VM with a userspace irqchip, kvm_vm_ioctl_irq_line() calls
vcpu_interrupt_line() without holding vcpu->mutex and updates HCR_EL2_VI
or HCR_EL2_VF in vcpu->arch.hcr_el2 via test_and_set_bit() or
test_and_clear_bit().
CPU0 CPU1
kvm_reset_vcpu() kvm_vm_ioctl_irq_line()
val = vcpu->arch.hcr_el2 vcpu_interrupt_line()
test_and_set_bit(VI, hcr)
vcpu->arch.hcr_el2 = val & ~VSE <-- overwrites HCR_EL2_VI
If KVM_IRQ_LINE runs between the load and store in kvm_reset_vcpu(), the
store writes back stale HCR_EL2_VI or HCR_EL2_VF bits and the guest can
miss a virtual IRQ or FIQ transition.
Using clear_bit(__ffs(HCR_EL2_VSE), vcpu_hcr(vcpu)) would match
vcpu_interrupt_line() and avoid this data race.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-double_exception_v4-v4-0-523921511673@pereq.eu?part=4
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest
2026-12-04 8:48 ` [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
@ 2026-12-04 9:17 ` sashiko-bot
0 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-12-04 9:17 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: arm64: non-atomic hcr_el2 RMW in kvm_nested_stash_serror()
races
--
commit 9a7da4512bb06d4ccc09ceb91f2bedac7608acb2
Author: Dan Carpenter <dan@pereq.eu>
KVM: arm64: nv: Don't deliver a pending SError to the wrong guest
This commit adds kvm_nested_stash_serror() to clear HCR_EL2_VSE and set
NESTED_SERROR_PENDING when switching between L1 and L2 in
kvm_emulate_nested_eret() and kvm_inject_nested().
> diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
> index ee71dfc4b8617..d1446081fbbf9 100644
> --- a/arch/arm64/kvm/emulate-nested.c
> +++ b/arch/arm64/kvm/emulate-nested.c
> @@ -2792,6 +2792,18 @@ static u64 kvm_check_illegal_exception_return(struct kvm_vcpu *vcpu, u64 spsr)
> return spsr;
> }
>
> +/*
> + * HCR_EL2.VSE was set for the context we are leaving. Store the SError
> + * instead, so that kvm_nested_flush_hwstate() routes it in the new context.
> + */
> +static void kvm_nested_stash_serror(struct kvm_vcpu *vcpu)
> +{
> + if (*vcpu_hcr(vcpu) & HCR_EL2_VSE) {
> + *vcpu_hcr(vcpu) &= ~HCR_EL2_VSE;
> + vcpu_set_flag(vcpu, NESTED_SERROR_PENDING);
> + }
> +}
[Severity: Low]
Can the non-atomic read-modify-write on *vcpu_hcr(vcpu) race with
vcpu_interrupt_line()?
Before an in-kernel vGIC is created on a nested-virt vCPU, one thread can
reach kvm_nested_stash_serror() under vcpu->mutex via KVM_SET_VCPU_EVENTS
(kvm_inject_sea_dabt() -> kvm_inject_nested()).
Concurrently, another thread can call KVM_IRQ_LINE with
KVM_ARM_IRQ_TYPE_CPU, which does not take vcpu->mutex and updates
HCR_EL2_VI or HCR_EL2_VF atomically in the same word via
vcpu_interrupt_line():
CPU0 CPU1
kvm_arm_vcpu_set_events()
...
kvm_nested_stash_serror()
load *vcpu_hcr(vcpu)
kvm_vm_ioctl_irq_line()
vcpu_interrupt_line()
test_and_set_bit(VI, hcr)
store (*vcpu_hcr(vcpu) & ~VSE) <-- VI update lost
This is a data race that can lose a concurrent set of HCR_EL2_VI or
HCR_EL2_VF, or overwrite a concurrent clear with a stale 1.
Using test_and_clear_bit(__ffs(HCR_EL2_VSE), vcpu_hcr(vcpu)) would avoid
the non-atomic read-modify-write here.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-double_exception_v4-v4-0-523921511673@pereq.eu?part=7
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state
2026-12-04 8:48 ` [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter
@ 2026-12-04 9:20 ` sashiko-bot
0 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-12-04 9:20 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Low] kvm/arm64: main() silently omits EL2 subtest instead of
reporting a TAP skip
- [Low] kvm/arm64: unpinned vCPU resets in test_reset() can fail on
big.LITTLE CPUs
- [Low] kvm/arm64: assert_reg_eq() truncates >8-byte registers in
failure output
--
commit 864ec7b1b20682adde35519d9d1591ff55326655
Author: Dan Carpenter <dan@pereq.eu>
KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state
This commit adds an arm64 KVM selftest that dirties vCPU state, runs
KVM_ARM_VCPU_INIT, and compares the resulting registers against a freshly
initialized vCPU both with and without EL2.
> diff --git a/tools/testing/selftests/kvm/arm64/vcpu_reset.c b/tools/testing/selftests/kvm/arm64/vcpu_reset.c
> new file mode 100644
> index 0000000000000..dcf5215df8655
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/arm64/vcpu_reset.c
[ ... ]
> +static void assert_reg_eq(u64 id, const u8 *got, const u8 *want, const char *what)
> +{
> + u64 size = KVM_REG_SIZE(id);
> + u64 g = 0, w = 0;
> +
> + if (!memcmp(got, want, size))
> + return;
> +
> + memcpy(&g, got, size < 8 ? size : 8);
> + memcpy(&w, want, size < 8 ? size : 8);
> + TEST_FAIL("Register 0x%llx is 0x%lx after the reset, %s 0x%lx",
> + (unsigned long long)id, (unsigned long)g, what, (unsigned long)w);
> +}
[Severity: Low]
Will assert_reg_eq() print misleading values when a register wider than 8
bytes mismatches?
On arm64, KVM_GET_REG_LIST includes 128-bit FP/SIMD vector registers.
memcmp() checks all size bytes, but memcpy() only copies the low 8 bytes
into g and w, so a mismatch in the upper bytes prints identical got and
expected values.
[ ... ]
> + ref_vm = create_vcpu(el2, &ref);
> + vcpu_ioctl(ref, KVM_ARM_VCPU_INIT, &ref->init);
> + vcpu_run_complete_io(ref);
> + get_regs(ref, &new);
[ ... ]
> + vcpu_ioctl(vcpu, KVM_ARM_VCPU_INIT, &vcpu->init);
[Severity: Low]
Can test_reset() fail spuriously on heterogeneous (big.LITTLE) systems if
the test thread migrates between cores between these two KVM_ARM_VCPU_INIT
calls?
In arch/arm64/kvm/sys_regs.c, reset_actlr() and reset_amair_el1() initialize
ACTLR_EL1 and AMAIR_EL1 directly from the current physical CPU's registers.
Pinning the test thread to a single CPU (for example with
sched_setaffinity()) would avoid spurious mismatches in assert_reg_eq().
[ ... ]
> +int main(void)
> +{
> + bool el2 = test_supports_el2();
> +
> + ksft_print_header();
> + ksft_set_plan(el2 ? 2 : 1);
> +
> + test_reset(false);
> + ksft_test_result_pass("reset without EL2\n");
> +
> + if (el2) {
> + test_reset(true);
> + ksft_test_result_pass("reset with EL2\n");
> + }
> +
> + ksft_finished();
> +}
[Severity: Low]
Should main() report a TAP skip instead of shrinking the plan when
test_supports_el2() returns false?
Right now the EL2 subtest is silently omitted without a skip reason.
Keeping ksft_set_plan(2) and calling ksft_test_result_skip() with a reason
in an else branch reports the missing prerequisite while still exiting with
KSFT_PASS.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-double_exception_v4-v4-0-523921511673@pereq.eu?part=9
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled
2026-12-04 8:48 ` [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
@ 2026-12-04 9:22 ` sashiko-bot
2026-12-04 14:23 ` Dan Carpenter
0 siblings, 1 reply; 17+ messages in thread
From: sashiko-bot @ 2026-12-04 9:22 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] KVM: arm64: premature SError flush on aborted KVM_RUN entry
--
commit 7423847623949f2a8f284b19a9a62edd87bac9cd
Author: Dan Carpenter <dan@pereq.eu>
KVM: arm64: nv: Re-inject a stored SError after the exit is handled
This commit defers re-injecting a stored nested SError from
kvm_nested_sync_hwstate() to kvm_nested_flush_hwstate(), committing any
pending exit-handler exception or PC increment first via __kvm_adjust_pc().
It also updates kvm_arch_vcpu_runnable() so a deliverable stored SError wakes
the vCPU.
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index 78d5b18dbd2d6..f063c01c565a0 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -2213,8 +2213,11 @@ void kvm_nested_flush_hwstate(struct kvm_vcpu *vcpu)
> if (!vcpu_has_nv(vcpu))
> return;
>
> - if (unlikely(vcpu_test_and_clear_flag(vcpu, NESTED_SERROR_PENDING)))
> + if (unlikely(vcpu_test_and_clear_flag(vcpu, NESTED_SERROR_PENDING))) {
> + /* Commit the exit handler's exception first */
> + __kvm_adjust_pc(vcpu);
> kvm_inject_serror_esr(vcpu, vcpu_get_vsesr(vcpu));
> + }
>
> vgic_v3_nested_update_mi(vcpu);
[Severity: Medium]
Can kvm_nested_flush_hwstate() consume NESTED_SERROR_PENDING and inject the
SError even when guest entry is aborted?
kvm_arch_vcpu_ioctl_run() calls kvm_nested_flush_hwstate() unconditionally
before checking ret <= 0 or kvm_vcpu_exit_request():
arch/arm64/kvm/arm.c:kvm_arch_vcpu_ioctl_run() {
...
if (ret > 0)
ret = check_vcpu_requests(vcpu);
...
kvm_nested_flush_hwstate(vcpu);
local_irq_disable();
...
if (ret <= 0 || kvm_vcpu_exit_request(vcpu, &ret)) {
...
}
If a signal makes kvm_xfer_to_guest_mode_handle_work() return -EINTR on a
suspended vCPU with an unmasked or EL2-routed NESTED_SERROR_PENDING,
check_vcpu_requests() is skipped, yet kvm_nested_flush_hwstate() still clears
NESTED_SERROR_PENDING and injects the SError.
The out: path then commits that exception via __kvm_adjust_pc() into the
still-suspended vCPU. On the next KVM_RUN, kvm_vcpu_suspend() sees neither
HCR_EL2_VSE nor NESTED_SERROR_PENDING set and blocks indefinitely instead of
reporting KVM_SYSTEM_EVENT_WAKEUP.
Even without a signal, kvm_vcpu_suspend() returns 0 for
KVM_SYSTEM_EVENT_WAKEUP while keeping the vCPU suspended, so
kvm_nested_flush_hwstate() still consumes NESTED_SERROR_PENDING and mutates
the suspended vCPU's registers before returning to userspace.
Deferring the NESTED_SERROR_PENDING injection until after the ret <= 0 and
kvm_vcpu_exit_request() check would avoid mutating vCPU state on aborted
entries.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-double_exception_v4-v4-0-523921511673@pereq.eu?part=8
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu
2026-12-04 8:48 ` [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
@ 2026-12-04 9:24 ` Steffen Eiden
0 siblings, 0 replies; 17+ messages in thread
From: Steffen Eiden @ 2026-12-04 9:24 UTC (permalink / raw)
To: Dan Carpenter
Cc: Marc Zyngier, Oliver Upton, Fuad Tabba, Joey Gouly,
Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
Mark Rutland, Marcelo Tosatti, Rusty Russell, James Morse,
Eric Auger, Sebastian Ott, Paolo Bonzini, Sean Christopherson,
Shuah Khan, Karthik Bhargavan, Clément Blaudeau,
linux-arm-kernel, kvmarm, linux-kernel, kvm, linux-kselftest,
stable
On Fri, Dec 04, 2026 at 11:48:06AM +0300, Dan Carpenter wrote:
> When a vcpu exits to userspace for an MMIO access, the next KVM_RUN
> completes it. So for a read, the next run increments the PC counter
> and copies data from userspace to the destination vcpu register.
>
> A reset should cancel the MMIO read/write access. Otherwise the next
> run will copy memory from userspace to the vcpu and increment the PC
> which skips the first instruction.
>
> Clear vcpu->mmio_needed in kvm_reset_vcpu().
>
> Fixes: 45e96ea6b369 ("KVM: ARM: Handle I/O aborts")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dan Carpenter <dan@pereq.eu>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled
2026-12-04 9:22 ` sashiko-bot
@ 2026-12-04 14:23 ` Dan Carpenter
0 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2026-12-04 14:23 UTC (permalink / raw)
To: sashiko-reviews; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
On Fri, Dec 04, 2026 at 09:22:06AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Medium] KVM: arm64: premature SError flush on aborted KVM_RUN entry
> --
Sashiko makes a good point here. I'm going to fix this one and the
selftest. The earlier ones are low priority and the fix is bigger than
what I'm addressing in this patch series so I'm going to leave those as-is.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-12-04 14:23 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 8:48 [PATCH v4 0/9] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 1/9] KVM: arm64: nv: Use a vcpu request to reprogram the PMU Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 2/9] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
2026-12-04 9:24 ` Steffen Eiden
2026-12-04 8:48 ` [PATCH v4 3/9] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 " Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 4/9] KVM: arm64: Discard a pending SError " Dan Carpenter
2026-12-04 9:03 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
2026-12-04 9:03 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 6/9] KVM: arm64: nv: Replace a pending SError when injecting a new one Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 7/9] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
2026-12-04 9:17 ` sashiko-bot
2026-12-04 8:48 ` [PATCH v4 8/9] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
2026-12-04 9:22 ` sashiko-bot
2026-12-04 14:23 ` Dan Carpenter
2026-12-04 8:48 ` [PATCH v4 9/9] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter
2026-12-04 9:20 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox