All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default
@ 2019-02-20 16:14 Alexander Graf
  2019-02-20 17:51 ` Matthias Brugger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Graf @ 2019-02-20 16:14 UTC (permalink / raw)
  To: u-boot

Commit 1416e2d2253 ("armv8: make SPL exception vectors optional") had a
typo in it which effectively disabled exception handling in SPL code always.

Since nobody complained, I guess we may as well disable exception handling
in SPL always by default.

So fix the bug to make the config option effective, but disable exception
handling in SPL by default. This gets us to the same functionality as before
by default, but with much less code included in the binary.

Signed-off-by: Alexander Graf <agraf@suse.de>

---

v1 -> v2:

  - remove incorrect stale change
---
 arch/arm/cpu/armv8/Kconfig | 2 +-
 arch/arm/cpu/armv8/start.S | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
index 1c12bbde75..fb061c8d73 100644
--- a/arch/arm/cpu/armv8/Kconfig
+++ b/arch/arm/cpu/armv8/Kconfig
@@ -3,7 +3,7 @@ if ARM64
 config ARMV8_SPL_EXCEPTION_VECTORS
 	bool "Install crash dump exception vectors"
 	depends on SPL
-	default y
+	default n
 	help
 	  The default exception vector table is only used for the crash
 	  dump, but still takes quite a lot of space in the image size.
diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index 12a78ee38b..fe52166e28 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -88,7 +88,7 @@ pie_fixup_done:
 	bl reset_sctrl
 #endif
 
-#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
 .macro	set_vbar, regname, reg
 	msr	\regname, \reg
 .endm
@@ -354,7 +354,7 @@ ENDPROC(smp_kick_all_cpus)
 /*-----------------------------------------------------------------------*/
 
 ENTRY(c_runtime_cpu_setup)
-#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
 	/* Relocate vBAR */
 	adr	x0, vectors
 	switch_el x1, 3f, 2f, 1f
-- 
2.12.3

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

* [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default
  2019-02-20 16:14 [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default Alexander Graf
@ 2019-02-20 17:51 ` Matthias Brugger
  2019-02-20 20:21 ` André Przywara
  2019-03-22 23:19 ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Matthias Brugger @ 2019-02-20 17:51 UTC (permalink / raw)
  To: u-boot



On 20/02/2019 17:14, Alexander Graf wrote:
> Commit 1416e2d2253 ("armv8: make SPL exception vectors optional") had a
> typo in it which effectively disabled exception handling in SPL code always.
> 
> Since nobody complained, I guess we may as well disable exception handling
> in SPL always by default.
> 
> So fix the bug to make the config option effective, but disable exception
> handling in SPL by default. This gets us to the same functionality as before
> by default, but with much less code included in the binary.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Reviewed-by: Matthias Brugger <mbrugger@suse.com>

> 
> ---
> 
> v1 -> v2:
> 
>   - remove incorrect stale change
> ---
>  arch/arm/cpu/armv8/Kconfig | 2 +-
>  arch/arm/cpu/armv8/start.S | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
> index 1c12bbde75..fb061c8d73 100644
> --- a/arch/arm/cpu/armv8/Kconfig
> +++ b/arch/arm/cpu/armv8/Kconfig
> @@ -3,7 +3,7 @@ if ARM64
>  config ARMV8_SPL_EXCEPTION_VECTORS
>  	bool "Install crash dump exception vectors"
>  	depends on SPL
> -	default y
> +	default n
>  	help
>  	  The default exception vector table is only used for the crash
>  	  dump, but still takes quite a lot of space in the image size.
> diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
> index 12a78ee38b..fe52166e28 100644
> --- a/arch/arm/cpu/armv8/start.S
> +++ b/arch/arm/cpu/armv8/start.S
> @@ -88,7 +88,7 @@ pie_fixup_done:
>  	bl reset_sctrl
>  #endif
>  
> -#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
> +#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
>  .macro	set_vbar, regname, reg
>  	msr	\regname, \reg
>  .endm
> @@ -354,7 +354,7 @@ ENDPROC(smp_kick_all_cpus)
>  /*-----------------------------------------------------------------------*/
>  
>  ENTRY(c_runtime_cpu_setup)
> -#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
> +#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
>  	/* Relocate vBAR */
>  	adr	x0, vectors
>  	switch_el x1, 3f, 2f, 1f
> 

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

* [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default
  2019-02-20 16:14 [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default Alexander Graf
  2019-02-20 17:51 ` Matthias Brugger
@ 2019-02-20 20:21 ` André Przywara
  2019-03-22 23:19 ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: André Przywara @ 2019-02-20 20:21 UTC (permalink / raw)
  To: u-boot

On 20/02/2019 16:14, Alexander Graf wrote:
> Commit 1416e2d2253 ("armv8: make SPL exception vectors optional") had a
> typo in it which effectively disabled exception handling in SPL code always.

Thanks for uncovering this embarrassing bug!

> Since nobody complained, I guess we may as well disable exception handling
> in SPL always by default.
> 
> So fix the bug to make the config option effective, but disable exception
> handling in SPL by default. This gets us to the same functionality as before
> by default, but with much less code included in the binary.

It feels a bit like cheating to just just disable that, but you have a
point with nobody complaining so far. And since it helps me tremendously
with the H6 and new SPL features:

> Signed-off-by: Alexander Graf <agraf@suse.de>

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

Cheers,
Andre.

> ---
> 
> v1 -> v2:
> 
>   - remove incorrect stale change
> ---
>  arch/arm/cpu/armv8/Kconfig | 2 +-
>  arch/arm/cpu/armv8/start.S | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
> index 1c12bbde75..fb061c8d73 100644
> --- a/arch/arm/cpu/armv8/Kconfig
> +++ b/arch/arm/cpu/armv8/Kconfig
> @@ -3,7 +3,7 @@ if ARM64
>  config ARMV8_SPL_EXCEPTION_VECTORS
>  	bool "Install crash dump exception vectors"
>  	depends on SPL
> -	default y
> +	default n
>  	help
>  	  The default exception vector table is only used for the crash
>  	  dump, but still takes quite a lot of space in the image size.
> diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
> index 12a78ee38b..fe52166e28 100644
> --- a/arch/arm/cpu/armv8/start.S
> +++ b/arch/arm/cpu/armv8/start.S
> @@ -88,7 +88,7 @@ pie_fixup_done:
>  	bl reset_sctrl
>  #endif
>  
> -#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
> +#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
>  .macro	set_vbar, regname, reg
>  	msr	\regname, \reg
>  .endm
> @@ -354,7 +354,7 @@ ENDPROC(smp_kick_all_cpus)
>  /*-----------------------------------------------------------------------*/
>  
>  ENTRY(c_runtime_cpu_setup)
> -#if defined(CONFIG_ARMV8__SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
> +#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
>  	/* Relocate vBAR */
>  	adr	x0, vectors
>  	switch_el x1, 3f, 2f, 1f
> 

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

* [U-Boot] [U-Boot, v2] armv8: Disable exception vectors in SPL by default
  2019-02-20 16:14 [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default Alexander Graf
  2019-02-20 17:51 ` Matthias Brugger
  2019-02-20 20:21 ` André Przywara
@ 2019-03-22 23:19 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-03-22 23:19 UTC (permalink / raw)
  To: u-boot

On Wed, Feb 20, 2019 at 05:14:49PM +0100, Alexander Graf wrote:

> Commit 1416e2d2253 ("armv8: make SPL exception vectors optional") had a
> typo in it which effectively disabled exception handling in SPL code always.
> 
> Since nobody complained, I guess we may as well disable exception handling
> in SPL always by default.
> 
> So fix the bug to make the config option effective, but disable exception
> handling in SPL by default. This gets us to the same functionality as before
> by default, but with much less code included in the binary.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190322/9474b1a1/attachment.sig>

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

end of thread, other threads:[~2019-03-22 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 16:14 [U-Boot] [PATCH v2] armv8: Disable exception vectors in SPL by default Alexander Graf
2019-02-20 17:51 ` Matthias Brugger
2019-02-20 20:21 ` André Przywara
2019-03-22 23:19 ` [U-Boot] [U-Boot, " 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.