[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 9b66195063c5a145843547b1d692bd189be85287
WARNING: Author mismatch between patch and upstream commit: Backport author: Mark Brownbroonie@kernel.org Commit author: Mark Rutlandmark.rutland@arm.com
Status in newer kernel trees: 6.14.y | Present (exact SHA1) 6.13.y | Present (different SHA1: 8ca75010aaab) 6.12.y | Present (different SHA1: 2e4f2c20db53) 6.6.y | Present (different SHA1: 2afe039450a0)
Note: The patch differs from the upstream commit: --- 1: 9b66195063c5a ! 1: a592d3131f595 KVM: arm64: Refactor exit handlers @@ Metadata ## Commit message ## KVM: arm64: Refactor exit handlers
+ [ Upstream commit 9b66195063c5a145843547b1d692bd189be85287 ] + The hyp exit handling logic is largely shared between VHE and nVHE/hVHE, with common logic in arch/arm64/kvm/hyp/include/hyp/switch.h. The code in the header depends on function definitions provided by @@ Commit message Reviewed-by: Oliver Upton oliver.upton@linux.dev Link: https://lore.kernel.org/r/20250210195226.1215254-7-mark.rutland@arm.com Signed-off-by: Marc Zyngier maz@kernel.org + Signed-off-by: Mark Brown broonie@kernel.org
## arch/arm64/kvm/hyp/include/hyp/switch.h ## @@ arch/arm64/kvm/hyp/include/hyp/switch.h: static bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *exit_code) @@ arch/arm64/kvm/hyp/nvhe/switch.c: static const exit_handler_fn *kvm_get_exit_han +static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code) { + const exit_handler_fn *handlers = kvm_get_exit_handler_array(vcpu); -+ + struct kvm *kvm = kern_hyp_va(vcpu->kvm); + + synchronize_vcpu_pstate(vcpu, exit_code); + + /* @@ arch/arm64/kvm/hyp/nvhe/switch.c: static const exit_handler_fn *kvm_get_exit_han + * it. The check below is based on the one in + * kvm_arch_vcpu_ioctl_run(). + */ - if (unlikely(vcpu_is_protected(vcpu) && vcpu_mode_is_32bit(vcpu))) { + if (kvm_vm_is_protected(kvm) && vcpu_mode_is_32bit(vcpu)) { /* * As we have caught the guest red-handed, decide that it isn't @@ arch/arm64/kvm/hyp/nvhe/switch.c: static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code) @@ arch/arm64/kvm/hyp/nvhe/switch.c: static void early_exit_filter(struct kvm_vcpu
## arch/arm64/kvm/hyp/vhe/switch.c ## @@ arch/arm64/kvm/hyp/vhe/switch.c: static const exit_handler_fn hyp_exit_handlers[] = { - [ESR_ELx_EC_MOPS] = kvm_hyp_handle_mops, + [ESR_ELx_EC_PAC] = kvm_hyp_handle_ptrauth, };
-static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu) @@ arch/arm64/kvm/hyp/vhe/switch.c: static const exit_handler_fn hyp_exit_handlers[
-static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code) -{ - /* - * If we were in HYP context on entry, adjust the PSTATE view - * so that the usual helpers work correctly. -@@ arch/arm64/kvm/hyp/vhe/switch.c: static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code) - *vcpu_cpsr(vcpu) &= ~(PSR_MODE_MASK | PSR_MODE32_BIT); - *vcpu_cpsr(vcpu) |= mode; - } -+ + return __fixup_guest_exit(vcpu, exit_code, hyp_exit_handlers); }
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |