Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp939948pxb; Wed, 6 Apr 2022 04:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm0yvJICX/PrpjdzlfaZF1PbNhZMRQNBcf3tmhWiS0FZTUnH8D+ccFPVuoG1mkYmXgI7xq X-Received: by 2002:a17:902:aa46:b0:156:5651:1d55 with SMTP id c6-20020a170902aa4600b0015656511d55mr8491363plr.66.1649246047585; Wed, 06 Apr 2022 04:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246047; cv=none; d=google.com; s=arc-20160816; b=KJ8Hy0v9btCcswPAXUB7lWzZ6ceHIvpFce9QJ4z/7AnSWZrfB+jrjpS9g3mAAKkYRZ t8/gG95liePEFp426P8IKg+fxZoNV0gH0jPhq+Gz5d8Lpj0l8FoyuO0d8FZQVP1p+TCQ x2y/Td3lRwjG3uf9h2LmjLOAw7RNSuMWY2A1dcYiBJE88Zy3LUmWdl5y51XHnH/nYYSK Dw8zAVr4+gI/93YtzbL1J3aXm7uo+HQRaI9XhUgc/VhBhKiBp5qSaahIczAuPa9ZCxib EV+8QZsuZflU+gvdDOws1fUxv1dbvoJ2QEC0/fk8UAs+/ZLmcg74qstly3QxnxExLA/7 +OEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N2AIWRnMTpq1BDU77k0ljviHUAXVVcugpEdpOII6T00=; b=G20kmLC/sG/i9v5AGCNqvveoZK9NsQ4nHpwNAX22C+2vxfknzNhUXiF7kJp9HKkvib 7OtRM8ZqgSVhQxztkasPzrHoNgWI8+aew6+vYLX/nQyxcQ5DpIFOfReMVDPIFLnrZ+QL 4H3a7clYk4inRZcxgTfRGUkeydXnw/hmqa7uPUXVjfaFVEuvZvBPx+ikrYwlVW+ukXe5 eoxXbBINXFiH6xbM+K4hg4IVaiKeVbhGe0ihWER8e7lPrQOfD0zxKy+2xfP2+xIioWqN MHOYZZHVr8cNPLBD/6KPTqrvMPQvcTzkmGQQGEw620gJ+gLjLi8Va8Xsw5Szcw0vGi3P 1auw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cg9wTdHZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ms15-20020a17090b234f00b001cabfe71f79si4427104pjb.53.2022.04.06.04.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:54:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cg9wTdHZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65E113D2C6B; Wed, 6 Apr 2022 03:14:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379519AbiDEU23 (ORCPT + 99 others); Tue, 5 Apr 2022 16:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349150AbiDEJtO (ORCPT ); Tue, 5 Apr 2022 05:49:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B5F100F; Tue, 5 Apr 2022 02:41:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1F26DB818F3; Tue, 5 Apr 2022 09:41:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65D47C385A2; Tue, 5 Apr 2022 09:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151692; bh=O/rUeuX7WDYJ1f7A8mCRWZrYOcynNWYyRpGRWEx81Gk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cg9wTdHZOzFtbnAyP4ung+UHZnkpxiPCvqPipt4XSDoIANPPSfAlYoFWKIT/NKG9q N1O0HZqn7ZrAyTw9H3HHRXOkv7WIyui98eSfKT/LJYpTFKTJj3cO5jUcOlWUBPuxmr xR3p3JVUb/LUJsLkp3cPu+3e0S/LKBUYksAuuhec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 508/913] powerpc/Makefile: Dont pass -mcpu=powerpc64 when building 32-bit Date: Tue, 5 Apr 2022 09:26:10 +0200 Message-Id: <20220405070355.083572127@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ 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 Link: https://lore.kernel.org/r/20220215112858.304779-1-mpe@ellerman.id.au Signed-off-by: Sasha Levin --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.34.1