diff options
author | Michael Ellerman <[email protected]> | 2021-02-18 23:30:58 +1100 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2021-03-01 12:33:31 +1100 |
commit | eead089311f4d935ab5d1d8fbb0c42ad44699ada (patch) | |
tree | 168d406a4752ba18f369c32e5be0540d89e07885 /tools/perf/scripts/python/mem-phys-addr.py | |
parent | fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8 (diff) |
powerpc/4xx: Fix build errors from mfdcr()
lkp reported a build error in fsp2.o:
CC arch/powerpc/platforms/44x/fsp2.o
{standard input}:577: Error: unsupported relocation against base
Which comes from:
pr_err("GESR0: 0x%08x\n", mfdcr(base + PLB4OPB_GESR0));
Where our mfdcr() macro is stringifying "base + PLB4OPB_GESR0", and
passing that to the assembler, which obviously doesn't work.
The mfdcr() macro already checks that the argument is constant using
__builtin_constant_p(), and if not calls the out-of-line version of
mfdcr(). But in this case GCC is smart enough to notice that "base +
PLB4OPB_GESR0" will be constant, even though it's not something we can
immediately stringify into a register number.
Segher pointed out that passing the register number to the inline asm
as a constant would be better, and in fact it fixes the build error,
presumably because it gives GCC a chance to resolve the value.
While we're at it, change mtdcr() similarly.
Reported-by: kernel test robot <[email protected]>
Suggested-by: Segher Boessenkool <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Acked-by: Feng Tang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions