diff mbox

ARM: reinsert ARCH_MULTI_V4 Kconfig option

Message ID 1386922149-4561-1-git-send-email-jonas.jensen@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jonas Jensen Dec. 13, 2013, 8:09 a.m. UTC
CPU_FA526 lacks thumb state support and doesn't get along with some
of the options enabled by ARCH_MULTI_V4T.

More specifically it doesn't get along with CPU_ARM920T:

CPU_ABRT_EV4T
CPU_CACHE_V4WT
CPU_COPY_V4WB
CPU_TLB_V4WBI

One or a combination of the above cause trouble for userspace, the
following happens when kernel tries to exec init:

[   11.790000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[   11.790000]
[   11.790000] CPU: 0 PID: 1 Comm: init Not tainted 3.13.0-rc3-next-20131212+ #1332
[   11.790000] [<c000d620>] (unwind_backtrace) from [<c000ba54>] (show_stack+0x18/0x1c)
[   11.790000] [<c000ba54>] (show_stack) from [<c027f498>] (dump_stack+0x20/0x28)
[   11.790000] [<c027f498>] (dump_stack) from [<c027ce80>] (panic+0x98/0x1ec)
[   11.790000] [<c027ce80>] (panic) from [<c0016d4c>] (do_exit+0x80c/0x8e8)
[   11.790000] [<c0016d4c>] (do_exit) from [<c0016ea4>] (do_group_exit+0x44/0xb8)
[   11.790000] [<c0016ea4>] (do_group_exit) from [<c0022dbc>] (get_signal_to_deliver+0x2fc/0x5a4)
[   11.790000] [<c0022dbc>] (get_signal_to_deliver) from [<c027ca38>] (do_signal+0xac/0x3e0)
[   11.790000] [<c027ca38>] (do_signal) from [<c000b460>] (do_work_pending+0xcc/0xe8)
[   11.790000] [<c000b460>] (do_work_pending) from [<c0009374>] (work_pending+0xc/0x20)

Reinsert ARCH_MULTI_V4 so it can be used on platforms with CPU_FA526.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    I don't know how to handle this so I'm making it standalone for
    your feedback (it was broken out from MOXA ART SoC series).
    
    This is important for MOXA ART (and other FA526 platforms),
    please have a look.
    
    Applies to next-20131213

 arch/arm/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Russell King - ARM Linux Dec. 13, 2013, 9:56 a.m. UTC | #1
On Fri, Dec 13, 2013 at 09:09:09AM +0100, Jonas Jensen wrote:
> CPU_FA526 lacks thumb state support and doesn't get along with some
> of the options enabled by ARCH_MULTI_V4T.
> 
> More specifically it doesn't get along with CPU_ARM920T:
> 
> CPU_ABRT_EV4T
> CPU_CACHE_V4WT
> CPU_COPY_V4WB
> CPU_TLB_V4WBI

Having these selected doesn't change how the kernel is compiled or how
the kernel uses the code which these provide.  These mainly control
which files are built.

They also control indirectly how the code is called - but the ultimate
decision is made by the CPU which is detected and the block in
__fa526_proc_info.

So, having these symbols enabled (provided the right ones for FA526 are
also enabled) makes no difference.  So I don't buy your explanation.
Jonas Jensen Dec. 13, 2013, 10:51 a.m. UTC | #2
On 13 December 2013 10:56, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> So, having these symbols enabled (provided the right ones for FA526 are
> also enabled) makes no difference.  So I don't buy your explanation.

The explanation is indeed false, CPU_FA526 and CPU_ARM920T get along just fine.
That's not where the problem is.

Panic goes away after removing CONFIG_ARM_THUMB=y.

I assume this is what should happen on processors without thumb?

Thanks,
Jonas
Russell King - ARM Linux Dec. 13, 2013, 11:39 a.m. UTC | #3
On Fri, Dec 13, 2013 at 11:51:09AM +0100, Jonas Jensen wrote:
> On 13 December 2013 10:56, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > So, having these symbols enabled (provided the right ones for FA526 are
> > also enabled) makes no difference.  So I don't buy your explanation.
> 
> The explanation is indeed false, CPU_FA526 and CPU_ARM920T get along just fine.
> That's not where the problem is.
> 
> Panic goes away after removing CONFIG_ARM_THUMB=y.
> 
> I assume this is what should happen on processors without thumb?

I see what's causing this: the kuser helpers are using "bx lr" to return
which will be undefined on non-Thumb CPUs.  We generally cope fine with
non-Thumb CPUs, conditionalising where necessary on HWCAP_THUMB or the
T bit in the PSR being set.

However, it looks like the kuser helpers got missed.  As a check, please
look at arch/arm/kernel/entry-armv.S, find the line with:

	.macro	usr_ret, reg

and ensure that the mov pc, \reg case always gets used.  Please report
back.

Thanks.
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b64a8ef..4f88ff3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -863,6 +863,11 @@  menu "Multiple platform selection"
 
 comment "CPU Core family selection"
 
+config ARCH_MULTI_V4
+	bool "ARMv4 based platforms (FA526, StrongARM)"
+	depends on !ARCH_MULTI_V6_V7
+	select ARCH_MULTI_V4_V5
+
 config ARCH_MULTI_V4T
 	bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
 	depends on !ARCH_MULTI_V6_V7