* [PATCH] xen/arm32: SPSR_hyp/SPSR
@ 2021-06-09 17:43 Stefano Stabellini
2021-06-09 17:53 ` Julien Grall
0 siblings, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2021-06-09 17:43 UTC (permalink / raw)
To: julien
Cc: Volodymyr_Babchuk, xen-devel, Bertrand.Marquis, Michal.Orzel,
edgar.iglesias, sstabellini, Stefano Stabellini
SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
This fixes booting Xen/arm32 on QEMU.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
xen/arch/arm/arm32/entry.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index f2f1bc7a31..4e421109db 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -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
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] xen/arm32: SPSR_hyp/SPSR
2021-06-09 17:43 [PATCH] xen/arm32: SPSR_hyp/SPSR Stefano Stabellini
@ 2021-06-09 17:53 ` Julien Grall
2021-06-09 19:42 ` Edgar E. Iglesias
2021-06-09 23:50 ` Stefano Stabellini
0 siblings, 2 replies; 4+ messages in thread
From: Julien Grall @ 2021-06-09 17:53 UTC (permalink / raw)
To: Stefano Stabellini
Cc: Volodymyr_Babchuk, xen-devel, Bertrand.Marquis, Michal.Orzel,
edgar.iglesias, Stefano Stabellini
Hi Stefano,
On 09/06/2021 18:43, Stefano Stabellini wrote:
> SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
> trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
Please provide a reference to the spec. This helps reviewer and/or
future developper to figure out quickly where this comes from.
>
> This fixes booting Xen/arm32 on QEMU.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
With the reference added:
Reviewed-by: Julien Grall <jgrall@amazon.com>
Cheers,
--
Julien Grall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xen/arm32: SPSR_hyp/SPSR
2021-06-09 17:53 ` Julien Grall
@ 2021-06-09 19:42 ` Edgar E. Iglesias
2021-06-09 23:50 ` Stefano Stabellini
1 sibling, 0 replies; 4+ messages in thread
From: Edgar E. Iglesias @ 2021-06-09 19:42 UTC (permalink / raw)
To: Julien Grall
Cc: Stefano Stabellini, Volodymyr_Babchuk, xen-devel,
Bertrand.Marquis, Michal.Orzel, Stefano Stabellini
On Wed, Jun 09, 2021 at 06:53:02PM +0100, Julien Grall wrote:
> Hi Stefano,
>
> On 09/06/2021 18:43, Stefano Stabellini wrote:
> > SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
> > trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
>
> Please provide a reference to the spec. This helps reviewer and/or future
> developper to figure out quickly where this comes from.
>
> >
> > This fixes booting Xen/arm32 on QEMU.
> >
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
>
> With the reference added:
>
> 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>
Cheers,
Edgar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xen/arm32: SPSR_hyp/SPSR
2021-06-09 17:53 ` Julien Grall
2021-06-09 19:42 ` Edgar E. Iglesias
@ 2021-06-09 23:50 ` Stefano Stabellini
1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2021-06-09 23:50 UTC (permalink / raw)
To: Julien Grall
Cc: Stefano Stabellini, Volodymyr_Babchuk, xen-devel,
Bertrand.Marquis, Michal.Orzel, edgar.iglesias,
Stefano Stabellini
On Wed, 9 Jun 2021, Julien Grall wrote:
> Hi Stefano,
>
> On 09/06/2021 18:43, Stefano Stabellini wrote:
> > SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
> > trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
>
> Please provide a reference to the spec. This helps reviewer and/or future
> developper to figure out quickly where this comes from.
>
> >
> > This fixes booting Xen/arm32 on QEMU.
> >
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
>
> With the reference added:
>
> Reviewed-by: Julien Grall <jgrall@amazon.com>
Thanks!
I added: ARM DDI 0487D.b page G8-5993 and committed it
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-09 23:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 17:43 [PATCH] xen/arm32: SPSR_hyp/SPSR Stefano Stabellini
2021-06-09 17:53 ` Julien Grall
2021-06-09 19:42 ` Edgar E. Iglesias
2021-06-09 23:50 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.