diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2025-07-08 10:25:13 -0700 |
|---|---|---|
| committer | Oliver Upton <oliver.upton@linux.dev> | 2025-07-08 11:36:34 -0700 |
| commit | 18fbc24707db71793d5187576e09448cf48f8394 (patch) | |
| tree | a955915e59c9f8cbf08e6e1eeab3cf9d08d57c34 /arch/arm64/include/asm/kvm_emulate.h | |
| parent | 211fced460f2528339560d443df44b1c7feafaf0 (diff) | |
KVM: arm64: nv: Use guest hypervisor's vSError state
When HCR_EL2.AMO is set, physical SErrors are routed to EL2 and virtual
SError injection is enabled for EL1. Conceptually treating
host-initiated SErrors as 'physical', this means we can delegate control
of the vSError injection context to the guest hypervisor when nesting &&
AMO is set.
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250708172532.1699409-9-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/include/asm/kvm_emulate.h')
| -rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index daa0410aaebf..1ff52e66514c 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -257,6 +257,11 @@ static inline bool is_nested_ctxt(struct kvm_vcpu *vcpu) return vcpu_has_nv(vcpu) && !is_hyp_ctxt(vcpu); } +static inline bool vserror_state_is_nested(struct kvm_vcpu *vcpu) +{ + return is_nested_ctxt(vcpu) && vcpu_el2_amo_is_set(vcpu); +} + /* * The layout of SPSR for an AArch32 state is different when observed from an * AArch64 SPSR_ELx or an AArch32 SPSR_*. This function generates the AArch32 |