Patchwork Sparc-32 doesn't work in 3.1.

login
register
mail settings
Submitter David Miller
Date Dec. 14, 2011, 6:18 p.m.
Message ID <20111214.131810.916491563666428853.davem@davemloft.net>
Download mbox | patch
Permalink /patch/131454/
State Accepted
Delegated to: David Miller
Headers show

Comments

David Miller - Dec. 14, 2011, 6:18 p.m.
From: David Miller <davem@davemloft.net>
Date: Wed, 14 Dec 2011 12:54:43 -0500 (EST)

> The right fix is to simply teach btfixup to be able to patch
> the 'restore' just as equally as it would patch an 'or'.

Try this:

--------------------
sparc32: Be less strict in matching %lo part of relocation.

The "(insn & 0x01800000) != 0x01800000" test matches 'restore'
but that is a legitimate place to see the %lo() part of a 32-bit
symbol relocation, particularly in tail calls.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/mm/btfixup.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Sergei Trofimovich - Dec. 14, 2011, 6:55 p.m.
> sparc32: Be less strict in matching %lo part of relocation.
> 
> The "(insn & 0x01800000) != 0x01800000" test matches 'restore'
> but that is a legitimate place to see the %lo() part of a 32-bit
> symbol relocation, particularly in tail calls.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>

Tested-by: Sergei Trofimovich <slyfox@gentoo.org>

Was about to send exactly the same. Thanks!
David Miller - Dec. 14, 2011, 7:13 p.m.
From: Sergei Trofimovich <slyich@gmail.com>
Date: Wed, 14 Dec 2011 21:55:16 +0300

>> sparc32: Be less strict in matching %lo part of relocation.
>> 
>> The "(insn & 0x01800000) != 0x01800000" test matches 'restore'
>> but that is a legitimate place to see the %lo() part of a 32-bit
>> symbol relocation, particularly in tail calls.
>> 
>> Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Tested-by: Sergei Trofimovich <slyfox@gentoo.org>
> 
> Was about to send exactly the same. Thanks!

Thanks for testing Sergei.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Landley - Dec. 14, 2011, 7:26 p.m.
On 12/14/2011 12:18 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 14 Dec 2011 12:54:43 -0500 (EST)
> 
>> The right fix is to simply teach btfixup to be able to patch
>> the 'restore' just as equally as it would patch an 'or'.
> 
> Try this:
> 
> --------------------
> sparc32: Be less strict in matching %lo part of relocation.

Yay!  With that patch, it booted to a shell prompt.

Thanks,

Rob
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Landley - Dec. 14, 2011, 7:27 p.m.
On 12/14/2011 01:13 PM, David Miller wrote:
> From: Sergei Trofimovich <slyich@gmail.com>
> Date: Wed, 14 Dec 2011 21:55:16 +0300
> 
>>> sparc32: Be less strict in matching %lo part of relocation.
>>>
>>> The "(insn & 0x01800000) != 0x01800000" test matches 'restore'
>>> but that is a legitimate place to see the %lo() part of a 32-bit
>>> symbol relocation, particularly in tail calls.
>>>
>>> Signed-off-by: David S. Miller <davem@davemloft.net>
>>
>> Tested-by: Sergei Trofimovich <slyfox@gentoo.org>
>>
>> Was about to send exactly the same. Thanks!
> 
> Thanks for testing Sergei.
> 

Is that the line we're using now?  I'm out of touch...

Tested-by: Rob Landley <rob@landley.net>

Rob
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c
index 5175ac2..8a7f817 100644
--- a/arch/sparc/mm/btfixup.c
+++ b/arch/sparc/mm/btfixup.c
@@ -302,8 +302,7 @@  void __init btfixup(void)
 				case 'i':	/* INT */
 					if ((insn & 0xc1c00000) == 0x01000000) /* %HI */
 						set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10));
-					else if ((insn & 0x80002000) == 0x80002000 &&
-					         (insn & 0x01800000) != 0x01800000) /* %LO */
+					else if ((insn & 0x80002000) == 0x80002000) /* %LO */
 						set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff));
 					else {
 						prom_printf(insn_i, p, addr, insn);