android_kernel_motorola_sm6225/arch/powerpc
Michael Ellerman ce8bc23647 powerpc/4xx: Fix build errors from mfdcr()
[ Upstream commit eead089311f4d935ab5d1d8fbb0c42ad44699ada ]

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 <lkp@intel.com>
Suggested-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Feng Tang <feng.tang@intel.com>
Link: https://lore.kernel.org/r/20210218123058.748882-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:36:57 +02:00
..
boot powerpc/boot: Fix CONFIG_PPC_MPC52XX references 2020-08-19 08:15:00 +02:00
configs vgacon: remove software scrollback support 2020-09-17 13:45:29 +02:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include powerpc/4xx: Fix build errors from mfdcr() 2021-03-30 14:36:57 +02:00
kernel vmlinux.lds.h: Create section for protection against instrumentation 2021-03-24 11:07:31 +01:00
kvm KVM: PPC: Make the VMX instruction emulation routines static 2021-03-04 09:39:45 +01:00
lib powerpc/64s: flush L1D after user accesses 2020-11-22 10:02:26 +01:00
math-emu
mm powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm 2020-10-30 10:38:19 +01:00
net powerpc/bpf: Fix tail call implementation 2019-12-05 09:19:39 +01:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Record counter overflow always if SAMPLE_IP is unset 2021-03-17 16:43:46 +01:00
platforms powerpc/pseries/dlpar: handle ibm, configure-connector delay status 2021-03-04 09:39:47 +01:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() 2021-01-06 14:45:01 +01:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 19:12:42 +01:00
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:26:12 +01:00
Kconfig powerpc/47x: Disable 256k page size 2021-03-04 09:39:45 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile powerpc: Drop -me200 addition to build flags 2020-12-30 11:25:38 +01:00
Makefile.postlink