diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index 59a296a4ad..d5c2982e4a 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -118,7 +118,7 @@ abort_guest_exit_end: bne return_from_trap skip_check: - mov pc, lr + b enter_hypervisor_from_guest_preirq ENDPROC(prepare_context_from_guest) /* diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S index 97dc60210d..d4fb5fdc1c 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -191,6 +191,7 @@ ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", "nop; nop", SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) + bl enter_hypervisor_from_guest_preirq msr daifclr, \iflags bl enter_hypervisor_from_guest mov x0, sp diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index adbedc2d15..cb4e3b627b 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1986,15 +1986,25 @@ static inline bool needs_ssbd_flip(struct vcpu *v) /* * Actions that needs to be done after entering the hypervisor from the - * guest and before we handle any request. + * guest and before the interrupts are unmasked. */ -void enter_hypervisor_from_guest(void) +void enter_hypervisor_from_guest_preirq(void) { struct vcpu *v = current; /* If the guest has disabled the workaround, bring it back on. */ if ( needs_ssbd_flip(v) ) arm_smccc_1_1_smc(ARM_SMCCC_ARCH_WORKAROUND_2_FID, 1, NULL); +} + +/* + * Actions that needs to be done after entering the hypervisor from the + * guest and before we handle any request. Depending on the exception trap, + * this may be called with interrupts unmasked. + */ +void enter_hypervisor_from_guest(void) +{ + struct vcpu *v = current; /* * If we pended a virtual abort, preserve it until it gets cleared.