All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode
@ 2019-06-23 10:59 Heinrich Schuchardt
  2019-06-23 11:07 ` Marek Vasut
  2019-07-18 23:56 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2019-06-23 10:59 UTC (permalink / raw)
  To: u-boot

When a crash occurs in thumb mode the crash dump is incorrect. This is due
to the usage of a non-existing configuration variable CONFIG_ARM_THUMB in
the definition of macro thumb_mode(regs).

Use CONFIG_IS_ENABLED(SYS_THUMB_BUILD) to detect that the code has been
compiled for thumb mode. Remove ARM_THUMB from config_whitelist.txt.

With the patch crash dumps indicate thumb mode correctly.

On a system with thumb mode:

=> exception unaligned
data abort
pc : [<8f7a2b52>]          lr : [<8f7ab1ef>]
reloc pc : [<1780cb52>]    lr : [<178151ef>]
sp : 8ed8c3f8  ip : 8f7a2b4d     fp : 00000002
r10: 8f7f8228  r9 : 8ed95ea8     r8 : 8ed99488
r7 : 8f7ab141  r6 : 00000000     r5 : 8ed8c3f9  r4 : 8f7f6390
r3 : 8ed9948c  r2 : 00000001     r1 : 00000000  r0 : 8f7f6390
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32 (T)
Code: 8f7e 466d f105 0501 (e9d5) 6700

The Flags line has '(T)' and in the Code line the output is in u16 groups.

On a system without thumb mode:

=> exception breakpoint
prefetch abort
pc : [<7ff5a5c8>]          lr : [<7ff675ec>]
reloc pc : [<0000e5c8>]    lr : [<0001b5ec>]
sp : 7ee0ad80  ip : 7ff5a5cc     fp : 7ff674cc
r10: 00000002  r9 : 7ef0bed8     r8 : 7ffd6214
r7 : 7ef0e080  r6 : 00000000     r5 : 7ffd4090  r4 : 00000000
r3 : 7ef0e084  r2 : 00000001     r1 : 00000000  r0 : 7ffd4090
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Code: e1a0500d e2855001 e1c560d0 e3a00001 (e12fff1e)

The Flags line does not show '(T)' and in the Code line the output is in
u32 groups.

Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
	remove ARM_THUMB from config_whitelist.txt
	fix typos in commit message
---
 arch/arm/include/asm/proc-armv/ptrace.h | 2 +-
 scripts/config_whitelist.txt            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/proc-armv/ptrace.h b/arch/arm/include/asm/proc-armv/ptrace.h
index 183b00a087..e37ad8fd1f 100644
--- a/arch/arm/include/asm/proc-armv/ptrace.h
+++ b/arch/arm/include/asm/proc-armv/ptrace.h
@@ -86,7 +86,7 @@ struct pt_regs {
 #define user_mode(regs)	\
 	(((regs)->ARM_cpsr & 0xf) == 0)

-#ifdef CONFIG_ARM_THUMB
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
 #define thumb_mode(regs) \
 	(((regs)->ARM_cpsr & T_BIT))
 #else
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index d252045d80..d6bef69a16 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -61,7 +61,6 @@ CONFIG_ARM_FREQ
 CONFIG_ARM_GIC_BASE_ADDRESS
 CONFIG_ARM_PL180_MMCI_BASE
 CONFIG_ARM_PL180_MMCI_CLOCK_FREQ
-CONFIG_ARM_THUMB
 CONFIG_ARP_TIMEOUT
 CONFIG_ASTRO_COFDMDUOS2
 CONFIG_ASTRO_TWIN7S2
--
2.20.1

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

* [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode
  2019-06-23 10:59 [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode Heinrich Schuchardt
@ 2019-06-23 11:07 ` Marek Vasut
  2019-07-18 23:56 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2019-06-23 11:07 UTC (permalink / raw)
  To: u-boot

On 6/23/19 12:59 PM, Heinrich Schuchardt wrote:
> When a crash occurs in thumb mode the crash dump is incorrect. This is due
> to the usage of a non-existing configuration variable CONFIG_ARM_THUMB in
> the definition of macro thumb_mode(regs).
> 
> Use CONFIG_IS_ENABLED(SYS_THUMB_BUILD) to detect that the code has been
> compiled for thumb mode. Remove ARM_THUMB from config_whitelist.txt.
> 
> With the patch crash dumps indicate thumb mode correctly.
> 
> On a system with thumb mode:
> 
> => exception unaligned
> data abort
> pc : [<8f7a2b52>]          lr : [<8f7ab1ef>]
> reloc pc : [<1780cb52>]    lr : [<178151ef>]
> sp : 8ed8c3f8  ip : 8f7a2b4d     fp : 00000002
> r10: 8f7f8228  r9 : 8ed95ea8     r8 : 8ed99488
> r7 : 8f7ab141  r6 : 00000000     r5 : 8ed8c3f9  r4 : 8f7f6390
> r3 : 8ed9948c  r2 : 00000001     r1 : 00000000  r0 : 8f7f6390
> Flags: nzCv  IRQs off  FIQs off  Mode SVC_32 (T)
> Code: 8f7e 466d f105 0501 (e9d5) 6700
> 
> The Flags line has '(T)' and in the Code line the output is in u16 groups.
> 
> On a system without thumb mode:
> 
> => exception breakpoint
> prefetch abort
> pc : [<7ff5a5c8>]          lr : [<7ff675ec>]
> reloc pc : [<0000e5c8>]    lr : [<0001b5ec>]
> sp : 7ee0ad80  ip : 7ff5a5cc     fp : 7ff674cc
> r10: 00000002  r9 : 7ef0bed8     r8 : 7ffd6214
> r7 : 7ef0e080  r6 : 00000000     r5 : 7ffd4090  r4 : 00000000
> r3 : 7ef0e084  r2 : 00000001     r1 : 00000000  r0 : 7ffd4090
> Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
> Code: e1a0500d e2855001 e1c560d0 e3a00001 (e12fff1e)
> 
> The Flags line does not show '(T)' and in the Code line the output is in
> u32 groups.
> 
> Reported-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Marek Vasut <marex@denx.de>

> ---
> v2
> 	remove ARM_THUMB from config_whitelist.txt
> 	fix typos in commit message
> ---
>  arch/arm/include/asm/proc-armv/ptrace.h | 2 +-
>  scripts/config_whitelist.txt            | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/proc-armv/ptrace.h b/arch/arm/include/asm/proc-armv/ptrace.h
> index 183b00a087..e37ad8fd1f 100644
> --- a/arch/arm/include/asm/proc-armv/ptrace.h
> +++ b/arch/arm/include/asm/proc-armv/ptrace.h
> @@ -86,7 +86,7 @@ struct pt_regs {
>  #define user_mode(regs)	\
>  	(((regs)->ARM_cpsr & 0xf) == 0)
> 
> -#ifdef CONFIG_ARM_THUMB
> +#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
>  #define thumb_mode(regs) \
>  	(((regs)->ARM_cpsr & T_BIT))
>  #else
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index d252045d80..d6bef69a16 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -61,7 +61,6 @@ CONFIG_ARM_FREQ
>  CONFIG_ARM_GIC_BASE_ADDRESS
>  CONFIG_ARM_PL180_MMCI_BASE
>  CONFIG_ARM_PL180_MMCI_CLOCK_FREQ
> -CONFIG_ARM_THUMB
>  CONFIG_ARP_TIMEOUT
>  CONFIG_ASTRO_COFDMDUOS2
>  CONFIG_ASTRO_TWIN7S2
> --
> 2.20.1
> 


-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode
  2019-06-23 10:59 [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode Heinrich Schuchardt
  2019-06-23 11:07 ` Marek Vasut
@ 2019-07-18 23:56 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-07-18 23:56 UTC (permalink / raw)
  To: u-boot

On Sun, Jun 23, 2019 at 12:59:31PM +0200, Heinrich Schuchardt wrote:

> When a crash occurs in thumb mode the crash dump is incorrect. This is due
> to the usage of a non-existing configuration variable CONFIG_ARM_THUMB in
> the definition of macro thumb_mode(regs).
> 
> Use CONFIG_IS_ENABLED(SYS_THUMB_BUILD) to detect that the code has been
> compiled for thumb mode. Remove ARM_THUMB from config_whitelist.txt.
> 
> With the patch crash dumps indicate thumb mode correctly.
> 
> On a system with thumb mode:
> 
> => exception unaligned
> data abort
> pc : [<8f7a2b52>]          lr : [<8f7ab1ef>]
> reloc pc : [<1780cb52>]    lr : [<178151ef>]
> sp : 8ed8c3f8  ip : 8f7a2b4d     fp : 00000002
> r10: 8f7f8228  r9 : 8ed95ea8     r8 : 8ed99488
> r7 : 8f7ab141  r6 : 00000000     r5 : 8ed8c3f9  r4 : 8f7f6390
> r3 : 8ed9948c  r2 : 00000001     r1 : 00000000  r0 : 8f7f6390
> Flags: nzCv  IRQs off  FIQs off  Mode SVC_32 (T)
> Code: 8f7e 466d f105 0501 (e9d5) 6700
> 
> The Flags line has '(T)' and in the Code line the output is in u16 groups.
> 
> On a system without thumb mode:
> 
> => exception breakpoint
> prefetch abort
> pc : [<7ff5a5c8>]          lr : [<7ff675ec>]
> reloc pc : [<0000e5c8>]    lr : [<0001b5ec>]
> sp : 7ee0ad80  ip : 7ff5a5cc     fp : 7ff674cc
> r10: 00000002  r9 : 7ef0bed8     r8 : 7ffd6214
> r7 : 7ef0e080  r6 : 00000000     r5 : 7ffd4090  r4 : 00000000
> r3 : 7ef0e084  r2 : 00000001     r1 : 00000000  r0 : 7ffd4090
> Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
> Code: e1a0500d e2855001 e1c560d0 e3a00001 (e12fff1e)
> 
> The Flags line does not show '(T)' and in the Code line the output is in
> u32 groups.
> 
> Reported-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Marek Vasut <marex@denx.de>

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/20190718/8c665e6c/attachment.sig>

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

end of thread, other threads:[~2019-07-18 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 10:59 [U-Boot] [PATCH v2 1/1] ARM: correct detection of thumb mode Heinrich Schuchardt
2019-06-23 11:07 ` Marek Vasut
2019-07-18 23:56 ` 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.