* [PATCH] KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions
@ 2026-06-15 13:11 Fuad Tabba
2026-06-17 12:04 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Fuad Tabba @ 2026-06-15 13:11 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, Catalin Marinas, Will Deacon
Cc: Joey Gouly, Suzuki K Poulose, Zenghui Yu, kvmarm,
linux-arm-kernel, linux-kernel, tabba
kvm_inject_el2_exception() writes ESR_EL2 for synchronous exceptions
but not for SError. enter_exception64() does not write ESR_ELx for any
exception type, so the constructed syndrome is dropped. A guest L2
hypervisor taking a nested SError observes stale ESR_EL2.
This affects both kvm_inject_nested_serror() and the EASE path in
kvm_inject_nested_sea().
Write ESR_EL2 for except_type_serror, matching except_type_sync.
Fixes: 77ee70a07357 ("KVM: arm64: nv: Honor SError exception routing / masking")
Reported-by: sashiko <sashiko@sashiko.dev>
Signed-off-by: Fuad Tabba <tabba@google.com>
---
arch/arm64/kvm/emulate-nested.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index 22d497554c94..c2580d40197e 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -2750,6 +2750,7 @@ static void kvm_inject_el2_exception(struct kvm_vcpu *vcpu, u64 esr_el2,
break;
case except_type_serror:
kvm_pend_exception(vcpu, EXCEPT_AA64_EL2_SERR);
+ vcpu_write_sys_reg(vcpu, esr_el2, ESR_EL2);
break;
default:
WARN_ONCE(1, "Unsupported EL2 exception injection %d\n", type);
--
2.54.0.1136.gdb2ca164c4-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions
2026-06-15 13:11 [PATCH] KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions Fuad Tabba
@ 2026-06-17 12:04 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2026-06-17 12:04 UTC (permalink / raw)
To: Oliver Upton, Catalin Marinas, Will Deacon, Fuad Tabba
Cc: Joey Gouly, Suzuki K Poulose, Zenghui Yu, kvmarm,
linux-arm-kernel, linux-kernel
On Mon, 15 Jun 2026 14:11:16 +0100, Fuad Tabba wrote:
> kvm_inject_el2_exception() writes ESR_EL2 for synchronous exceptions
> but not for SError. enter_exception64() does not write ESR_ELx for any
> exception type, so the constructed syndrome is dropped. A guest L2
> hypervisor taking a nested SError observes stale ESR_EL2.
>
> This affects both kvm_inject_nested_serror() and the EASE path in
> kvm_inject_nested_sea().
>
> [...]
Applied to fixes, thanks!
[1/1] KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions
commit: e2cb1f4578625e71f461d5c1ce70984193389cbb
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-17 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-15 13:11 [PATCH] KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions Fuad Tabba
2026-06-17 12:04 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®