Skip to content

Commit 0730559

Browse files
author
Marc Zyngier
committed
KVM: arm64: pkvm: Give priority to standard traps over pvm handling
Checking for pvm handling first means that we cannot handle ptrauth traps or apply any of the workarounds (GICv3 or TX2 #219). Flip the order around. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Fuad Tabba <[email protected]> Tested-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0c7639c commit 0730559

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

arch/arm64/kvm/hyp/nvhe/switch.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ static void __pmu_switch_to_host(struct kvm_cpu_context *host_ctxt)
167167
*/
168168
static bool kvm_handle_pvm_sys64(struct kvm_vcpu *vcpu, u64 *exit_code)
169169
{
170-
if (kvm_handle_pvm_sysreg(vcpu, exit_code))
171-
return true;
172-
173-
return kvm_hyp_handle_sysreg(vcpu, exit_code);
170+
/*
171+
* Make sure we handle the exit for workarounds and ptrauth
172+
* before the pKVM handling, as the latter could decide to
173+
* UNDEF.
174+
*/
175+
return (kvm_hyp_handle_sysreg(vcpu, exit_code) ||
176+
kvm_handle_pvm_sysreg(vcpu, exit_code));
174177
}
175178

176179
/**

0 commit comments

Comments
 (0)