Patch "powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-makefile-don-t-pass-mcpu-powerpc64-when-buil.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d71160d39db7e5c803f59c543b434ce106c5070f
Author: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Date:   Tue Feb 15 22:28:58 2022 +1100

    powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit
    
    [ Upstream commit 2863dd2db23e0407f6c50b8ba5c0e55abef894f1 ]
    
    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@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220215112858.304779-1-mpe@xxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index aa6808e70647..72610e2d6176 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -173,7 +173,7 @@ else
 CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5))
 CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4)
 endif
-else
+else ifdef CONFIG_PPC_BOOK3E_64
 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
 endif
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux