[PATCH] ARM: Allow SMP_ON_UP to work with Thumb-2 kernels.

Nicolas Pitre nicolas.pitre at linaro.org
Tue Nov 23 14:24:46 EST 2010


On Tue, 23 Nov 2010, Dave Martin wrote:

> On Mon, Nov 22, 2010 at 8:08 PM, Nicolas Pitre <nicolas.pitre at linaro.org> wrote:
> > Is the W() sufficient to indicate an ARM encoding?  To me it is meant to
> > specify a wide encoding when using Thumb2 encoding.  And if this is for
> 
> Your understanding is correct--- for most code we don't want to force
> an ARM encoding; it's just necessary to have a 32-bit encoding so that
> the instructions inserted by the fixup code will fit in, and also
> completely fill the gap.
> 
> I did have a previous implementation which inserted a 16-bit nop where
> necessary, but that was arguably messier.  The principle is the same.
> 
> > the kuser code segments (which should always be ARM mode by the way)
> > then this shouldn't make any difference.
> 
> It would be nice to be able to use W() in ARM state (in which case it
> should simply have no effect).  However, the .w suffix (generated by
> W()) is invalid syntax in traditional ARM assembler.

OK I get the point now.  I think this would be a good idea to stick a 
short comment above the definition of smp_dmb to indicate that the extra 
argument is needed only when forcing ARM mode encoding where the .w 
causes problems.

> Notwithstanding this, I'm very much open to suggestions about a better
> solution for this if anyone can think of any ideas.

I've been scratching my head for a while and couldn't come up with 
something better.

> > All you minimally need to support big endian here is to insert:
> >
> > #ifndef __ARMEB__
> > THUMB(  mov     r4, r4, ror #16 )
> > #endif
> >
> > just before the first store.
> 
> Cool, I'll add that.  (I assume you mean #ifdef, not #ifndef ?)

Indeed.


Nicolas


More information about the linux-arm-kernel mailing list