xen/arm32: SPSR_hyp/SPSR

SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
See: ARM DDI 0487D.b page G8-5993.

This fixes booting Xen/arm32 on QEMU.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
Stefano Stabellini committed 2021-06-09 16:52:29 -07:00
1 parent 3e09045991
commit dfcffb128b
1 file changed
+2 -2
+2 -2
View File
@@ -170,7 +170,7 @@ ENDPROC(prepare_context_from_guest)
mrc CP32(r11, HSR) /* Save exception syndrome */
str r11, [sp, #UREGS_hsr]
mrs r11, SPSR_hyp
mrs r11, SPSR
str r11, [sp, #UREGS_cpsr]
/*
@@ -395,7 +395,7 @@ return_to_hypervisor:
ldr r11, [sp, #UREGS_pc]
msr ELR_hyp, r11
ldr r11, [sp, #UREGS_cpsr]
msr SPSR_hyp, r11
msr SPSR, r11
#ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
/*
* Hardening branch predictor may require to setup a different
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.