linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: alexandru.elisei@arm.com, maz@kernel.org
Subject: Re: [boot-wrapper PATCH 2/5] aarch32: simplify _switch_monitor
Date: Tue, 24 Aug 2021 17:50:23 +0100	[thread overview]
Message-ID: <cb6dcb78-a5d6-f1e9-7c49-c1d194e8e568@arm.com> (raw)
In-Reply-To: <20210824134900.34849-3-mark.rutland@arm.com>

On 8/24/21 2:48 PM, Mark Rutland wrote:
> If we're lucky enough to have been booted into secure PL1, we can switch
> to monitor mode with an exception return rather than an SMC call, which
> avoids the need for boot-time vectors.
> 
> Note that while all Secure PL1 register state is accessible in Secure
> SVC mode, we must switch to Monitor mode before we set SCR.NS=1.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>

I don't know much about the subtle differences between smc, movs pc and 
eret, but from what I read this is indeed an easier way to get to MON.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>   arch/aarch32/boot.S | 19 ++++---------------
>   1 file changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/aarch32/boot.S b/arch/aarch32/boot.S
> index 82927de..e397cb0 100644
> --- a/arch/aarch32/boot.S
> +++ b/arch/aarch32/boot.S
> @@ -37,9 +37,10 @@ ASM_FUNC(_start)
>   	b	start_no_el3
>   
>   _switch_monitor:
> -	ldr	r0, =boot_vectors
> -	bl	setup_vector
> -	smc	#0
> +	adr	lr, _monitor
> +	ldr	r0, =(PSR_A | PSR_I | PSR_F | PSR_MON)
> +	msr	spsr, r0
> +	movs	pc, lr
>   
>   _monitor:
>   	/* Move the stack to Monitor mode*/
> @@ -102,18 +103,6 @@ ASM_FUNC(jump_kernel)
>   	msr	spsr_cxf, r4
>   	movs	pc, lr
>   
> -	.section .vectors
> -	.align 6
> -boot_vectors:
> -	b	.
> -	b	.
> -	b	_monitor
> -	b	.
> -	b	.
> -	b	.
> -	b	.
> -	b	.
> -
>   	.section .data
>   	.align 2
>   flag_no_el3:
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-08-24 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 13:48 [boot-wrapper PATCH 0/5] Misc cleanups Mark Rutland
2021-08-24 13:48 ` [boot-wrapper PATCH 1/5] Remove unused Set/Way cache helpers Mark Rutland
2021-08-24 16:49   ` Andre Przywara
2021-08-24 13:48 ` [boot-wrapper PATCH 2/5] aarch32: simplify _switch_monitor Mark Rutland
2021-08-24 16:50   ` Andre Przywara [this message]
2021-08-24 13:48 ` [boot-wrapper PATCH 3/5] GICv3: initialize without RMW Mark Rutland
2021-08-24 16:50   ` Andre Przywara
2021-08-24 13:48 ` [boot-wrapper PATCH 4/5] Rename kernel *_RESET values to *_KERNEL Mark Rutland
2021-08-24 16:50   ` Andre Przywara
2021-08-24 13:49 ` [boot-wrapper PATCH 5/5] Rename `CNTFRQ` -> `COUNTER_FREQ` Mark Rutland
2021-08-24 16:51   ` Andre Przywara
2021-08-25  9:46 ` [boot-wrapper PATCH 0/5] Misc cleanups Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb6dcb78-a5d6-f1e9-7c49-c1d194e8e568@arm.com \
    --to=andre.przywara@arm.com \
    --cc=alexandru.elisei@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).