diff options
author | Paul Mackerras <paulus@samba.org> | 2010-05-06 15:46:50 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-21 03:31:08 -0400 |
commit | e62cee42e66dcca83aae02748535f62e0f564a0c (patch) | |
tree | 16cbe9c621aedd7b2c536a0c1f2fa90ae4eb9d2b | |
parent | abb17f9c3a92c5acf30e749efdf0419b7f50a5b8 (diff) |
powerpc: Avoid bad relocations in iSeries code
Subrata Modak reported that building a CONFIG_RELOCATABLE kernel with
CONFIG_ISERIES enabled gives the following warnings:
WARNING: 4 bad relocations
c00000000007216e R_PPC64_ADDR16_HIGHEST __ksymtab+0x00000000009dcec8
c000000000072172 R_PPC64_ADDR16_HIGHER __ksymtab+0x00000000009dcec8
c00000000007217a R_PPC64_ADDR16_HI __ksymtab+0x00000000009dcec8
c00000000007217e R_PPC64_ADDR16_LO __ksymtab+0x00000000009dcec8
The reason is that decrementer_iSeries_masked is using
LOAD_REG_IMMEDIATE to get the address of a kernel symbol, which
creates relocations that aren't handled by the kernel relocator code.
Instead of reading the tb_ticks_per_jiffy variable, we can just set
the decrementer to its maximum value (0x7fffffff) and that will work
just as well. In fact timer_interrupt sets the decrementer to that
value initially anyway, and we are sure to get into timer_interrupt
once interrupts are reenabled because we store 1 to the decrementer
interrupt flag in the lppaca (LPPACADECRINT(r12) here).
Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/iseries/exception.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S index fba5bf915073..32a56c6dfa72 100644 --- a/arch/powerpc/platforms/iseries/exception.S +++ b/arch/powerpc/platforms/iseries/exception.S | |||
@@ -252,8 +252,8 @@ decrementer_iSeries_masked: | |||
252 | li r11,1 | 252 | li r11,1 |
253 | ld r12,PACALPPACAPTR(r13) | 253 | ld r12,PACALPPACAPTR(r13) |
254 | stb r11,LPPACADECRINT(r12) | 254 | stb r11,LPPACADECRINT(r12) |
255 | LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy) | 255 | li r12,-1 |
256 | lwz r12,0(r12) | 256 | clrldi r12,r12,33 /* set DEC to 0x7fffffff */ |
257 | mtspr SPRN_DEC,r12 | 257 | mtspr SPRN_DEC,r12 |
258 | /* fall through */ | 258 | /* fall through */ |
259 | 259 | ||