[PATCH] ARM: let CPUs not being able to run in ARM mode enter in THUMB mode

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Jan 11 10:51:50 EST 2013

Hi Jonny,

On Fri, Jan 11, 2013 at 03:34:39PM +0000, Jonathan Austin wrote:
> Hi Uwe,
> On 11/01/13 11:39, Uwe Kleine-König wrote:
> >Some ARM cores are not capable to run in ARM mode (e.g. Cortex-M3). So
> >obviously these cannot enter the kernel in ARM mode. Make an exception
> >for them and let them enter in THUMB mode.
> Clearly something like this is necessary, but it isn't something I'd
> like for people to start using *unless* they have a THUMB only CPU
> (for example, to work around dodgy boot-loaders, etc)
> Seeing as there are no THUMB-only CPUs with an MMU, I think we could
> safely constrain this change to:
> a) depend on !MMU
> b) only touch head-nommu.S
> Does that cause any issue for what you're doing.
Would be ok for me, too. I don't care much.

> >diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> >index 3fd629d..bc3150c 100644
> >--- a/arch/arm/mm/Kconfig
> >+++ b/arch/arm/mm/Kconfig
> >@@ -1,5 +1,11 @@
> >  comment "Processor Type"
> >
> >+# Select this if your CPU doesn't support the 32 bit ARM instructions.
> >+config THUMBONLY_CPU
> >+	bool
> >+	select THUMB2_KERNEL
> >+	select ARM_THUMB
> >+
> >  # Select CPU types depending on the architecture selected.  This selects
> >  # which CPUs we support in the kernel image, and the compiler instruction
> >  # optimiser behaviour.
> Also, a couple of minor questions about this:
> - What's the rationale for the placement within the file - it looks
> a bit curious up the top there.
Conceptually it's a symbol that is selected by the different processor
symbols. So IMHO it's fine to have it in front of the processor symbols.
Maybe it should even go before the line reading:

	comment "Processor Type"

. OTOH similar symbols (like CPU_32v4, CPU_CP15) are at the end, too.
So yes, probably it's better to move it further down. And maybe rename

> - Given the fact that we don't want people using this except in very
> specific circumstances, should we write a little bit of help for the
> option?
I can move what I wrote in the comment above the symbol into a help text

Best regards

Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

More information about the linux-arm-kernel mailing list