From patchwork Wed Apr 26 05:58:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=QPFVYq0D; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5p9x48gWz23vF for ; Wed, 26 Apr 2023 16:00:05 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5p9x36Klz3cjL for ; Wed, 26 Apr 2023 16:00:05 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=QPFVYq0D; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::432; helo=mail-pf1-x432.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=QPFVYq0D; dkim-atps=neutral Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8h2wZ1z3cBK for ; Wed, 26 Apr 2023 15:59:00 +1000 (AEST) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-63b67a26069so8666964b3a.0 for ; Tue, 25 Apr 2023 22:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488738; x=1685080738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WLtGq6eHOAM3DTVIPx6oJc5txbYmlmt0PPopdt1OT7Y=; b=QPFVYq0DON6qSyY2pdAMxQz5T6anCV285ukvPmLVhUMh1f9aILmgrNVu7XSVb+mIqq BYq31rZcOVENaqxmRzVZBxA0uU07tl/4Rx6z47JXEIKALSk7xEAIJgaJ9UtYw7RRmAV1 SnZT5wB4CCfdfZXAAg+CKC8iU6mXe2BRPCnjJxOftk6cSB2J03Jv60HSx8tN8aXXaKaY F8+GBssrp1GSwKtehyk1WmzoBDIwfXjGE/w5OFOrkWWE/QT/+0rP9mHBPauZE1tiZpUU QvUsZsxd333qBQRaaPpY8kdVFpDwF+gHU5wnMr0kZgTllAcQ4CiR7OYSUtiouEBKcwD9 xUTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488738; x=1685080738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WLtGq6eHOAM3DTVIPx6oJc5txbYmlmt0PPopdt1OT7Y=; b=dAhC/3FRNeDwDZGvxqNrYflSwtX75xdFrocHY4xMbd8ttMm9hqrntE87uYxGV6qYhC 8lDYtLJrj1xiKFgaQML0P+7s3bv/BTaaQtTYCwJwHbaS64bHTLN+J1urR8v2ez/VhrqY /3DM9hiiFhC9NygCO91m7pHRWAQT5zqPN6sr2oIkUKCtB6tumZwEbzydXCrr8oZdZAzN gVvKuaAhi0q0GlIrifJ/Ll98oKJttwsx6/7TbyXG/xUklRhByMvdpEujbMivboetj2I0 x2wsBHLRbJcwC9GZrEKXgKVAKRHOfLCo+mhBl/ySTDZZYomuOypo9bDZztmITlKnlp9D fOyQ== X-Gm-Message-State: AAQBX9dAYEv19fHap9hnFr1yBqCpRBDzIVkZGn9eabVBh9NGiAl3sOeR EZ5Bli5yilFpfwTgaukrQMJ/ScxdIvRxLQ== X-Google-Smtp-Source: AKy350Yq4iAGbjwcurKUmO1g1n/wx+i3li+ZxwH9UqjP0pzKJOkhPbvod3TXiTFcLKlYYNUNa/vCNQ== X-Received: by 2002:a05:6a00:cd3:b0:627:f1f1:a97d with SMTP id b19-20020a056a000cd300b00627f1f1a97dmr27307537pfv.24.1682488737867; Tue, 25 Apr 2023 22:58:57 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:58:57 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/9] powerpc: Fix merge conflict between pcrel and copy_thread changes Date: Wed, 26 Apr 2023 15:58:38 +1000 Message-Id: <20230426055848.402993-2-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Fix a conflict between commit 4e991e3c16a35 ("powerpc: add CFUNC assembly label annotation") and commit b504b6aade040 ("powerpc: differentiate kthread from user kernel thread start"). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/interrupt_64.S b/arch/powerpc/kernel/interrupt_64.S index 6730d676284c..bd863702d812 100644 --- a/arch/powerpc/kernel/interrupt_64.S +++ b/arch/powerpc/kernel/interrupt_64.S @@ -756,7 +756,7 @@ _GLOBAL(ret_from_kernel_user_thread) b .Lsyscall_exit _GLOBAL(start_kernel_thread) - bl schedule_tail + bl CFUNC(schedule_tail) mtctr r14 mr r3,r15 #ifdef CONFIG_PPC64_ELF_ABI_V2 From patchwork Wed Apr 26 05:58:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=ItAx6qP7; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pBx4VdGz23vF for ; Wed, 26 Apr 2023 16:00:57 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pBv5Sttz3f8B for ; Wed, 26 Apr 2023 16:00:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=ItAx6qP7; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::429; helo=mail-pf1-x429.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=ItAx6qP7; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8k68JYz3cF8 for ; Wed, 26 Apr 2023 15:59:02 +1000 (AEST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-63b35789313so4856786b3a.3 for ; Tue, 25 Apr 2023 22:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488740; x=1685080740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fuyxNALPej8sJTQ1TenoUjVJzKsIrDxX3tSD5Kst8qU=; b=ItAx6qP7J/79PAof4jDx4YFB1fd3cP3KxfZuvpV1U++3FjiZ+zEyvqPyjZmD8mRnsw NuV8PKP26JW2lF4WduaDnmiWGUlsqovfgiey3taFqb80dHICqvK/p8v0XuU1xlc8IbHZ PCdJhgi+ZfLF7RfBBOnCy0jyNHAWYSKA3E1v2L7VB+Zi4Ti212ZGSHwb5IB1AEhi9f5a cbQKCGhl82Ui5A/ig1yPOOwTY3LZGGPHnGxOkgRgMQ5bIZwVZeC9nUuCJogMdtxTr9Dr x5Ppy7hK94UKe5L5bJFYEw+D06H0HHyk6qMd1O7lVO7oq+dy9b9tjPyiKf5BUrDr1zlH sE/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488740; x=1685080740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fuyxNALPej8sJTQ1TenoUjVJzKsIrDxX3tSD5Kst8qU=; b=FhuoPbdFjuEIAHOAJmMBbokP8VUIkZ/EK3+ytdnow0fWZ6hYVRZV6mFyk33yJBNFPW MtYEfLEe3f4w6dBRdfl4N7IHcHVN9Xcl2KMooB5Qf3w10LOuu0kJo3OAHI2bPXFv+qkm eF3JQtKFlYu0CLptUpb8135ZdKQrBZZ7fhjiiuLp+hYNfRVozEV0nrt1m77G/nVu/+DR YpygxOVnFl9GrdYyH6HnFRDXUSrLc2W1VH9zTOMGzwnk6q+WcnvuApOTisnG91+9TWcP kkmXU6cImFbxFQc739qzbPxwdEaYGf3JcUPee3RXdedpGtitxZ8dBRjEHR2fqvucau93 08QA== X-Gm-Message-State: AAQBX9eQYQTLD86EB1ryn8qiU0mYmhmXtMAVpbDdICc6Yly2CjgPWbdR iIpOn2hpVRoN5aIg9vszoiLLkFmCexYC0w== X-Google-Smtp-Source: AKy350Z3m5OvWbGRs59ey6377RrOthRObuvCnFBxOX0Ujuve1SA6/42x1aHJbDEfYWOa8FREe+//Ug== X-Received: by 2002:a05:6a00:17a9:b0:63d:489c:971 with SMTP id s41-20020a056a0017a900b0063d489c0971mr28963240pfg.24.1682488740248; Tue, 25 Apr 2023 22:59:00 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:58:59 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/9] powerpc/64s: Disable pcrel code model on Clang Date: Wed, 26 Apr 2023 15:58:39 +1000 Message-Id: <20230426055848.402993-3-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Clang has a bug that casues the pcrel code model not to be used when any of -msoft-float, -mno-altivec, or -mno-vsx are set. Leaving these off causes FP/vector instructions to be generated, causing crashes. So disable pcrel for clang for now. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 7a0f25a09759..261e9453b43c 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -8,7 +8,12 @@ config CC_HAS_PREFIXED def_bool PPC64 && $(cc-option, -mcpu=power10 -mprefixed) config CC_HAS_PCREL - def_bool PPC64 && $(cc-option, -mcpu=power10 -mpcrel) + # Clang has a bug (https://github.com/llvm/llvm-project/issues/62372) + # where pcrel code is not generated if -msoft-float, -mno-altivec, or + # -mno-vsx options are also given. Without these options, fp/vec + # instructions are generated from regular kernel code. So Clang can't + # do pcrel yet. + def_bool PPC64 && CC_IS_GCC && $(cc-option, -mcpu=power10 -mpcrel) config 32BIT bool From patchwork Wed Apr 26 05:58:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=bswwayG2; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pD0193jz23vF for ; Wed, 26 Apr 2023 16:01:52 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pD006YHz3fVZ for ; Wed, 26 Apr 2023 16:01:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=bswwayG2; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::429; helo=mail-pf1-x429.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=bswwayG2; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8n0Ysyz3cMT for ; Wed, 26 Apr 2023 15:59:04 +1000 (AEST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-63f273b219eso3204114b3a.1 for ; Tue, 25 Apr 2023 22:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488743; x=1685080743; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7zo1/yjNOfcKqwxbQM0yUPB1HZeUxs37U5d31WFHyGc=; b=bswwayG2Y/c38JHEuBRJx/I60bLI6llQuyH1paR0NYWW5qhPBw1JOND166Zqoi8jd/ e4Zzne3DCNZqzbd+tYE/xweokcPYBGXNier52TOsBoADKi2GpeBdJzfRMsylFJSRhF9f g3wAD3VMofN3f1onqeLkNmi9XP9zBwO5BTfPYj+ud90tlTto8sqvfX77fC7KbSxW1kAE g/TIYVL9R87SHUAwHiMYiuy/m45bciAM8njYFhSCuUQd6mhX2UVjSNauOf1PbhQ4T9le 1ZLPKcQUoVtpnicnRkFABr7aGM73TMoV1iJCfXZ0j2zzkkWZgojeHzpweXvA65UkM5wy q/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488743; x=1685080743; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7zo1/yjNOfcKqwxbQM0yUPB1HZeUxs37U5d31WFHyGc=; b=aX4q/E4fiTDO+jRdJw9/DkiwVPATqquh4osOrwkVe+31zcAYwWautG8x85Q/Wbz6AI sI43SlyK+bdPn3TBklnLKnlVgFXuVwAQDomabg4cyQKYvyHWWJ4HYCrTv349FgGDlG3u UBjxKUe4vA3cBHwQoIhxg5zS4JKBHc+NYNkQ0HwpizwOedFyWZmYajxG6NWUycqyLITL 5SbwyxBgDorCAhJzO5aIOfsDIqRGire+lAK4PqGOMtvmPtC3OcQAvG/C9daTZV6/hX8O oUHWjW/VrtR1p7yds4/dn7pPAyqR0pvZz8R4QUpLurVIHJ0fQ4fV8NsAZxPZQFuJBzrp O7bA== X-Gm-Message-State: AAQBX9c+wqJe5Q+K6hDW30sTnRvemlDUfhu25K0I+bypEQOHm1UDoFnr 4dH6HHnF2hA+vOgATLWJ0QLCTtj0XKzSDw== X-Google-Smtp-Source: AKy350YZrmWYhqyX3AY5HJBwwTNVekoApqk/ULJZ83OR4dQU1x8v9Gc8cloFDKCtRBwEmC5XmhH3Zw== X-Received: by 2002:a05:6a00:1408:b0:63d:3339:e967 with SMTP id l8-20020a056a00140800b0063d3339e967mr24343671pfu.19.1682488742704; Tue, 25 Apr 2023 22:59:02 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:02 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 3/9] powerpc/boot: Seperate target flags from BOOTCFLAGS Date: Wed, 26 Apr 2023 15:58:40 +1000 Message-Id: <20230426055848.402993-4-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add BOOTTARGETFLAGS variable with target / ABI options common to CFLAGS and AFLAGS. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/Makefile | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 85cde5bf04b7..84a5b630c739 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -41,36 +41,48 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ $(LINUXINCLUDE) ifdef CONFIG_PPC64_BOOT_WRAPPER -BOOTCFLAGS += -m64 +BOOTTARGETFLAGS := -m64 ifdef CONFIG_PPC64_ELF_ABI_V2 -BOOTCFLAGS += $(call cc-option,-mabi=elfv2) +BOOTTARGETFLAGS += $(call cc-option,-mabi=elfv2) endif else -BOOTCFLAGS += -m32 +BOOTTARGETFLAGS := -m32 endif ifdef CONFIG_TARGET_CPU_BOOL -BOOTCFLAGS += -mcpu=$(CONFIG_TARGET_CPU) +BOOTTARGETFLAGS += -mcpu=$(CONFIG_TARGET_CPU) else ifdef CONFIG_PPC64_BOOT_WRAPPER ifdef CONFIG_CPU_LITTLE_ENDIAN -BOOTCFLAGS += -mcpu=powerpc64le +BOOTTARGETFLAGS += -mcpu=powerpc64le else -BOOTCFLAGS += -mcpu=powerpc64 +BOOTTARGETFLAGS += -mcpu=powerpc64 endif endif +$(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405 +$(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440 +$(obj)/cuboot-hotfoot.o: BOOTTARGETFLAGS += -mcpu=405 +$(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440 +$(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440 +$(obj)/cuboot-acadia.o: BOOTTARGETFLAGS += -mcpu=405 +$(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405 +$(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405 +$(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405 + BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) ifdef CONFIG_CPU_BIG_ENDIAN -BOOTCFLAGS += -mbig-endian +BOOTTARGETFLAGS += -mbig-endian else -BOOTCFLAGS += -mlittle-endian +BOOTTARGETFLAGS += -mlittle-endian endif -BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc +BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) $(BOOTCFLAGS) -nostdinc BOOTARFLAGS := -crD +BOOTCFLAGS += $(BOOTTARGETFLAGS) + ifdef CONFIG_CC_IS_CLANG BOOTCFLAGS += $(CLANG_FLAGS) BOOTAFLAGS += $(CLANG_FLAGS) @@ -89,16 +101,6 @@ BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) DTC_FLAGS ?= -p 1024 -$(obj)/4xx.o: BOOTCFLAGS += -mcpu=405 -$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 -$(obj)/cuboot-hotfoot.o: BOOTCFLAGS += -mcpu=405 -$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440 -$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440 -$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405 -$(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405 -$(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405 -$(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=405 - # The pre-boot decompressors pull in a lot of kernel headers and other source # files. This creates a bit of a dependency headache since we need to copy # these files into the build dir, fix up any includes and ensure that dependent From patchwork Wed Apr 26 05:58:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=cQk9NUL7; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pF35B02z23vF for ; Wed, 26 Apr 2023 16:02:47 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pF32p1Wz3f88 for ; Wed, 26 Apr 2023 16:02:47 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=cQk9NUL7; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42e; helo=mail-pf1-x42e.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=cQk9NUL7; dkim-atps=neutral Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8q4Kmtz3cdj for ; Wed, 26 Apr 2023 15:59:07 +1000 (AEST) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-63b7096e2e4so5564656b3a.2 for ; Tue, 25 Apr 2023 22:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488745; x=1685080745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QUY2W+QV+3Sa9ryYHFPiF5vcCLQo2iN6UCM1NmViHb8=; b=cQk9NUL75STQb2ICpYeSz4arpeK4i/qfrzQWolhRVk4j+rzZQ/OlD/c0UrAjD45xzr Xhi+ahlUPCdnQTGb/Xo3UX0SMGkK2nrInktalw5JMBv2VBCUVPzVsKPd7aDTVsVm3bBb piFKNDfhXLk9Aml8OhiHua+xikmvLC8sXFMtBKIvlpFKu78Kwv5E8pKIYX093xdzet5c H5vQW0MEdaODQhd//2vCxBwim5qodLwvW+nnX88Z8kO5fHhcuw8FiB1aKm4wc9Nlqryq vUGy62ZXIg4DPeYFl9P309WdExX/1D7sMphltlqG106gY4wUEZEpncNO1yASv560hwb1 0maw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488745; x=1685080745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QUY2W+QV+3Sa9ryYHFPiF5vcCLQo2iN6UCM1NmViHb8=; b=TJZXkcIn23cDt3utjSdOUCQ3OX2w8jGvrYlQk/h93+jGod42z2SKQOqDWPS3pDWcTz iHiS1cEnGn/NkNgJdwSSlpTw6al7UyP2aPnjIt8ts6zfcs+v9F+GdY9VwvdvOcNPN9L8 2rmsB4ao56OhapnNM1ShuN9IXviHpyGu35ABWo3sIhFl00hO/eawBJYOA4Pgn8rjbFoL H/UbQMb9+qqWGc+aH76gY3RUzaVPOBFsTavIpQKAFnUINUPbiz8EpO3q46POUpWLpGRb ZxyTB8mhVLFowjLzuFguM4gtIzA10DzVbf/UmeGDLuTpUdDh1jMKSTVGcfcTxxqqPSlm JXeA== X-Gm-Message-State: AAQBX9fd8h9MHypHBOCRcBGK6PJghkAKbBLBUN4VtdwL62Vz7OlSHfPB cQOALj6iqgq1NFnsXn+a7qYOZVwsQ6nkzg== X-Google-Smtp-Source: AKy350bO6VULi9oAyldNNJKij0nqmobECj2Qd7VVwaYdcckkRYdiBKuE10GsRrkkPJXbxfSaHF4LgQ== X-Received: by 2002:a05:6a00:2193:b0:62a:63e6:3282 with SMTP id h19-20020a056a00219300b0062a63e63282mr25079037pfi.11.1682488745056; Tue, 25 Apr 2023 22:59:05 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:04 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 4/9] powerpc/boot: Seperate CPP flags from BOOTCFLAGS Date: Wed, 26 Apr 2023 15:58:41 +1000 Message-Id: <20230426055848.402993-5-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add BOOTCPPFLAGS variable for the CPP options required by C and AS. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 84a5b630c739..bfeb7a9fef9c 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -32,13 +32,15 @@ else BOOTAR := $(AR) endif +BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) +BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) + BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ $(call cc-option,-mno-prefixed) $(call cc-option,-mno-pcrel) \ $(call cc-option,-mno-mma) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ - -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ - $(LINUXINCLUDE) + -pipe -fomit-frame-pointer -fno-builtin -fPIC ifdef CONFIG_PPC64_BOOT_WRAPPER BOOTTARGETFLAGS := -m64 @@ -69,15 +71,13 @@ $(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405 $(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405 $(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405 -BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) - ifdef CONFIG_CPU_BIG_ENDIAN BOOTTARGETFLAGS += -mbig-endian else BOOTTARGETFLAGS += -mlittle-endian endif -BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) $(BOOTCFLAGS) -nostdinc +BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) $(BOOTCFLAGS) BOOTARFLAGS := -crD @@ -224,10 +224,10 @@ clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \ empty.c zImage.coff.lds zImage.ps3.lds zImage.lds quiet_cmd_bootcc = BOOTCC $@ - cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< + cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCPPFLAGS) $(BOOTCFLAGS) -c -o $@ $< quiet_cmd_bootas = BOOTAS $@ - cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< + cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCPPFLAGS) $(BOOTAFLAGS) -c -o $@ $< quiet_cmd_bootar = BOOTAR $@ cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(real-prereqs); mv $@.$$$$ $@ From patchwork Wed Apr 26 05:58:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WMn+Fluq; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pFz6tsMz23vF for ; Wed, 26 Apr 2023 16:03:35 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pFz5rqCz3fcZ for ; Wed, 26 Apr 2023 16:03:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WMn+Fluq; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::52f; helo=mail-pg1-x52f.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WMn+Fluq; dkim-atps=neutral Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8t4Fb0z3cdX for ; Wed, 26 Apr 2023 15:59:10 +1000 (AEST) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so6269741a12.1 for ; Tue, 25 Apr 2023 22:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488748; x=1685080748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iy39fLjmbx+My1HIdfMmUL3RPnN1+OhXAGLfbeZPBRY=; b=WMn+FluqFHbt/t+2GPj1cHEG9zHobsmdjHGCPQ0fNqw0MvKTYveXn6+/rzBDY3IPEb QbUxUKvAt9XeGgBFxtAocmphlYB/reSr/6rzFZxXWXDNyIex8JwN/nSQmDZ11SEftgyx EMWYXd7fl1UfZT7lgERtmVjY4XFU1ytOgshJB9NJRRaF9thQyI5ELvU0WtOm0QwykexH ZI1dYn0KZIZMVgUsiE0d3vheAOXm0yvUCszu1KFzSJ6pyN31SYVR4YqRScawGlY/mIUX Dq2lR9uZtifd9hKFcQTenk8uMr9SXueq+r0Lk2DCgUMlNo/YZqaot84QyoyplyDTsbql FkzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488748; x=1685080748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iy39fLjmbx+My1HIdfMmUL3RPnN1+OhXAGLfbeZPBRY=; b=IP87DkS7ShhCYMcXcxjZde9jIKYM+0jIZOdsTLsBFgCgCZn43CLUs7ir9CRfgWweDl A1yjbKX8ntzb2T7q0fK/iNdkWTGQbaBUAf6byXy3sAcG8x2VWzx+lg0PC2bK1T/cfWBd 826nyGv4w9O9EqG5Iu1Tg4N5NGMBGxt4RtSXEJ9/pIL6sxYF7E3DOTv+xs5EUSmAa/lX ouzD37Zs+i2gu/+Wft+zjrVCns0IRiOgmvfQFAMIjAVLn/8FO4x+i+07+Wx7Tp5Tvxxp Y3rTBt2CmNY2eFSxIVk2j3G+Yc0B2cflyzgB9CsJHlLChpKaNni0pffKnLVtPFbZTvR1 QSfA== X-Gm-Message-State: AAQBX9cT+oRYfPLQoO3I2jrO+SScm2EZRxSQ7rlNYwWFPzUj0cy7FKin w3jiinZyQknfq9rmJkgqFiCjQRSq+fpPrw== X-Google-Smtp-Source: AKy350b7dHDbXIl6vvtovBg89tp42UrYcVMmBhUwviLTiBID8TU029o1FDb7UCpiA/6qVFsbtO+ptA== X-Received: by 2002:a05:6a20:ab98:b0:f0:ac6b:379f with SMTP id da24-20020a056a20ab9800b000f0ac6b379fmr20471344pzb.15.1682488747697; Tue, 25 Apr 2023 22:59:07 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:07 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 5/9] powerpc/boot: Separate BOOTCFLAGS from BOOTASFLAGS Date: Wed, 26 Apr 2023 15:58:42 +1000 Message-Id: <20230426055848.402993-6-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Torvalds , Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" BOOTCFLAGS no longer contains anything that BOOTASFLAGS needs (except -pipe). Separate them to avoid fragility with cross-contamination of flags which has caused several build problems. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/lkml/CAHk-=whyWUdJDeOBN1hRWYSkQkvzYiQ5RbSW5rJjExgnbSNX9Q@mail.gmail.com/ Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index bfeb7a9fef9c..99f56c94177f 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -77,7 +77,7 @@ else BOOTTARGETFLAGS += -mlittle-endian endif -BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) $(BOOTCFLAGS) +BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) -pipe BOOTARFLAGS := -crD From patchwork Wed Apr 26 05:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=IwsYIVak; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pGw5zG5z23vF for ; Wed, 26 Apr 2023 16:04:24 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pGw1w19z3fhq for ; Wed, 26 Apr 2023 16:04:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=IwsYIVak; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::432; helo=mail-pf1-x432.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=IwsYIVak; dkim-atps=neutral Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p8w3qxlz3cV7 for ; Wed, 26 Apr 2023 15:59:12 +1000 (AEST) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-63b620188aeso7970645b3a.0 for ; Tue, 25 Apr 2023 22:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488750; x=1685080750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TF2USIIBgsH0+cckxZfNEtqITyGwjtzqR/Gieyn3Mts=; b=IwsYIVakKdfgGZMAsbDXLSsHz/o+E1kq7+rCGuNXma+L0oiCX89QPBeOMW5K0p2N/E SSTeO1wq00LRnzHM/bQOddrHSkCbbIe7wYVItlkeHg/3Baf5eomgTRlAw6RO5TN6ycoc KksJyVpA66gtzP6OaYxRVomKRld1XLGZIMmhslXatD8WGvfkGoAOrrEQB0YIukGk7cxq dFLJKT6al53GurKjScus3mMeKRUctOly9kx60g8qmTEYUGEdI476A1lJ4LZhHW7bAJZJ s0BaoSLQ14cRSmPk+aF/c2ZLNxjVzDaML7Kd74ke5smd9TDbQc7eo1ZJhJDXkXqRmiIX ghJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488750; x=1685080750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TF2USIIBgsH0+cckxZfNEtqITyGwjtzqR/Gieyn3Mts=; b=LSvm7wDU7poaL/2VFfNcqqezTQxMiDpfU7sLjPY92zz4/U9kdOtChSskMNoYWY56OR RMuAEzBjeGREOFnVtEzA0PJeoru1m+FJDJqGhew4W+vS1IQKawn0iJXqYU2mowzCDJq9 qXH3s9heN6KYViTE0il+XuwskXgEus/pDphKzQuP639d3HVUoyu+LKcbwC16LV9bSfMT JzM2BQDt0lDzsWsChMocEwYsNLmiUe6txvCfwCqxbrYAOzugJi390H63FbMJKNB9LTQi TfvVBDUkhJHEHoirhV43dbNxARCCD3At4Km4Bac+05P0h8aPxVcIOMCiBHrH7nkg1wIj i47Q== X-Gm-Message-State: AAQBX9e2TYAiXxIoEk//ZX7XR8WpbfYzWFur07y1fblIlX3pnROuHDkL ihnwb3A1Qgj/Qxo1dZ3FDPJSprvpYq31dg== X-Google-Smtp-Source: AKy350b4NtjHL7ejTYgkVOySM3QPlGsMK9xBxM60u7Fsx+szLY+nN8TRZXJNpdJJ6qjWb3mmM9kYhQ== X-Received: by 2002:a05:6a00:23d2:b0:62a:c1fa:b253 with SMTP id g18-20020a056a0023d200b0062ac1fab253mr26718432pfc.31.1682488750361; Tue, 25 Apr 2023 22:59:10 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:09 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 6/9] powerpc/boot: Clean up Makefile after cflags and asflags separation Date: Wed, 26 Apr 2023 15:58:43 +1000 Message-Id: <20230426055848.402993-7-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Tidy pass over boot Makefile. Move variables together where possible. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/Makefile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 99f56c94177f..0982a7025e66 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -32,16 +32,6 @@ else BOOTAR := $(AR) endif -BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) -BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) - -BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ - $(call cc-option,-mno-prefixed) $(call cc-option,-mno-pcrel) \ - $(call cc-option,-mno-mma) \ - $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ - -pipe -fomit-frame-pointer -fno-builtin -fPIC - ifdef CONFIG_PPC64_BOOT_WRAPPER BOOTTARGETFLAGS := -m64 ifdef CONFIG_PPC64_ELF_ABI_V2 @@ -77,11 +67,21 @@ else BOOTTARGETFLAGS += -mlittle-endian endif -BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTTARGETFLAGS) -pipe +BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) +BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) -BOOTARFLAGS := -crD +BOOTCFLAGS := -pipe $(BOOTTARGETFLAGS) \ + -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ + $(call cc-option,-mno-prefixed) \ + $(call cc-option,-mno-pcrel) \ + $(call cc-option,-mno-mma) \ + $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ + -fomit-frame-pointer -fno-builtin -fPIC -BOOTCFLAGS += $(BOOTTARGETFLAGS) +BOOTAFLAGS := -pipe $(BOOTTARGETFLAGS) -D__ASSEMBLY__ + +BOOTARFLAGS := -crD ifdef CONFIG_CC_IS_CLANG BOOTCFLAGS += $(CLANG_FLAGS) From patchwork Wed Apr 26 05:58:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=dZpYYgZe; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pK61G8bz23v8 for ; Wed, 26 Apr 2023 16:06:17 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pK54YwZz3fr1 for ; Wed, 26 Apr 2023 16:06:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=dZpYYgZe; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42f; helo=mail-pf1-x42f.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=dZpYYgZe; dkim-atps=neutral Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p914HsKz3cgT for ; Wed, 26 Apr 2023 15:59:17 +1000 (AEST) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-63b73203e0aso40605435b3a.1 for ; Tue, 25 Apr 2023 22:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488755; x=1685080755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X2Bt/1IFIqoALumDKTJ/iLodSHOQClI8w+LLk56vjhU=; b=dZpYYgZebJdBd6Qpz7t4EX7ItHs2D4O/lWigNF4maIoUXzbuc3EAjFwOIJeHhhPonj 602yAXirDB/GzfiNjIgmdHt58ro2amINtayHSZ2mSnSo3hVzYI3gSXF/5PBx/M8qP4o9 OtALOd3f20AIk9T7o6LzcXWkTHrz7ZPJcMch2LN+FyDg/6hzwX/K/dIZQKTM2KoQFNvQ 5f44NlgR/gjaqQtBaDDdqijMWK1iPsLwvan7HW3wHrxW3llSswe78MyuYSdRM+eXO9nZ LoAa2yjNeQBdRQLxNIWWWt7fCjU+duXBwASJ3e3w0QeuE1T2kP3rVPP4OcuFPmbdfpxL KtuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488755; x=1685080755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X2Bt/1IFIqoALumDKTJ/iLodSHOQClI8w+LLk56vjhU=; b=VfaSJ/27OVAs/B8puxZTbfAa+vBz0AUWBCIfk5RhbHsFKiVLpccFSbUGaAd7xbrgG5 eEgYvKQFJENP6MgdhXD57wqztWqXWEWmhKG6sazFTq+Gwn3G2Jy2o/gy6+kRnqKHj/78 gLVZgik39ZImWnktnb2+eZbfvso5pQXNwhCbbqXlaryFF+rAERMEBPUSStsdmlPMH5Gi qZZGXG56OdW38j3Xf/ycMGkIJ1p5xgGRV6WWOzSe/H021oHCbfnt3Zrg0X5jlp+txwxB 52AvmgAjnl50IKWzmGQzVUWg+8j1LJKvkiXYhihak/S2mfvoXUzLVHU8wRKlUXKwTR/X FL8A== X-Gm-Message-State: AC+VfDxeMoroV2EKEEVt7TKjVSrZO0AmNt400Inn6jAmr45rBJQrvOD+ 4pcXp9wEHA328UXLwbhKAllU+d3OTmajlA== X-Google-Smtp-Source: ACHHUZ7lL9BsN4eDKNOk/N0mOFt9rcZW0vsSPU8KhdS4vfd63jDv5J7a5Jh52cI1vtusOqoRO0XPQQ== X-Received: by 2002:a05:6a21:339a:b0:f0:4a5e:b686 with SMTP id yy26-20020a056a21339a00b000f04a5eb686mr1379166pzb.29.1682488754799; Tue, 25 Apr 2023 22:59:14 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:14 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 7/9] powerpc/build: Remove -pipe from compilation flags Date: Wed, 26 Apr 2023 15:58:45 +1000 Message-Id: <20230426055848.402993-9-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" x86 removed -pipe in commit 437e88ab8f9e2 ("x86/build: Remove -pipe from KBUILD_CFLAGS") and the newer arm64 and riscv seem to have never used it, so that seems to be the way the world's going. Compile performance building defconfig on a POWER10 PowerNV system was in the noise after 10 builds each. No point in adding options unless they help something, so remove it. Signed-off-by: Nicholas Piggin --- arch/powerpc/Makefile | 2 +- arch/powerpc/boot/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index dca73f673d70..76fc7cc26780 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -166,7 +166,7 @@ asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) KBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr) KBUILD_AFLAGS += $(AFLAGS-y) KBUILD_CFLAGS += $(call cc-option,-msoft-float) -KBUILD_CFLAGS += -pipe $(CFLAGS-y) +KBUILD_CFLAGS += $(CFLAGS-y) CPP = $(CC) -E $(KBUILD_CFLAGS) CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__ diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 0982a7025e66..1c9951153bae 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -70,7 +70,7 @@ endif BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) -BOOTCFLAGS := -pipe $(BOOTTARGETFLAGS) \ +BOOTCFLAGS := $(BOOTTARGETFLAGS) \ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ $(call cc-option,-mno-prefixed) \ @@ -79,7 +79,7 @@ BOOTCFLAGS := -pipe $(BOOTTARGETFLAGS) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -fomit-frame-pointer -fno-builtin -fPIC -BOOTAFLAGS := -pipe $(BOOTTARGETFLAGS) -D__ASSEMBLY__ +BOOTAFLAGS := $(BOOTTARGETFLAGS) -D__ASSEMBLY__ BOOTARFLAGS := -crD From patchwork Wed Apr 26 05:58:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WXq7seaE; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pL34k4xz23v8 for ; Wed, 26 Apr 2023 16:07:07 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pL332sZz3fvb for ; Wed, 26 Apr 2023 16:07:07 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WXq7seaE; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::433; helo=mail-pf1-x433.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=WXq7seaE; dkim-atps=neutral Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p940dB2z3cd2 for ; Wed, 26 Apr 2023 15:59:19 +1000 (AEST) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-63b4960b015so5336875b3a.3 for ; Tue, 25 Apr 2023 22:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488757; x=1685080757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=guOOCtAiG93AJjpXU8UVj1OOgNFx9rEDxCoI9XZCYZs=; b=WXq7seaErLicN4G2BnNY4Dr8U8b4qbQvZJtsyESuYDrcFAT0pX0o+IG9MiTjnZDlXo Ho19CdzrW7LBqEocwxSprMO/IVbH7gJD3mePWqMK5seQsPWv+N140bNp048u+PsW8ysd M/Rb/aPykypr4i4E/mPtqJDwPrUN5yFxJnvJ6jq0vvmi81Hj5YuhSQaRxcsRqfEr/HNS DlcuKHvGZO3A3UhGb0/Wfc8bwzFhkODfMmt6jTPQN9C4BPG9QtY/zKo5tKz6ZAUwcZf5 y3Dx+UxuvPPSW/C9ub974o92xeF2TGakr6d4/0P3ChkVGahUZwrkNPbAA184ceoUEotU mDkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488757; x=1685080757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=guOOCtAiG93AJjpXU8UVj1OOgNFx9rEDxCoI9XZCYZs=; b=LNYzOrI4kMscYn3tVnUItV14XF70gMmRARBECiqRp+WbmIM6o5urkJU7kDCqcQimaj EAARO9Dw6iRuE8cmRYTqYhbWr+2Ia1wmGgSAJUjXkzotpdS8L/twkEKaoHxc6IjE+xl7 67FnZ0m+Ig+WtqVdOA7BmSxTYd2CBDAWj4YzylidchvqD0PMG3pGLzW512MvK3ytzECV PZYH/flkIKr1zAEQiSPJFK1eoXvb+WQPi19HskQO06EeuLaYC2r292CtzTquWkE0uLAB vrkRLqKNunNGhhZsvZCBLu7pVaDhLW2jvPflxxVWjV0oDNUz2bMSDLcqGtqgR1pHoH/D /Wnw== X-Gm-Message-State: AAQBX9cPA9VljvwdhejlI826LVc6GfavFnoUSvI+GKZJAj+ok7KjwzlW x+xpgFGHNdZxCoKtQ9zJ69nLyp4KgJ05mA== X-Google-Smtp-Source: AKy350bcbO4Ww2JUf5KdGl/1t3rNWO+T1QWZwX+rTHMFvLWteLO5Bv0Da4JhZAzejvqePDMSgIum5g== X-Received: by 2002:a05:6a00:1396:b0:63b:2102:9fc8 with SMTP id t22-20020a056a00139600b0063b21029fc8mr25172945pfg.21.1682488757366; Tue, 25 Apr 2023 22:59:17 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:16 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 8/9] powerpc/64s: Permit d-form memops in asm when building with prefix on clang Date: Wed, 26 Apr 2023 15:58:46 +1000 Message-Id: <20230426055848.402993-10-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" GCC appears to have a bug where it generates immediate offsets beyond the 16-bit range of d-form memory operations in extended inline asm when prefix instructions are enabled. So simpler fallback asm is implemented for CONFIG_PPC_KERNEL_PREFIXED builds for now. Clang does not have this bug, so this hack can be restricted to GCC. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 7 +++++++ arch/powerpc/include/asm/atomic.h | 8 ++++---- arch/powerpc/include/asm/io.h | 2 +- arch/powerpc/include/asm/uaccess.h | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 261e9453b43c..39cd8d3ff846 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -7,6 +7,13 @@ config CC_HAS_ELFV2 config CC_HAS_PREFIXED def_bool PPC64 && $(cc-option, -mcpu=power10 -mprefixed) +config CC_HAS_BROKEN_DFORM_MEMOP_ASM + # GCC has a bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108239) + # when compiling with prefixed instructions that causes it to generate + # out-of-range offsets for d-form loads and stores from memory + # operands. + def_bool CC_HAS_PREFIXED && CC_IS_GCC + config CC_HAS_PCREL # Clang has a bug (https://github.com/llvm/llvm-project/issues/62372) # where pcrel code is not generated if -msoft-float, -mno-altivec, or diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h index 47228b177478..f15c9e54e261 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h @@ -28,7 +28,7 @@ static __inline__ int arch_atomic_read(const atomic_t *v) int t; /* -mprefixed can generate offsets beyond range, fall back hack */ - if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) + if (IS_ENABLED(CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM)) __asm__ __volatile__("lwz %0,0(%1)" : "=r"(t) : "b"(&v->counter)); else __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); @@ -39,7 +39,7 @@ static __inline__ int arch_atomic_read(const atomic_t *v) static __inline__ void arch_atomic_set(atomic_t *v, int i) { /* -mprefixed can generate offsets beyond range, fall back hack */ - if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) + if (IS_ENABLED(CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM)) __asm__ __volatile__("stw %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); else __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); @@ -206,7 +206,7 @@ static __inline__ s64 arch_atomic64_read(const atomic64_t *v) s64 t; /* -mprefixed can generate offsets beyond range, fall back hack */ - if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) + if (IS_ENABLED(CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM)) __asm__ __volatile__("ld %0,0(%1)" : "=r"(t) : "b"(&v->counter)); else __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); @@ -217,7 +217,7 @@ static __inline__ s64 arch_atomic64_read(const atomic64_t *v) static __inline__ void arch_atomic64_set(atomic64_t *v, s64 i) { /* -mprefixed can generate offsets beyond range, fall back hack */ - if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) + if (IS_ENABLED(CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM)) __asm__ __volatile__("std %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); else __asm__ __volatile__("std%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index f1e657c9bbe8..2e6061f26c09 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -98,7 +98,7 @@ extern bool isa_io_special; */ /* -mprefixed can generate offsets beyond range, fall back hack */ -#ifdef CONFIG_PPC_KERNEL_PREFIXED +#ifdef CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM #define DEF_MMIO_IN_X(name, size, insn) \ static inline u##size name(const volatile u##size __iomem *addr) \ { \ diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index a2d255aa9627..6fdca4cddcf3 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -72,7 +72,7 @@ __pu_failed: \ * are no aliasing issues. */ /* -mprefixed can generate offsets beyond range, fall back hack */ -#ifdef CONFIG_PPC_KERNEL_PREFIXED +#ifdef CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM #define __put_user_asm_goto(x, addr, label, op) \ asm_volatile_goto( \ "1: " op " %0,0(%1) # put_user\n" \ @@ -144,7 +144,7 @@ do { \ #ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT /* -mprefixed can generate offsets beyond range, fall back hack */ -#ifdef CONFIG_PPC_KERNEL_PREFIXED +#ifdef CONFIG_CC_HAS_BROKEN_DFORM_MEMOP_ASM #define __get_user_asm_goto(x, addr, label, op) \ asm_volatile_goto( \ "1: "op" %0,0(%1) # get_user\n" \ From patchwork Wed Apr 26 05:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1773884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=K+8MfLSE; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5pLz3qF5z23v8 for ; Wed, 26 Apr 2023 16:07:55 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Q5pLz25t4z3fcl for ; Wed, 26 Apr 2023 16:07:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=K+8MfLSE; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42f; helo=mail-pf1-x42f.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=K+8MfLSE; dkim-atps=neutral Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Q5p961QJVz3cd4 for ; Wed, 26 Apr 2023 15:59:22 +1000 (AEST) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-63b5ce4f069so8243821b3a.1 for ; Tue, 25 Apr 2023 22:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682488760; x=1685080760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J2ko4ppJSMHqylz7vJmE3ziuMqcMcKfn3PkGhydIRaM=; b=K+8MfLSEJ+kZg9wGRn+L6zRM1TsU9YvM4Bu7eMt8E3aTVezdiLUWNqCO9Pg98pXCHc QE0oP8rtGHeBxhur5oPocqVfYaIoUrfTRwm+odcMKYRYtFyagM0sDOR/84BvY0Id3KNk I2y1EioCWrcMFLh0wx9kZDzBRJWZWFYQczbkQNCeqjEqAb4AYN/QkmQNiQUUWJORF8Te FV3J6MxPyaAhG4crirAgC7cHVFF5ABu1LuM5+h1cOedkKTMepCyqqDkqfXXK4rJqDzIO Am0hBDs1mRKinpDbt7MZuwv2VsVydqK0KYOuZFB0xs5siJet27+Zjb7Y4wuEzTc9Np0G Nt3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682488760; x=1685080760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J2ko4ppJSMHqylz7vJmE3ziuMqcMcKfn3PkGhydIRaM=; b=b9cIUKpBqUwFQ1/q8IFwRjM8EBoQbges99wD0OkymWJzI7Oh3gzGqZv5HO5Oa4rxMm auSSsp9Pp/V4gVw3o5JK5cLqvmDzaTqxrcBfVVoKlbjni3bqHovGp63oOQ+VemWfDhU4 bVpUkL4IOBySJCjwO3SUmjzirxfCpYX/0x02G6T54J/384fJuAtB5D/ozpaAdHF8JdXv 8FWWC2v+OLudj/OR/64pdUCA6ukQqNriYd72AtOMFhdN3+y5N/tu9oXxcs4DVYfc81/h c6ei3wMnKqeDkfPqhdwT/gGCVxSybhT+c4t5VllICiu/vPnQskoO0t2+NmP+m+og4syA nDXw== X-Gm-Message-State: AAQBX9f44muRv0zg822ArLyLOi37HUCONAVqYul2wjkNsyvrmzt7wEo3 8iGl25WvmgEF1xTC0x4W4vp0hP7ILfHEsg== X-Google-Smtp-Source: AKy350Y8SNcRT506yr7QVcqB5/6eCak/HwahzOIUsTpuyNN8bo0fel0tpOu0zDSmifma3OKgSigEEQ== X-Received: by 2002:a05:6a00:1141:b0:63d:2d8c:7fd5 with SMTP id b1-20020a056a00114100b0063d2d8c7fd5mr25723669pfm.12.1682488759972; Tue, 25 Apr 2023 22:59:19 -0700 (PDT) Received: from wheely.local0.net ([203.221.203.54]) by smtp.gmail.com with ESMTPSA id f25-20020aa782d9000000b0063a1e7d7439sm10300479pfn.69.2023.04.25.22.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 22:59:19 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 9/9] powerpc/64s: Work around llvm-as not recognising pla Date: Wed, 26 Apr 2023 15:58:47 +1000 Message-Id: <20230426055848.402993-11-npiggin@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com> References: <20230426055848.402993-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" llvm-as does not recognise the pla mnemonic, which is used for pcrel address generation. Use the equivalent paddi opcode instead. Clang can not build working pcrel kernels yet, but this patch does allow it to build a non-working pcrel kernel with llvm-as. This could be unconditional or use a raw encoding, but this gives a placeholder to track the issue. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 5 +++++ arch/powerpc/include/asm/ppc_asm.h | 5 +++++ arch/powerpc/kernel/vector.S | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 39cd8d3ff846..2f7840577f7f 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -22,6 +22,11 @@ config CC_HAS_PCREL # do pcrel yet. def_bool PPC64 && CC_IS_GCC && $(cc-option, -mcpu=power10 -mpcrel) +config AS_HAS_MISSING_PLA_INSN + # llvm-as is missing some extended mnemonics including pla + # (https://github.com/llvm/llvm-project/issues/62373). + def_bool AS_IS_LLVM + config 32BIT bool default y if PPC32 diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 5f05a984b103..736202ebc1be 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -380,8 +380,13 @@ GLUE(.,name): rldimi reg, tmp, 32, 0 #ifdef CONFIG_PPC_KERNEL_PCREL +#ifdef CONFIG_AS_HAS_MISSING_PLA_INSN +#define LOAD_REG_ADDR(reg,name) \ + paddi reg,0,name@pcrel,1 +#else #define LOAD_REG_ADDR(reg,name) \ pla reg,name@pcrel +#endif #else #define LOAD_REG_ADDR(reg,name) \ diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S index fcc0ad6d9c7b..c2feaea5e673 100644 --- a/arch/powerpc/kernel/vector.S +++ b/arch/powerpc/kernel/vector.S @@ -178,9 +178,15 @@ fphalf: .quad 0x3fe0000000000000 /* 0.5 */ #ifdef CONFIG_PPC_KERNEL_PCREL +#ifdef CONFIG_AS_HAS_MISSING_PLA_INSN +#define LDCONST(fr, name) \ + paddi r11,0,name@pcrel,1; \ + lfd fr,0(r11) +#else #define LDCONST(fr, name) \ pla r11,name@pcrel; \ lfd fr,0(r11) +#endif #else #define LDCONST(fr, name) \ addis r11,r2,name@toc@ha; \