summaryrefslogtreecommitdiffstats
path: root/drivers/perf
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2022-02-15 22:28:58 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2022-03-01 23:51:04 +1100
commit2863dd2db23e0407f6c50b8ba5c0e55abef894f1 (patch)
tree5ab36a6b108dc83ec4747cf7bca28a2504246cab /drivers/perf
parent749ed4a20657bcea66a6e082ca3dc0d228cbec80 (diff)
downloadlinux-2863dd2db23e0407f6c50b8ba5c0e55abef894f1.tar.bz2
powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit
When CONFIG_GENERIC_CPU=y (true for all our defconfigs) we pass -mcpu=powerpc64 to the compiler, even when we're building a 32-bit kernel. This happens because we have an ifdef CONFIG_PPC_BOOK3S_64/else block in the Makefile that was written before 32-bit supported GENERIC_CPU. Prior to that the else block only applied to 64-bit Book3E. The GCC man page says -mcpu=powerpc64 "[specifies] a pure ... 64-bit big endian PowerPC ... architecture machine [type], with an appropriate, generic processor model assumed for scheduling purposes." It's unclear how that interacts with -m32, which we are also passing, although obviously -m32 is taking precedence in some sense, as the 32-bit kernel only contains 32-bit instructions. This was noticed by inspection, not via any bug reports, but it does affect code generation. Comparing before/after code generation, there are some changes to instruction scheduling, and the after case (with -mcpu=powerpc64 removed) the compiler seems more keen to use r8. Fix it by making the else case only apply to Book3E 64, which excludes 32-bit. Fixes: 0e00a8c9fd92 ("powerpc: Allow CPU selection also on PPC32") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220215112858.304779-1-mpe@ellerman.id.au
Diffstat (limited to 'drivers/perf')
0 files changed, 0 insertions, 0 deletions