Thread (5 messages) flat view 5 messages, 3 authors, 2011-02-14
DORMANTno replies

Revision v4 of 3 in this series.

Revisions (3)
  1. v4 [diff vs current]
  2. v4 current
  3. v5 [diff vs current]

[PATCH v4 0/5] ARM: omap[34]: Thumb-2 compatibility fixes

From: Nicolas Pitre <hidden>
Date: 2011-02-14 20:10:18
Also in: linux-omap

Possibly related (same subject, not in this thread)

On Mon, 14 Feb 2011, Dave Martin wrote:
On Mon, Feb 14, 2011 at 10:00:23AM -0500, Nicolas Pitre wrote:
quoted
quoted
+#ifdef CONFIG_THUMB2_KERNEL
+	.align
+	bx	pc
+	nop
+	.arm
Also here, the .align has the potential to introduce a zero halfword in 
the instruction stream before the bx.  What about:

	adr	r3, 1f
	bx	r3
	.align
	.arm
1:	...
.align inserts a 16-bit nop when misaligned in Thumb in a text section,
Ah, OK then.  I didn't know about that. In ARM mode the all-zero bits 
decode to an instruction that sort of does nothing, but this isn't an 
eleguant nop, and that's what .align (used to?) insert as padding.
and a word-aligned bx pc is a specific architecturally allowed way
to do an inline switch to ARM.  The linker uses this trick for PLT
veneers etc.
Yep.  It's just that with my suggestion the bx wasn't necessarily 
aligned.
A nicer fix for doing this sort of call from low-level code which
might be ARM is to convert arch/arm/mm/*-v7.S to use "bx lr" to return.

Generally, we can do this for all arches >= v5, without any
incompatibility.  However, since the need for it will be rare and it
will generate patch noise for not much real benefit,
I haven't proposed this.
This can be done in those places where this might be needed without 
having to convert them all.


Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help