All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Always generate the IT instruction when compiling for Thumb-2
@ 2010-01-26 10:14 Catalin Marinas
  2010-01-27 22:02 ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2010-01-26 10:14 UTC (permalink / raw)
  To: linux-arm-kernel

Current behaviour is to generate the IT instruction only for Thumb-2
code. However, the kernel helpers in entry-armv.S are compiled to ARM in
a unified syntax file (if THUMB2_KERNEL). Recent compilers warn about
missing IT instruction in unified assembly syntax files. The patch
changes the "-mimplicit-it" gas option to "always".

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9e75825..356d702 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -94,7 +94,7 @@ CFLAGS_ABI	+=-funwind-tables
 endif
 
 ifeq ($(CONFIG_THUMB2_KERNEL),y)
-AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=thumb,-Wa$(comma)-mauto-it)
+AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
 AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
 CFLAGS_THUMB2	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
 AFLAGS_THUMB2	:=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb

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

* [PATCH] ARM: Always generate the IT instruction when compiling for Thumb-2
  2010-01-26 10:14 [PATCH] ARM: Always generate the IT instruction when compiling for Thumb-2 Catalin Marinas
@ 2010-01-27 22:02 ` Russell King - ARM Linux
  2010-01-28 13:05   ` [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2 Catalin Marinas
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-01-27 22:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 26, 2010 at 10:14:24AM +0000, Catalin Marinas wrote:
> Current behaviour is to generate the IT instruction only for Thumb-2
> code. However, the kernel helpers in entry-armv.S are compiled to ARM in
> a unified syntax file (if THUMB2_KERNEL). Recent compilers warn about
> missing IT instruction in unified assembly syntax files. The patch
> changes the "-mimplicit-it" gas option to "always".

Any downsides to this change?  Any assemblers not accepting "always"
instead of "thumb" ?

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

* [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2
  2010-01-27 22:02 ` Russell King - ARM Linux
@ 2010-01-28 13:05   ` Catalin Marinas
  2010-01-28 14:55     ` Jamie Lokier
  0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2010-01-28 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2010-01-27 at 22:02 +0000, Russell King - ARM Linux wrote:
> On Tue, Jan 26, 2010 at 10:14:24AM +0000, Catalin Marinas wrote:
> > Current behaviour is to generate the IT instruction only for Thumb-2
> > code. However, the kernel helpers in entry-armv.S are compiled to ARM in
> > a unified syntax file (if THUMB2_KERNEL). Recent compilers warn about
> > missing IT instruction in unified assembly syntax files. The patch
> > changes the "-mimplicit-it" gas option to "always".
> 
> Any downsides to this change?  Any assemblers not accepting "always"
> instead of "thumb" ?

When the -mimplicit-it was merged into mainline gas, it supported all of
thumb, arm, always and never. We still have the old -mauto-it but that's
I think only valid for the CodeSourcery toolchains.

-- 
Catalin

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

* [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2
  2010-01-28 13:05   ` [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2 Catalin Marinas
@ 2010-01-28 14:55     ` Jamie Lokier
  2010-01-28 15:50       ` Catalin Marinas
  0 siblings, 1 reply; 5+ messages in thread
From: Jamie Lokier @ 2010-01-28 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Catalin Marinas wrote:
> On Wed, 2010-01-27 at 22:02 +0000, Russell King - ARM Linux wrote:
> > On Tue, Jan 26, 2010 at 10:14:24AM +0000, Catalin Marinas wrote:
> > > Current behaviour is to generate the IT instruction only for Thumb-2
> > > code. However, the kernel helpers in entry-armv.S are compiled to ARM in
> > > a unified syntax file (if THUMB2_KERNEL). Recent compilers warn about
> > > missing IT instruction in unified assembly syntax files. The patch
> > > changes the "-mimplicit-it" gas option to "always".
> > 
> > Any downsides to this change?  Any assemblers not accepting "always"
> > instead of "thumb" ?
> 
> When the -mimplicit-it was merged into mainline gas, it supported all of
> thumb, arm, always and never. We still have the old -mauto-it but that's
> I think only valid for the CodeSourcery toolchains.

I notice there's a few "it" dotted around the kernel code now.  In
fact, that's how I learned about it - because I thought "that can't be
right when targetting ARM", and did some reading to learn otherwise.

With -mimplicit-it=always, they should not be needed.  So they can be
removed from the kernel source?

Or, if it's policy to put "it" in all the places needed, wouldn't
-mimplicit-it=arm (the gas default) be a better choice, to make sure
they are in all the places needed?

-- Jamie

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

* [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2
  2010-01-28 14:55     ` Jamie Lokier
@ 2010-01-28 15:50       ` Catalin Marinas
  0 siblings, 0 replies; 5+ messages in thread
From: Catalin Marinas @ 2010-01-28 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2010-01-28 at 14:55 +0000, Jamie Lokier wrote:
> Catalin Marinas wrote:
> > On Wed, 2010-01-27 at 22:02 +0000, Russell King - ARM Linux wrote:
> > > On Tue, Jan 26, 2010 at 10:14:24AM +0000, Catalin Marinas wrote:
> > > > Current behaviour is to generate the IT instruction only for Thumb-2
> > > > code. However, the kernel helpers in entry-armv.S are compiled to ARM in
> > > > a unified syntax file (if THUMB2_KERNEL). Recent compilers warn about
> > > > missing IT instruction in unified assembly syntax files. The patch
> > > > changes the "-mimplicit-it" gas option to "always".
> > >
> > > Any downsides to this change?  Any assemblers not accepting "always"
> > > instead of "thumb" ?
> >
> > When the -mimplicit-it was merged into mainline gas, it supported all of
> > thumb, arm, always and never. We still have the old -mauto-it but that's
> > I think only valid for the CodeSourcery toolchains.
> 
> I notice there's a few "it" dotted around the kernel code now.  In
> fact, that's how I learned about it - because I thought "that can't be
> right when targetting ARM", and did some reading to learn otherwise.
> 
> With -mimplicit-it=always, they should not be needed.  So they can be
> removed from the kernel source?
> 
> Or, if it's policy to put "it" in all the places needed, wouldn't
> -mimplicit-it=arm (the gas default) be a better choice, to make sure
> they are in all the places needed?

The original Thumb-2 patches were adding these IT instructions
explicitly (quite a lot). With compiler support for automatically
generating them, the kernel can avoid explicit IT in most cases with a
few exceptions.

For things like:

1:	LDRNE	...

gas generates:

1:	IT	NE
	LDRNE	...

since you are not allowed to branch in the middle of an IT block.

But if the label 1 is used for the exception table, it should point to
LDRNE rather than IT, so we have to write the code as below and manually
insert IT:

	IT	NE
1:	LDRNE	...

-- 
Catalin

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

end of thread, other threads:[~2010-01-28 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26 10:14 [PATCH] ARM: Always generate the IT instruction when compiling for Thumb-2 Catalin Marinas
2010-01-27 22:02 ` Russell King - ARM Linux
2010-01-28 13:05   ` [PATCH] ARM: Always generate the IT instruction when compilingfor Thumb-2 Catalin Marinas
2010-01-28 14:55     ` Jamie Lokier
2010-01-28 15:50       ` Catalin Marinas

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.