All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3
@ 2022-05-11  8:39 Michal Simek
  2022-05-18 11:22 ` Michal Simek
  2022-05-23 17:57 ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2022-05-11  8:39 UTC (permalink / raw)
  To: u-boot, git; +Cc: Sai Pavan Boddu, Tom Rini

From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>

This would prevent configuring non-secure regs in case gic security
extensions are not emulated in Qemu.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
---

 arch/arm/lib/gic_64.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/lib/gic_64.S b/arch/arm/lib/gic_64.S
index 155212a419be..86cd882fc759 100644
--- a/arch/arm/lib/gic_64.S
+++ b/arch/arm/lib/gic_64.S
@@ -40,6 +40,8 @@ ENTRY(gic_init_secure)
 	sub	w10, w10, #0x1
 	cbnz	w10, 0b
 #elif defined(CONFIG_GICV2)
+	switch_el x1, 2f, 1f, 1f
+2:
 	mov	w9, #0x3		/* EnableGrp0 | EnableGrp1 */
 	str	w9, [x0, GICD_CTLR]	/* Secure GICD_CTLR */
 	ldr	w9, [x0, GICD_TYPER]
@@ -141,6 +143,8 @@ ENTRY(gic_init_secure_percpu)
 	 * x0: Distributor Base
 	 * x1: Cpu Interface Base
 	 */
+	switch_el x2, 4f, 5f, 5f
+4:
 	mov	w9, #~0			/* Config SGIs and PPIs as Grp1 */
 	str	w9, [x0, GICD_IGROUPRn]	/* GICD_IGROUPR0 */
 	mov	w9, #0x1		/* Enable SGI 0 */
@@ -155,6 +159,7 @@ ENTRY(gic_init_secure_percpu)
 	mov	w9, #0x1 << 7		/* Non-Secure access to GICC_PMR */
 	str	w9, [x1, GICC_PMR]
 #endif
+5:
 	ret
 ENDPROC(gic_init_secure_percpu)
 
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3
  2022-05-11  8:39 [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3 Michal Simek
@ 2022-05-18 11:22 ` Michal Simek
  2022-05-18 15:44   ` Tom Rini
  2022-05-23 17:57 ` Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Simek @ 2022-05-18 11:22 UTC (permalink / raw)
  To: U-Boot, git, Tom Rini; +Cc: Sai Pavan Boddu

Hi Tom,

st 11. 5. 2022 v 10:39 odesílatel Michal Simek <monstr@monstr.eu> napsal:
>
> From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
>
> This would prevent configuring non-secure regs in case gic security
> extensions are not emulated in Qemu.
>
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
>
>  arch/arm/lib/gic_64.S | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/lib/gic_64.S b/arch/arm/lib/gic_64.S
> index 155212a419be..86cd882fc759 100644
> --- a/arch/arm/lib/gic_64.S
> +++ b/arch/arm/lib/gic_64.S
> @@ -40,6 +40,8 @@ ENTRY(gic_init_secure)
>         sub     w10, w10, #0x1
>         cbnz    w10, 0b
>  #elif defined(CONFIG_GICV2)
> +       switch_el x1, 2f, 1f, 1f
> +2:
>         mov     w9, #0x3                /* EnableGrp0 | EnableGrp1 */
>         str     w9, [x0, GICD_CTLR]     /* Secure GICD_CTLR */
>         ldr     w9, [x0, GICD_TYPER]
> @@ -141,6 +143,8 @@ ENTRY(gic_init_secure_percpu)
>          * x0: Distributor Base
>          * x1: Cpu Interface Base
>          */
> +       switch_el x2, 4f, 5f, 5f
> +4:
>         mov     w9, #~0                 /* Config SGIs and PPIs as Grp1 */
>         str     w9, [x0, GICD_IGROUPRn] /* GICD_IGROUPR0 */
>         mov     w9, #0x1                /* Enable SGI 0 */
> @@ -155,6 +159,7 @@ ENTRY(gic_init_secure_percpu)
>         mov     w9, #0x1 << 7           /* Non-Secure access to GICC_PMR */
>         str     w9, [x1, GICC_PMR]
>  #endif
> +5:
>         ret
>  ENDPROC(gic_init_secure_percpu)
>
> --
> 2.36.0
>

Can you please review this patch?

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3
  2022-05-18 11:22 ` Michal Simek
@ 2022-05-18 15:44   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-05-18 15:44 UTC (permalink / raw)
  To: Michal Simek; +Cc: U-Boot, git, Sai Pavan Boddu

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

On Wed, May 18, 2022 at 01:22:24PM +0200, Michal Simek wrote:
> Hi Tom,
> 
> st 11. 5. 2022 v 10:39 odesílatel Michal Simek <monstr@monstr.eu> napsal:
> >
> > From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> >
> > This would prevent configuring non-secure regs in case gic security
> > extensions are not emulated in Qemu.
> >
> > Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> > Signed-off-by: Michal Simek <michal.simek@amd.com>
> > ---
> >
> >  arch/arm/lib/gic_64.S | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/lib/gic_64.S b/arch/arm/lib/gic_64.S
> > index 155212a419be..86cd882fc759 100644
> > --- a/arch/arm/lib/gic_64.S
> > +++ b/arch/arm/lib/gic_64.S
> > @@ -40,6 +40,8 @@ ENTRY(gic_init_secure)
> >         sub     w10, w10, #0x1
> >         cbnz    w10, 0b
> >  #elif defined(CONFIG_GICV2)
> > +       switch_el x1, 2f, 1f, 1f
> > +2:
> >         mov     w9, #0x3                /* EnableGrp0 | EnableGrp1 */
> >         str     w9, [x0, GICD_CTLR]     /* Secure GICD_CTLR */
> >         ldr     w9, [x0, GICD_TYPER]
> > @@ -141,6 +143,8 @@ ENTRY(gic_init_secure_percpu)
> >          * x0: Distributor Base
> >          * x1: Cpu Interface Base
> >          */
> > +       switch_el x2, 4f, 5f, 5f
> > +4:
> >         mov     w9, #~0                 /* Config SGIs and PPIs as Grp1 */
> >         str     w9, [x0, GICD_IGROUPRn] /* GICD_IGROUPR0 */
> >         mov     w9, #0x1                /* Enable SGI 0 */
> > @@ -155,6 +159,7 @@ ENTRY(gic_init_secure_percpu)
> >         mov     w9, #0x1 << 7           /* Non-Secure access to GICC_PMR */
> >         str     w9, [x1, GICC_PMR]
> >  #endif
> > +5:
> >         ret
> >  ENDPROC(gic_init_secure_percpu)
> >
> > --
> > 2.36.0
> >
> 
> Can you please review this patch?

I've put this in my queue to make sure I don't miss it for -rc3.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3
  2022-05-11  8:39 [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3 Michal Simek
  2022-05-18 11:22 ` Michal Simek
@ 2022-05-23 17:57 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-05-23 17:57 UTC (permalink / raw)
  To: Michal Simek; +Cc: u-boot, git, Sai Pavan Boddu

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Wed, May 11, 2022 at 10:39:07AM +0200, Michal Simek wrote:

> From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> 
> This would prevent configuring non-secure regs in case gic security
> extensions are not emulated in Qemu.
> 
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@amd.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-23 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11  8:39 [PATCH] arm: gic_v2: Skip gic_init_secure when cpu is not in el3 Michal Simek
2022-05-18 11:22 ` Michal Simek
2022-05-18 15:44   ` Tom Rini
2022-05-23 17:57 ` Tom Rini

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.