From: Stefano Stabellini Date: Thu, 6 Dec 2012 10:19:08 +0000 (+0000) Subject: xen/arm: disable interrupts on return_to_hypervisor X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f60d158a02165aac0eb824106f0655589b4f683e;p=people%2Faperard%2Fxen-arm.git xen/arm: disable interrupts on return_to_hypervisor At the moment it is possible to reach return_to_hypervisor with interrupts enabled (it happens all the times when we are actually going back to hypervisor mode, when we don't take the return_to_guest path). If that happens we risk loosing the content of ELR_hyp: if we receive an interrupt right after restoring ELR_hyp, once we come back we'll have a different value in ELR_hyp and the original is lost. In order to make the return_to_hypervisor path safe, we disable interrupts before restoring any registers. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell Committed-by: Ian Campbell --- diff --git a/xen/arch/arm/entry.S b/xen/arch/arm/entry.S index 2ff32a183d..1d6ff325b0 100644 --- a/xen/arch/arm/entry.S +++ b/xen/arch/arm/entry.S @@ -108,6 +108,7 @@ ENTRY(return_to_guest) RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq); /* Fall thru */ ENTRY(return_to_hypervisor) + cpsid i ldr lr, [sp, #UREGS_lr] ldr r11, [sp, #UREGS_pc] msr ELR_hyp, r11