[U-Boot] [PATCH] ARM: HYP/non-sec: Propagate stack pointer to hyp mode

Marc Zyngier marc.zyngier at arm.com
Mon Jan 6 11:47:49 CET 2014


Hi Ian,

On Sun, Dec 29 2013 at 07:07:56 PM, Ian Campbell <ijc at hellion.org.uk> wrote:
> Some users of the u-boot API (specifically grub) use the initial SP as a hint
> regarding where to look for the u-boot API signature.

That looks really fragile...

> Signed-off-by: Ian Campbell <ijc at hellion.org.uk>
> Cc: Marc Zyngier <marc.zyngier at arm.com>
> ---
> This applies on top of Marc's "ARMv7: add PSCI support to u-boot" and allows me
> to chainload grub on a cubieboard2. (I don't think that has been applied
> anywhere yet?)

Not yet, I'm still tinkering with it. See the current state at:
git://git.kernel.org/pub/scm/linux/kernel/git/maz/u-boot.git wip/psci

> ---
>  arch/arm/cpu/armv7/nonsec_virt.S | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
> index 6130a37..2c9e097 100644
> --- a/arch/arm/cpu/armv7/nonsec_virt.S
> +++ b/arch/arm/cpu/armv7/nonsec_virt.S
> @@ -60,6 +60,10 @@ _secure_monitor:
>  #ifdef CONFIG_ARMV7_VIRT
>  	orreq	r5, r5, #0x100			@ allow HVC instruction
>  	moveq	r6, #HYP_MODE			@ Enter the kernel as HYP
> +
> +	mrseq 	r4, sp_svc			@ Propagate SP to HYP mode
> +	msreq	sp_hyp, r4			@ it serves as a "hint" to
> +						@ find the u-boot API root.

So how does it work? Grub knows the range in which to find the
signature? And then what?

Not saying this patch is wrong (it seems to solve a real problem), but
I'd like to understand it a bit more.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.


More information about the U-Boot mailing list