[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/arm: traps: enter the SP_EL0 vector group for an exception at EL1t



commit 21a853b92a4c65645006d49a98fda158b8d122c4
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
AuthorDate: Wed Nov 18 01:59:02 2026 +0100
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Thu Nov 19 08:18:28 2026 +0100

    xen/arm: traps: enter the SP_EL0 vector group for an exception at EL1t
    
    An exception taken from the current level is delivered to the SP_EL0
    vector group (offset 0x000) when the guest was at EL1t, and to the
    SP_ELx group (0x200) only at EL1h (ARM DDI 0487 M.d D1.4.1).
    exception_handler64() used 0x200 for both.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/traps.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 47a5c6bdd4..b4ca812233 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -532,7 +532,13 @@ static vaddr_t exception_handler64(struct cpu_user_regs 
*regs, vaddr_t offset)
         base += VECTOR64_LOWER32_BASE;
     else if ( psr_mode(regs->cpsr,PSR_MODE_EL0t) )
         base += VECTOR64_LOWER64_BASE;
-    else /* Otherwise must be from kernel mode */
+    /*
+     * Otherwise must be from kernel mode. The current EL group is chosen by
+     * the stack pointer in use (ARM DDI 0487 M.d D1.4.1).
+     */
+    else if ( psr_mode(regs->cpsr,PSR_MODE_EL1t) )
+        base += VECTOR64_CURRENT_SP0_BASE;
+    else
         base += VECTOR64_CURRENT_SPx_BASE;
 
     return base + offset;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.