From: Ian Campbell Subject: [PATCH] arm: restore ELR_hyp and SPSR_hyp on return from hypervisor to hypervisor. Date: Mon, 20 Feb 2012 15:22:01 +0000 Message-ID: <1329751321-32047-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org This is necessary to handle nested traps to the hypervisor more than one deep. I've not seen an actually failure relating to this but I'm not quite sure how we've managed to get away with not doing it (I suppose multiply nested traps are uncommon). Signed-off-by: Ian Campbell --- xen/arch/arm/entry.S | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/xen/arch/arm/entry.S b/xen/arch/arm/entry.S index 0b9cce5..36f1119 100644 --- a/xen/arch/arm/entry.S +++ b/xen/arch/arm/entry.S @@ -102,6 +102,10 @@ ENTRY(return_to_guest) ENTRY(return_to_hypervisor) ldr lr, [sp, #UREGS_lr] + ldr r11, [sp, #UREGS_pc] + msr ELR_hyp, r11 + ldr r11, [sp, #UREGS_cpsr] + msr SPSR_hyp, r11 pop {r0-r12} add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */ eret -- 1.7.2.5