• Paul Mackerras's avatar
    powerpc: Avoid bad relocations in iSeries code · e62cee42
    Paul Mackerras authored
    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: default avatarSubrata Modak <subrata@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    e62cee42
exception.S 8.29 KB