From patchwork Wed Jan 4 19:54:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 698B3C46467 for ; Wed, 4 Jan 2023 19:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235177AbjADTzF (ORCPT ); Wed, 4 Jan 2023 14:55:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240184AbjADTy6 (ORCPT ); Wed, 4 Jan 2023 14:54:58 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6758A1AA11 for ; Wed, 4 Jan 2023 11:54:57 -0800 (PST) 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 F35ECB818B9 for ; Wed, 4 Jan 2023 19:54:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10283C433F0; Wed, 4 Jan 2023 19:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862094; bh=7eL7HbrvfN88cop/Q2OiR0WRyscekkrF/kn1kocOdzY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=b/oJ9j1+5+jZNaxU0C6WVwYUuEWXjN1OBOXKeIX3ZeYUnRB1YX08sppahtxdX9l7o HSarPbftZaJTRCZYM9bF2vIeLwYg3//LXzLdqkXIKEGjrVsRFKG4CffUEdi4Ml6ZP8 eoapsFObN66K0KBENtHQdOO+zjGaCl5BoawRJBx1SLZhLYKBrpQnf8c7vQL184wFeo 9Gxf2M8BJc34qLnRJRVfCBWdMAh1wEfm+KkDUS3OgGYe/8eBeIunz3vgiJYr+zv1QD jvOXIblym8r1brXGY3t8/LVtyInuIQGBtJaSgeJ/RQH4JsqNmJNOFFtihRKquG0sM8 9HP2x6NxjVuvg== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:18 -0700 Subject: [PATCH 01/14] x86/boot/compressed: prefer cc-option for CFLAGS additions MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-1-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1666; i=nathan@kernel.org; h=from:subject:message-id; bh=4Z/QjeIidCHott5q7MuOWLlOJLESu2McA9pepWg0ceM=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3buWmV1Vy6dldnylOlduT1vN67cZvb9zZkn1/7qnFZh vMMp2FHKwiDGwSArpshS/Vj1uKHhnLOMN05NgpnDygQyhIGLUwAmInmNkWH2+q014V/XagovTPx3zD sr+IdshVnt8+f6UzM9MmV8JLsZGc7Od3md0myQyG/OspnVZPKBs1M6nqmdM9e+5LN9vfDaZA4A X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Nick Desaulniers as-option tests new options using KBUILD_CFLAGS, which causes problems when using as-option to update KBUILD_AFLAGS because many compiler options are not valid assembler options. This will be fixed in a follow up patch. Before doing so, move the assembler test for -Wa,-mrelax-relocations=no from using as-option to cc-option. Link: https://lore.kernel.org/llvm/CAK7LNATcHt7GcXZ=jMszyH=+M_LC9Qr6yeAGRCBbE6xriLxtUQ@mail.gmail.com/ Suggested-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- Cc: tglx@linutronix.de Cc: mingo@redhat.com Cc: bp@alien8.de Cc: dave.hansen@linux.intel.com Cc: x86@kernel.org --- arch/x86/boot/compressed/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 1acff356d97a..6b6cfe607bdb 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -50,7 +50,7 @@ KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -D__DISABLE_EXPORTS # Disable relocation relaxation in case the link is not PIE. -KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) +KBUILD_CFLAGS += $(call cc-option,-Wa$(comma)-mrelax-relocations=no) KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h # sev.c indirectly inludes inat-table.h which is generated during From patchwork Wed Jan 4 19:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A70D0C61DB3 for ; Wed, 4 Jan 2023 19:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240016AbjADTzG (ORCPT ); Wed, 4 Jan 2023 14:55:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240104AbjADTy6 (ORCPT ); Wed, 4 Jan 2023 14:54:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9275A1ADB8; Wed, 4 Jan 2023 11:54:56 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 16D8561808; Wed, 4 Jan 2023 19:54:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E238EC433F1; Wed, 4 Jan 2023 19:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862095; bh=usbpMuCigD62wY0Re4W6EpsqoQLbOiIvj/OpDlo97YU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SzV/0pGwjUyCy7lBRTlJ+gIWe+f83xGXPE1RH/lozjVl5Bgak72ueXNKIYwuehpIC g7INcZPLww2hsP5a/aZTKb81NDEyqiy5HyCXnUxl6It9fLqlFeOXKOkYoWM6Rb0XbK Tx+AmtvIvYfn36IG3FoxEXORhKOsT0e1H4qicUytp8g7mh/6bTQ4zIS88OgD4syt75 vNwU95VQ3BqEwCTsMdYu5/u7yFRACZOqNvQ7O4pUADnyVp9n5+/hOqplGLw8S+/SPS x/UCCnTKkon8BZ/cAPgzVbeHkK1MswHljeXQwz3vQDW5c41Z7k8tOQl7wpKU5xirbW 2zgXDB0vgpTNw== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:19 -0700 Subject: [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-2-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , tsbogend@alpha.franken.de, linux-mips@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=13911; i=nathan@kernel.org; h=from:subject:message-id; bh=usbpMuCigD62wY0Re4W6EpsqoQLbOiIvj/OpDlo97YU=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3YtXZ98/q7O8+goyS5fl5J/E/V1rn2Wnj5PPPWJsOSC 7BucHaUsDGIcDLJiiizVj1WPGxrOOct449QkmDmsTCBDGLg4BWAiK7sY/of+fOztY/RvhtXLzlgpky stp35eXb/I8Kos25m9ksuPGlswMuw7/EPiWgyf6Jy35zU1t3Atmi4VcScs59u2M38PsOwSmcoNAA== X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org -Wa,-msoft-float is tested with as-option, which will be a problem for clang with an upcoming change to move as-option to use KBUILD_AFLAGS instead of KBUILD_CFLAGS due to a lack of '-mno-abicalls' in KBUILD_AFLAGS at the point that this check occurs; $(cflags-y) is added to KBUILD_AFLAGS towards the end of this file. clang: error: ignoring '-fno-PIE' option as it cannot be used with implicit usage of -mabicalls and the N64 ABI [-Werror,-Woption-ignored] This could be resolved by switching to a cc-option check but '$(cflags-y)' would need to be added so that '-mno-abicalls' is present for the test. However, this check is no longer necessary, as -msoft-float is supported by all supported assembler versions (GNU as 2.25+ and LLVM 11+). Eliminate GAS_HAS_SET_HARDFLOAT and all of its uses, inlining SET_HARDFLOAT where necessary. Link: https://lore.kernel.org/202209101939.bvk64Fok-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Philippe Mathieu-Daudé Acked-by: Thomas Bogendoerfer --- Cc: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org --- arch/mips/Makefile | 11 +--------- arch/mips/include/asm/asmmacro-32.h | 4 ++-- arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++++++------------------- arch/mips/include/asm/fpregdef.h | 14 ------------- arch/mips/include/asm/mipsregs.h | 20 ++++-------------- arch/mips/kernel/genex.S | 2 +- arch/mips/kernel/r2300_fpu.S | 4 ++-- arch/mips/kernel/r4k_fpu.S | 12 +++++------ arch/mips/kvm/fpu.S | 6 +++--- 9 files changed, 40 insertions(+), 75 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 490dea07d4e0..a00a6d94e16f 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -95,7 +95,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz # crossformat linking we rely on the elf2ecoff tool for format conversion. # cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -cflags-y += -msoft-float +cflags-y += -msoft-float -Wa,-msoft-float LDFLAGS_vmlinux += -G 0 -static -n -nostdlib KBUILD_AFLAGS_MODULE += -mlong-calls KBUILD_CFLAGS_MODULE += -mlong-calls @@ -104,15 +104,6 @@ ifeq ($(CONFIG_RELOCATABLE),y) LDFLAGS_vmlinux += --emit-relocs endif -# -# pass -msoft-float to GAS if it supports it. However on newer binutils -# (specifically newer than 2.24.51.20140728) we then also need to explicitly -# set ".set hardfloat" in all files which manipulate floating point registers. -# -ifneq ($(call as-option,-Wa$(comma)-msoft-float,),) - cflags-y += -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -endif - cflags-y += -ffreestanding cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h index 1c08c1f7903c..83a4940b7c89 100644 --- a/arch/mips/include/asm/asmmacro-32.h +++ b/arch/mips/include/asm/asmmacro-32.h @@ -15,7 +15,7 @@ .macro fpu_save_single thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat cfc1 \tmp, fcr31 s.d $f0, THREAD_FPR0(\thread) s.d $f2, THREAD_FPR2(\thread) @@ -39,7 +39,7 @@ .macro fpu_restore_single thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat lw \tmp, THREAD_FCR31(\thread) l.d $f0, THREAD_FPR0(\thread) l.d $f2, THREAD_FPR2(\thread) diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index ca83ada7015f..1c4438f3f2ab 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h @@ -83,7 +83,7 @@ .macro fpu_save_16even thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat cfc1 \tmp, fcr31 sdc1 $f0, THREAD_FPR0(\thread) sdc1 $f2, THREAD_FPR2(\thread) @@ -109,7 +109,7 @@ .set push .set mips64r2 .set fp=64 - SET_HARDFLOAT + .set hardfloat sdc1 $f1, THREAD_FPR1(\thread) sdc1 $f3, THREAD_FPR3(\thread) sdc1 $f5, THREAD_FPR5(\thread) @@ -142,7 +142,7 @@ .macro fpu_restore_16even thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat lw \tmp, THREAD_FCR31(\thread) ldc1 $f0, THREAD_FPR0(\thread) ldc1 $f2, THREAD_FPR2(\thread) @@ -168,7 +168,7 @@ .set push .set mips64r2 .set fp=64 - SET_HARDFLOAT + .set hardfloat ldc1 $f1, THREAD_FPR1(\thread) ldc1 $f3, THREAD_FPR3(\thread) ldc1 $f5, THREAD_FPR5(\thread) @@ -373,7 +373,7 @@ .macro _cfcmsa rd, cs .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x787e0059 | (\cs << 11) insn32_if_mm 0x587e0056 | (\cs << 11) move \rd, $1 @@ -383,7 +383,7 @@ .macro _ctcmsa cd, rs .set push .set noat - SET_HARDFLOAT + .set hardfloat move $1, \rs insn_if_mips 0x783e0819 | (\cd << 6) insn32_if_mm 0x583e0816 | (\cd << 6) @@ -393,7 +393,7 @@ .macro ld_b wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000820 | (\wd << 6) insn32_if_mm 0x58000807 | (\wd << 6) @@ -403,7 +403,7 @@ .macro ld_h wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000821 | (\wd << 6) insn32_if_mm 0x58000817 | (\wd << 6) @@ -413,7 +413,7 @@ .macro ld_w wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000822 | (\wd << 6) insn32_if_mm 0x58000827 | (\wd << 6) @@ -423,7 +423,7 @@ .macro ld_d wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000823 | (\wd << 6) insn32_if_mm 0x58000837 | (\wd << 6) @@ -433,7 +433,7 @@ .macro st_b wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000824 | (\wd << 6) insn32_if_mm 0x5800080f | (\wd << 6) @@ -443,7 +443,7 @@ .macro st_h wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000825 | (\wd << 6) insn32_if_mm 0x5800081f | (\wd << 6) @@ -453,7 +453,7 @@ .macro st_w wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000826 | (\wd << 6) insn32_if_mm 0x5800082f | (\wd << 6) @@ -463,7 +463,7 @@ .macro st_d wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000827 | (\wd << 6) insn32_if_mm 0x5800083f | (\wd << 6) @@ -473,7 +473,7 @@ .macro copy_s_w ws, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x78b00059 | (\n << 16) | (\ws << 11) insn32_if_mm 0x58b00056 | (\n << 16) | (\ws << 11) .set pop @@ -482,7 +482,7 @@ .macro copy_s_d ws, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x78b80059 | (\n << 16) | (\ws << 11) insn32_if_mm 0x58b80056 | (\n << 16) | (\ws << 11) .set pop @@ -491,7 +491,7 @@ .macro insert_w wd, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x79300819 | (\n << 16) | (\wd << 6) insn32_if_mm 0x59300816 | (\n << 16) | (\wd << 6) .set pop @@ -500,7 +500,7 @@ .macro insert_d wd, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x79380819 | (\n << 16) | (\wd << 6) insn32_if_mm 0x59380816 | (\n << 16) | (\wd << 6) .set pop @@ -553,7 +553,7 @@ st_d 29, THREAD_FPR29 - FPR_BASE_OFFS, FPR_BASE st_d 30, THREAD_FPR30 - FPR_BASE_OFFS, FPR_BASE st_d 31, THREAD_FPR31 - FPR_BASE_OFFS, FPR_BASE - SET_HARDFLOAT + .set hardfloat _cfcmsa $1, MSA_CSR sw $1, THREAD_MSA_CSR(\thread) .set pop @@ -562,7 +562,7 @@ .macro msa_restore_all thread .set push .set noat - SET_HARDFLOAT + .set hardfloat lw $1, THREAD_MSA_CSR(\thread) _ctcmsa MSA_CSR, $1 #ifdef TOOLCHAIN_SUPPORTS_MSA @@ -618,7 +618,7 @@ .macro msa_init_all_upper .set push .set noat - SET_HARDFLOAT + .set hardfloat not $1, zero msa_init_upper 0 msa_init_upper 1 diff --git a/arch/mips/include/asm/fpregdef.h b/arch/mips/include/asm/fpregdef.h index f184ba088532..429481f9028d 100644 --- a/arch/mips/include/asm/fpregdef.h +++ b/arch/mips/include/asm/fpregdef.h @@ -14,20 +14,6 @@ #include -/* - * starting with binutils 2.24.51.20140729, MIPS binutils warn about mixing - * hardfloat and softfloat object files. The kernel build uses soft-float by - * default, so we also need to pass -msoft-float along to GAS if it supports it. - * But this in turn causes assembler errors in files which access hardfloat - * registers. We detect if GAS supports "-msoft-float" in the Makefile and - * explicitly put ".set hardfloat" where floating point registers are touched. - */ -#ifdef GAS_HAS_SET_HARDFLOAT -#define SET_HARDFLOAT .set hardfloat -#else -#define SET_HARDFLOAT -#endif - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 99eeafe6dcab..2d53704d9f24 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -2367,7 +2367,7 @@ do { \ /* * Macros to access the floating point coprocessor control registers */ -#define _read_32bit_cp1_register(source, gas_hardfloat) \ +#define read_32bit_cp1_register(source) \ ({ \ unsigned int __res; \ \ @@ -2377,36 +2377,24 @@ do { \ " # gas fails to assemble cfc1 for some archs, \n" \ " # like Octeon. \n" \ " .set mips1 \n" \ - " "STR(gas_hardfloat)" \n" \ + " .set hardfloat \n" \ " cfc1 %0,"STR(source)" \n" \ " .set pop \n" \ : "=r" (__res)); \ __res; \ }) -#define _write_32bit_cp1_register(dest, val, gas_hardfloat) \ +#define write_32bit_cp1_register(dest, val) \ do { \ __asm__ __volatile__( \ " .set push \n" \ " .set reorder \n" \ - " "STR(gas_hardfloat)" \n" \ + " .set hardfloat \n" \ " ctc1 %0,"STR(dest)" \n" \ " .set pop \n" \ : : "r" (val)); \ } while (0) -#ifdef GAS_HAS_SET_HARDFLOAT -#define read_32bit_cp1_register(source) \ - _read_32bit_cp1_register(source, .set hardfloat) -#define write_32bit_cp1_register(dest, val) \ - _write_32bit_cp1_register(dest, val, .set hardfloat) -#else -#define read_32bit_cp1_register(source) \ - _read_32bit_cp1_register(source, ) -#define write_32bit_cp1_register(dest, val) \ - _write_32bit_cp1_register(dest, val, ) -#endif - #ifdef TOOLCHAIN_SUPPORTS_DSP #define rddsp(mask) \ ({ \ diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 3425df6019c0..b6de8e88c1bd 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -480,7 +480,7 @@ NESTED(nmi_handler, PT_SIZE, sp) .set push /* gas fails to assemble cfc1 for some archs (octeon).*/ \ .set mips1 - SET_HARDFLOAT + .set hardfloat cfc1 a1, fcr31 .set pop .endm diff --git a/arch/mips/kernel/r2300_fpu.S b/arch/mips/kernel/r2300_fpu.S index 2748c55820c2..6c745aa9e825 100644 --- a/arch/mips/kernel/r2300_fpu.S +++ b/arch/mips/kernel/r2300_fpu.S @@ -64,7 +64,7 @@ LEAF(_restore_fp) */ LEAF(_save_fp_context) .set push - SET_HARDFLOAT + .set hardfloat li v0, 0 # assume success cfc1 t1, fcr31 EX2(s.d $f0, 0(a0)) @@ -98,7 +98,7 @@ LEAF(_save_fp_context) */ LEAF(_restore_fp_context) .set push - SET_HARDFLOAT + .set hardfloat li v0, 0 # assume success EX(lw t0, (a1)) EX2(l.d $f0, 0(a0)) diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 2e687c60bc4f..4e8c98517d9d 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S @@ -26,7 +26,7 @@ .macro EX insn, reg, src .set push - SET_HARDFLOAT + .set hardfloat .set nomacro .ex\@: \insn \reg, \src .set pop @@ -98,14 +98,14 @@ LEAF(_init_msa_upper) */ LEAF(_save_fp_context) .set push - SET_HARDFLOAT + .set hardfloat cfc1 t1, fcr31 .set pop #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) .set push - SET_HARDFLOAT + .set hardfloat #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) .set mips32r2 .set fp=64 @@ -135,7 +135,7 @@ LEAF(_save_fp_context) #endif .set push - SET_HARDFLOAT + .set hardfloat /* Store the 16 even double precision registers */ EX sdc1 $f0, 0(a0) EX sdc1 $f2, 16(a0) @@ -173,7 +173,7 @@ LEAF(_restore_fp_context) #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) .set push - SET_HARDFLOAT + .set hardfloat #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) .set mips32r2 .set fp=64 @@ -201,7 +201,7 @@ LEAF(_restore_fp_context) 1: .set pop #endif .set push - SET_HARDFLOAT + .set hardfloat EX ldc1 $f0, 0(a0) EX ldc1 $f2, 16(a0) EX ldc1 $f4, 32(a0) diff --git a/arch/mips/kvm/fpu.S b/arch/mips/kvm/fpu.S index 16f17c6390dd..eb2e8cc3532f 100644 --- a/arch/mips/kvm/fpu.S +++ b/arch/mips/kvm/fpu.S @@ -22,7 +22,7 @@ LEAF(__kvm_save_fpu) .set push - SET_HARDFLOAT + .set hardfloat .set fp=64 mfc0 t0, CP0_STATUS sll t0, t0, 5 # is Status.FR set? @@ -66,7 +66,7 @@ LEAF(__kvm_save_fpu) LEAF(__kvm_restore_fpu) .set push - SET_HARDFLOAT + .set hardfloat .set fp=64 mfc0 t0, CP0_STATUS sll t0, t0, 5 # is Status.FR set? @@ -110,7 +110,7 @@ LEAF(__kvm_restore_fpu) LEAF(__kvm_restore_fcsr) .set push - SET_HARDFLOAT + .set hardfloat lw t0, VCPU_FCR31(a0) /* * The ctc1 must stay at this offset in __kvm_restore_fcsr. From patchwork Wed Jan 4 19:54:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BB88C54E76 for ; Wed, 4 Jan 2023 19:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235279AbjADTzF (ORCPT ); Wed, 4 Jan 2023 14:55:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240113AbjADTy6 (ORCPT ); Wed, 4 Jan 2023 14:54:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5706A17881; Wed, 4 Jan 2023 11:54:57 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id BEB8961805; Wed, 4 Jan 2023 19:54:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A424AC433EF; Wed, 4 Jan 2023 19:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862096; bh=wSbm0g/ASp2Rq+1sjo1z5jYMHVjuwfrl7bVt7IhiTdE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nmrz3pPrWgfV/pQ7uNJa5V63CxdAXhhyJms738yQDD4zWiY7UG7QN6OM/H942rh40 Kkj4yEix4MPJP+X9rf06gUznaQeUfwfghN4diJUSXuRRX7HX/av+LLXpB9tUPL1K4E Px+6IhHORjZsb06F33MOW181JKnzRiHXHrlhsWojT3X71123sb2gLdPEaJkZW13BWN WQrt5zC3gf4X+I0PjNogB0gLnExCX3CVmaJC8NzhbabiDMmAlveKyZP7Qthv4ZqmNu m1BtWNRy3kpgXpy+w9FAbPFcWxnrOx7RxYog1yMutY8auoetBH9CmkZaHP+krcn6wK wIaybXYU0kZUQ== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:20 -0700 Subject: [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-3-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , tsbogend@alpha.franken.de, linux-mips@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1776; i=nathan@kernel.org; h=from:subject:message-id; bh=wSbm0g/ASp2Rq+1sjo1z5jYMHVjuwfrl7bVt7IhiTdE=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3bdrVtlFFG7j31+9ZPnH3uW3Flc3Dc1V+LQg4Qpp/+s OxQk1FHKwiDGwSArpshS/Vj1uKHhnLOMN05NgpnDygQyhIGLUwAm8r2E4X9pr5kzM9tnKzPdZU/fPU wLDEtQ1/LMXBm39ufMtkfVT04xMux+NDNA91PoC059FaG22fJ/70z8v0JPpUvW02Gu1deXHowA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org A future change will switch as-option to use KBUILD_AFLAGS instead of KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause issues if the flag being tested requires a flag previously added to KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions so that the flags are tested properly. Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Philippe Mathieu-Daudé Acked-by: Thomas Bogendoerfer --- Cc: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org --- arch/mips/Makefile | 2 +- arch/mips/loongson2ef/Platform | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index a00a6d94e16f..04e46ec24319 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -143,7 +143,7 @@ cflags-y += -fno-stack-check # # Avoid this by explicitly disabling that assembler behaviour. # -cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) +cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) # # CPU-dependent compiler/assembler options for optimization. diff --git a/arch/mips/loongson2ef/Platform b/arch/mips/loongson2ef/Platform index eebabf9df6ac..c6f7a4b95997 100644 --- a/arch/mips/loongson2ef/Platform +++ b/arch/mips/loongson2ef/Platform @@ -25,7 +25,7 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f # binutils does not merge support for the flag then we can revisit & remove # this later - for now it ensures vendor toolchains don't cause problems. # -cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) +cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) # Enable the workarounds for Loongson2f ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS From patchwork Wed Jan 4 19:54:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3760C63705 for ; Wed, 4 Jan 2023 19:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235156AbjADTzI (ORCPT ); Wed, 4 Jan 2023 14:55:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240204AbjADTy6 (ORCPT ); Wed, 4 Jan 2023 14:54:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07AF1C923 for ; Wed, 4 Jan 2023 11:54:57 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5CA3261742 for ; Wed, 4 Jan 2023 19:54:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DF9EC43392; Wed, 4 Jan 2023 19:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862096; bh=iDpwete7KRRtx7xm+tCbXm0Lyr2zptLdbj1MM4EGk8w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=XSh3WiMpkuAAm+nhA52aK5YzKtG/6pHbHKysJHN/Fwb5kNBADC5pG5jArcZ707Zue L60ej1YWTgRf5Dkkmkic1rVRnfwDQfMDwMNydTsig/htlfZAyQJRcmggkQ8YSQgwX1 WtYDgadLHy+WquLOn0OVc6MNsuDkjGHLk/U1IANYvJ8/TH4QD7xbSYE/DQLL04mOtF AuLfz49pkcTJ0PPSqESG0y8HLydXQANKq3b9Bm+nXIP4YeRlH5jcsfFs4G07q9EglK JXCrk1VjE6ckOun8yHZMNDC9t+jCmZ+NxQVExYT/pZ6lr7GhuKSAOKL6zDZMjezI2n U1Q1VzfmF1haQ== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:21 -0700 Subject: [PATCH 04/14] kbuild: Update assembler calls to use proper flags and language target MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-4-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5349; i=nathan@kernel.org; h=from:subject:message-id; bh=ygBZ1B4cc2ZDEctLp77RGqvNTcRd7amEhdM91D44bsY=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3YZP5I8WLrD4BPDbf0Zt+aeTGyX2b/Dqow/9tXiKG2F ScYbOkpZGMQ4GGTFFFmqH6seNzScc5bxxqlJMHNYmUCGMHBxCsBEnhcx/C94OOGfe7ePfeXt1+a7tD VYOCTafq18EF/eM9/VV9BoZiEjQ8ffOyatmsap6a56dhF6jsqX7yz5Kbz634TV5uIndTTq2AA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Nick Desaulniers as-instr uses KBUILD_AFLAGS, but as-option uses KBUILD_CFLAGS. This can cause as-option to fail unexpectedly when CONFIG_WERROR is set, because clang will emit -Werror,-Wunused-command-line-argument for various -m and -f flags in KBUILD_CFLAGS for assembler sources. Callers of as-option and as-instr should be adding flags to KBUILD_AFLAGS / aflags-y, not KBUILD_CFLAGS / cflags-y. Use KBUILD_AFLAGS in all macros to clear up the initial problem. Unfortunately, -Wunused-command-line-argument can still be triggered with clang by the presence of warning flags or macro definitions because '-x assembler' is used, instead of '-x assembler-with-cpp', which will consume these flags. Switch to '-x assembler-with-cpp' in places where '-x assembler' is used, as the compiler is always used as the driver for out of line assembler sources in the kernel. Finally, add -Werror to these macros so that they behave consistently whether or not CONFIG_WERROR is set. Link: https://github.com/ClangBuiltLinux/linux/issues/1699 Suggested-by: Masahiro Yamada Signed-off-by: Nick Desaulniers [nathan: Reworded and expanded on problems in commit message Use '-x assembler-with-cpp' in a couple more places] Signed-off-by: Nathan Chancellor --- Benchmarking '-x assembler' vs. '-x assembler-with-cpp' does show that invoking the preprocessor incurs some overhead but my kernel builds do not show any noticeable slowdowns due to how infrequently these macros are used. $ hyperfine -L lang assembler,assembler-with-cpp -N -w 5 "/usr/bin/gcc -x {lang} -c -o /dev/null /dev/null" Benchmark 1: /usr/bin/gcc -x assembler -c -o /dev/null /dev/null Time (mean ± σ): 5.5 ms ± 0.5 ms [User: 4.1 ms, System: 1.3 ms] Range (min … max): 4.3 ms … 6.3 ms 472 runs Benchmark 2: /usr/bin/gcc -x assembler-with-cpp -c -o /dev/null /dev/null Time (mean ± σ): 12.7 ms ± 1.0 ms [User: 9.1 ms, System: 3.6 ms] Range (min … max): 9.6 ms … 14.2 ms 225 runs Summary '/usr/bin/gcc -x assembler -c -o /dev/null /dev/null' ran 2.29 ± 0.28 times faster than '/usr/bin/gcc -x assembler-with-cpp -c -o /dev/null /dev/null' $ hyperfine -L lang assembler,assembler-with-cpp -N -w 5 "/usr/bin/clang -x {lang} -c -o /dev/null /dev/null" Benchmark 1: /usr/bin/clang -x assembler -c -o /dev/null /dev/null Time (mean ± σ): 21.0 ms ± 1.1 ms [User: 9.6 ms, System: 11.1 ms] Range (min … max): 13.9 ms … 22.0 ms 138 runs Benchmark 2: /usr/bin/clang -x assembler-with-cpp -c -o /dev/null /dev/null Time (mean ± σ): 56.9 ms ± 3.2 ms [User: 27.2 ms, System: 29.5 ms] Range (min … max): 53.9 ms … 62.1 ms 48 runs Summary '/usr/bin/clang -x assembler -c -o /dev/null /dev/null' ran 2.71 ± 0.20 times faster than '/usr/bin/clang -x assembler-with-cpp -c -o /dev/null /dev/null' --- scripts/Kconfig.include | 2 +- scripts/Makefile.compiler | 8 ++++---- scripts/as-version.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 274125307ebd..5a84b6443875 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -33,7 +33,7 @@ ld-option = $(success,$(LD) -v $(1)) # $(as-instr,) # Return y if the assembler supports , n otherwise -as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -) +as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler-with-cpp -o /dev/null -) # check if $(CC) and $(LD) exist $(error-if,$(failure,command -v $(CC)),C compiler '$(CC)' not found) diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 3d8adfd34af1..7aa1fbc4aafe 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -29,16 +29,16 @@ try-run = $(shell set -e; \ fi) # as-option -# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) +# Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) as-option = $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) + $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) # as-instr -# Usage: cflags-y += $(call as-instr,instr,option1,option2) +# Usage: aflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ - printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) + printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) # __cc-option # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) diff --git a/scripts/as-version.sh b/scripts/as-version.sh index 1a21495e9ff0..af717476152d 100755 --- a/scripts/as-version.sh +++ b/scripts/as-version.sh @@ -45,7 +45,7 @@ orig_args="$@" # Get the first line of the --version output. IFS=' ' -set -- $(LC_ALL=C "$@" -Wa,--version -c -x assembler /dev/null -o /dev/null 2>/dev/null) +set -- $(LC_ALL=C "$@" -Wa,--version -c -x assembler-with-cpp /dev/null -o /dev/null 2>/dev/null) # Split the line on spaces. IFS=' ' From patchwork Wed Jan 4 19:54:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE20C63709 for ; Wed, 4 Jan 2023 19:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240248AbjADTzJ (ORCPT ); Wed, 4 Jan 2023 14:55:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240258AbjADTy7 (ORCPT ); Wed, 4 Jan 2023 14:54:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D22517881 for ; Wed, 4 Jan 2023 11:54:58 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 2CD8261808 for ; Wed, 4 Jan 2023 19:54:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE80CC4339C; Wed, 4 Jan 2023 19:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862097; bh=0dvoKPcMnIOYTBZdOpsCJQUfqsMe8RMRL32tVdj/v/U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JIu3wmpcBPtYh13qxWBVmlhvjOIOUph45e5ANsz8MlDjd3GcHklD6l+/OOQm+pD25 nUsrSiQnVBV2Exx7DFxyJ698J1moHkasab/4nzLL03KP+UH6woALhLXfvNu52O3QTn 7jySBzdWUOdMGs6i1aXV7ovB5RlxqBU6wtxQr3xV2uNw+hFH0WCO1bCH9JA6LRurwh HY+kOqYKkVDjYfEDaNxVsmxtIh/ETy8xdOuVTrUvC9dewsKQwlRGwT/79hk/atMOB4 Q2ZSGGu3Y72F1YzGcMtq9AVEE+Wd+70B93mqi05JS3igL4yx/KxFk8HzLDg4tcUtcj vepcaZb/NPFXg== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:22 -0700 Subject: [PATCH 05/14] powerpc: Remove linker flag from KBUILD_AFLAGS MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-5-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2495; i=nathan@kernel.org; h=from:subject:message-id; bh=0dvoKPcMnIOYTBZdOpsCJQUfqsMe8RMRL32tVdj/v/U=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3b1Lnwa7i9dJ59eLS4RJKO6pN3y+prla4riOqWEtjtv dn7dUcrCIMbBICumyFL9WPW4oeGcs4w3Tk2CmcPKBDKEgYtTACZyfQHDH05mp9tHlb6/8yzeuoXp7Z zrn+pKVWan8ocrSsc/5ax8uYHhf6jm1qPRtfsP1X/6Vrjh+ARdnaCPGQoJTsVxa2VqghW28gAA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it points out that KBUILD_AFLAGS contains a linker flag, which will be used: clang: error: -Wl,-a32: 'linker' input unused [-Werror,-Wunused-command-line-argument] This was likely supposed to be '-Wa,-a$(BITS)'. However, this change is unnecessary, as all supported versions of clang and gcc will pass '-a64' or '-a32' to GNU as based on the value of '-m'; the behavior of the latest stable release of the oldest supported major version of each compiler is shown below and each compiler's latest release exhibits the same behavior (GCC 12.2.0 and Clang 15.0.6). $ powerpc64-linux-gcc --version | head -1 powerpc64-linux-gcc (GCC) 5.5.0 $ powerpc64-linux-gcc -m64 -### -x assembler-with-cpp -c -o /dev/null /dev/null &| grep 'as ' .../as -a64 -mppc64 -many -mbig -o /dev/null /tmp/cctwuBzZ.s $ powerpc64-linux-gcc -m32 -### -x assembler-with-cpp -c -o /dev/null /dev/null &| grep 'as ' .../as -a32 -mppc -many -mbig -o /dev/null /tmp/ccaZP4mF.sg $ clang --version | head -1 Ubuntu clang version 11.1.0-++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 $ clang --target=powerpc64-linux-gnu -fno-integrated-as -m64 -### \ -x assembler-with-cpp -c -o /dev/null /dev/null &| grep gnu-as "/usr/bin/powerpc64-linux-gnu-as" "-a64" "-mppc64" "-many" "-o" "/dev/null" "/tmp/null-80267c.s" $ clang --target=powerpc64-linux-gnu -fno-integrated-as -m64 -### \ -x assembler-with-cpp -c -o /dev/null /dev/null &| grep gnu-as "/usr/bin/powerpc64-linux-gnu-as" "-a32" "-mppc" "-many" "-o" "/dev/null" "/tmp/null-ab8f8d.s" Remove this flag altogether to avoid future issues. Fixes: 1421dc6d4829 ("powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- Cc: mpe@ellerman.id.au Cc: npiggin@gmail.com Cc: christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index dc4cbf0a5ca9..4fd630efe39d 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -90,7 +90,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian ifeq ($(HAS_BIARCH),y) KBUILD_CFLAGS += -m$(BITS) -KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) +KBUILD_AFLAGS += -m$(BITS) KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) endif From patchwork Wed Jan 4 19:54:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088876 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1D92C63797 for ; Wed, 4 Jan 2023 19:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240204AbjADTzJ (ORCPT ); Wed, 4 Jan 2023 14:55:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240260AbjADTzA (ORCPT ); Wed, 4 Jan 2023 14:55:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE841AA11 for ; Wed, 4 Jan 2023 11:54:59 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 0AD4461742 for ; Wed, 4 Jan 2023 19:54:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BACA7C433F1; Wed, 4 Jan 2023 19:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862098; bh=dwmbTzUK1OVhXPLwSXDDMGcNHMUbPdQ43vDX3d7ndH4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=L20+yIsBiPVGLKKtva0a3kjheU5L+EBnfCygm00ekLoZOdQHM6ktm/vkxIEtR8uiS o6sUcCRZOaFpz0pwB6BDdzhfrbEDdiXKX9A9rswNMbdBDObbOnIj8Npja30miqZuuI qe1dKJnMUngvpuhkIU3W+V+pXHBeROxNut8k4H9WiwWCXE5YpARmynojk07LgUdJFE Q71puWvLGRZBILlFsyrAG6ylddfkWMRDiA0sXPAFKDW6YyUW/rCVWpF/1/6qG1k7Nv 0m+kU2aLb/HfRz3dOSVPibQLYSW9nVjgYLL+TWGvwHO521xzeyDErCXvSg+/GFkmVG G99mEwLXrofgQ== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:23 -0700 Subject: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-6-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1397; i=nathan@kernel.org; h=from:subject:message-id; bh=dwmbTzUK1OVhXPLwSXDDMGcNHMUbPdQ43vDX3d7ndH4=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3ZZzzzyabtinsvetoKDF7j6XZXeK4gGiE5i1ffZt+aO VeSnjlIWBjEOBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCRe9GMDFdikz67F7Ia9IRGpyW/WD T5JnPxy2Nb6/8syY/rXs30ZzMjwyqN3REaf194STtyum9817qv+e70Bd679FXKC7v+btyeywsA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns that ASFLAGS contains '-s', which is a linking phase option, so it is unused. clang-16: error: argument unused during compilation: '-s' [-Werror,-Wunused-command-line-argument] Looking at the GAS sources, '-s' is only useful when targeting Solaris and it is ignored for the powerpc target so just drop the flag altogether, as it is not needed. Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Segher Boessenkool --- Cc: mpe@ellerman.id.au Cc: npiggin@gmail.com Cc: christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/vdso/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index 6a977b0d8ffc..45c0cc5d34b6 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -51,10 +51,10 @@ ccflags-y := -shared -fno-common -fno-builtin -nostdlib -Wl,--hash-style=both ccflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) CC32FLAGS := -Wl,-soname=linux-vdso32.so.1 -m32 -AS32FLAGS := -D__VDSO32__ -s +AS32FLAGS := -D__VDSO32__ CC64FLAGS := -Wl,-soname=linux-vdso64.so.1 -AS64FLAGS := -D__VDSO64__ -s +AS64FLAGS := -D__VDSO64__ targets += vdso32.lds CPPFLAGS_vdso32.lds += -P -C -Upowerpc From patchwork Wed Jan 4 19:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4051CC677F1 for ; Wed, 4 Jan 2023 19:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240254AbjADTzM (ORCPT ); Wed, 4 Jan 2023 14:55:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240261AbjADTzD (ORCPT ); Wed, 4 Jan 2023 14:55:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CC581AA11 for ; Wed, 4 Jan 2023 11:55:01 -0800 (PST) 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 A75AEB818B7 for ; Wed, 4 Jan 2023 19:55:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A948C433A1; Wed, 4 Jan 2023 19:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862099; bh=f/bdga3DLC0ICmYuLt5jzIvLqqsy/uQ32UMKQcitWkk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GvS9EqaM2s+hmge+UB6B3qFcOQqV326tXO52kyiVP3AYuYQ6ikQBJmfw2q34xq4kq FVKViCKfmUp5QLoXUIdmmHbv0u5SVD+otrmk8xjgG7JDjT29wMDhPdCIGLh/ANtku8 bBroSJ7wBayGI56jt64fxIxadPQuJ13hUUCjBaLmEfNz6plyBbFWqbCTixgxJt0+Y7 GgX2f7qyvNgHKoRFhRYZygfGMyuiDzupTSuOm79UyQPaMfVPjH7ScaCI+4h5MN0M3/ QAhrSgKBx2yF/XtiBfJcAZ+iG9ParcRuWTHErtR/u41KE/6oIQhDgXh4PKmBRho64U u27rBFjr+rffA== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:24 -0700 Subject: [PATCH 07/14] powerpc/vdso: Improve linker flags MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-7-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3597; i=nathan@kernel.org; h=from:subject:message-id; bh=f/bdga3DLC0ICmYuLt5jzIvLqqsy/uQ32UMKQcitWkk=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3apzJKXc9ueX/+8125m9oMq72PVWX5ec1P6c2McAxc+ /jOno5SFQYyDQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAEzkTzzDH55oKYa1cybLrMnU4kp4cW ta6lSBfNvtjw7+6v1yssVKrZCR4SXLv2kt05+vfT8pRiju7GG3u/knl1s+XCIYdVr1k6okOxMA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, there are several warnings in the PowerPC vDSO: clang-16: error: -Wl,-soname=linux-vdso32.so.1: 'linker' input unused [-Werror,-Wunused-command-line-argument] clang-16: error: -Wl,--hash-style=both: 'linker' input unused [-Werror,-Wunused-command-line-argument] clang-16: error: argument unused during compilation: '-shared' [-Werror,-Wunused-command-line-argument] clang-16: error: argument unused during compilation: '-nostdinc' [-Werror,-Wunused-command-line-argument] clang-16: error: argument unused during compilation: '-Wa,-maltivec' [-Werror,-Wunused-command-line-argument] The first group of warnings point out that linker flags were being added to all invocations of $(CC), even though they will only be used during the final vDSO link. Move those flags to ldflags-y. The second group of warnings are compiler or assembler flags that will be unused during linking. Filter them out from KBUILD_CFLAGS so that they are not used during linking. Signed-off-by: Nathan Chancellor --- Cc: mpe@ellerman.id.au Cc: npiggin@gmail.com Cc: christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/vdso/Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index 45c0cc5d34b6..769b62832b38 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -47,13 +47,17 @@ KCOV_INSTRUMENT := n UBSAN_SANITIZE := n KASAN_SANITIZE := n -ccflags-y := -shared -fno-common -fno-builtin -nostdlib -Wl,--hash-style=both -ccflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) - -CC32FLAGS := -Wl,-soname=linux-vdso32.so.1 -m32 +ccflags-y := -fno-common -fno-builtin +ldflags-y := -Wl,--hash-style=both -nostdlib -shared +ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) +# Filter flags that clang will warn are unused for linking +ldflags-y += $(filter-out $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CFLAGS)) + +CC32FLAGS := -m32 +LD32FLAGS := -Wl,-soname=linux-vdso32.so.1 AS32FLAGS := -D__VDSO32__ -CC64FLAGS := -Wl,-soname=linux-vdso64.so.1 +LD64FLAGS := -Wl,-soname=linux-vdso64.so.1 AS64FLAGS := -D__VDSO64__ targets += vdso32.lds @@ -92,14 +96,14 @@ include/generated/vdso64-offsets.h: $(obj)/vdso64.so.dbg FORCE # actual build commands quiet_cmd_vdso32ld_and_check = VDSO32L $@ - cmd_vdso32ld_and_check = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) + cmd_vdso32ld_and_check = $(VDSOCC) $(ldflags-y) $(CC32FLAGS) $(LD32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) quiet_cmd_vdso32as = VDSO32A $@ cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) $(AS32FLAGS) -c -o $@ $< quiet_cmd_vdso32cc = VDSO32C $@ cmd_vdso32cc = $(VDSOCC) $(c_flags) $(CC32FLAGS) -c -o $@ $< quiet_cmd_vdso64ld_and_check = VDSO64L $@ - cmd_vdso64ld_and_check = $(VDSOCC) $(c_flags) $(CC64FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) + cmd_vdso64ld_and_check = $(VDSOCC) $(ldflags-y) $(CC64FLAGS) $(LD64FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) quiet_cmd_vdso64as = VDSO64A $@ cmd_vdso64as = $(VDSOCC) $(a_flags) $(CC64FLAGS) $(AS64FLAGS) -c -o $@ $< From patchwork Wed Jan 4 19:54:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E80C6379F for ; Wed, 4 Jan 2023 19:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240251AbjADTzL (ORCPT ); Wed, 4 Jan 2023 14:55:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239830AbjADTzC (ORCPT ); Wed, 4 Jan 2023 14:55:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27D0A17881 for ; Wed, 4 Jan 2023 11:55:01 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id BC42A61742 for ; Wed, 4 Jan 2023 19:55:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84A7FC433A0; Wed, 4 Jan 2023 19:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862100; bh=v6Pz2Y597IXrTiPrySIepPbVwiJR5GwFlJrsRuCIfjA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mkASiltETfh4En70AMu63xlODVbvUZ3CGiAg43pvev1i8Iwh06O1t8hl0yJwZ91Hh PjN5gImQ3ULDaZZBPEJ5nR5dJSzIDF+ys0DU2O6vCIZaVEvUY+mzlgqJJWwi4oSTHI pO/Y3qIi51iv7+1BLOWfJDnBD+nwbPGaEjjI8r8xDnYQ2+0Ss/gv+6wd4eBUpU/BiO kzr/vQZeDDV0IPpLbyl7fnJRMM868O6aL2dnFg85f4ZvveKBBaGfmhEMJ4axoEyNZp azM6gIQIwiBFZ68dyBiod7wdvIH+uIh8c1WGRIRXLFJRtG/362bwJVrbisYaVdNaIA g+5jeRz2FSRzA== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:25 -0700 Subject: [PATCH 08/14] powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-8-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1615; i=nathan@kernel.org; h=from:subject:message-id; bh=v6Pz2Y597IXrTiPrySIepPbVwiJR5GwFlJrsRuCIfjA=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3Z7Oq3kieNiveZyJXDJXasQq54txYoNPclTjr3u7Xo4 ZeLpjlIWBjEOBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjARsRiG/4kaRepfr4TF+i5fe2SxxC QL5QfqtVtfZX7951uV4MLPUcvI8NJTeEWyUZXhPo85ojZH1SS93f4Fbf/7uijotRdHqtgPDgA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns: clang-16: error: argument unused during compilation: '-fno-stack-clash-protection' [-Werror,-Wunused-command-line-argument] This flag is supported for 64-bit powerpc but not 32-bit, hence the warning. Just remove the flag from vgettimeofday-32.o's CFLAGS when using clang, as has been done for other flags previously. Signed-off-by: Nathan Chancellor --- Cc: mpe@ellerman.id.au Cc: npiggin@gmail.com Cc: christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/vdso/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index 769b62832b38..4ee7d36ce752 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -16,6 +16,11 @@ ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday-32.o += -ffreestanding -fasynchronous-unwind-tables CFLAGS_REMOVE_vgettimeofday-32.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_vgettimeofday-32.o += -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc + # This flag is supported by clang for 64-bit but not 32-bit so it will cause + # an unused command line flag warning for this file. + ifdef CONFIG_CC_IS_CLANG + CFLAGS_REMOVE_vgettimeofday-32.o += -fno-stack-clash-protection + endif CFLAGS_vgettimeofday-64.o += -include $(c-gettimeofday-y) CFLAGS_vgettimeofday-64.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) CFLAGS_vgettimeofday-64.o += $(call cc-option, -fno-stack-protector) From patchwork Wed Jan 4 19:54:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F19BC677F0 for ; Wed, 4 Jan 2023 19:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240261AbjADTzN (ORCPT ); Wed, 4 Jan 2023 14:55:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240276AbjADTzE (ORCPT ); Wed, 4 Jan 2023 14:55:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C41811AA11; Wed, 4 Jan 2023 11:55:03 -0800 (PST) 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 66FC6B818B9; Wed, 4 Jan 2023 19:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EF56C43396; Wed, 4 Jan 2023 19:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862101; bh=eOzKxLrRsBTq/MljE5/gHOkCQwsBUGjl8YrlO4iJnbE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kvFJpgAbYewxpxa+bz2Udtm6ypeLdSpxaH/VUK6Ae27GBGBz1x2BXHUu+80G/aghj 49WtUUD+e0T9hoMuEoCcgIFMC2Y/h9K5PQAKmL3/LYB+Do8RjVacmx0m0HSUxetYkK v57P0IcbDHxcShopAo6pIF1lpFrE8roM8/gyMPv19fc+K887/ngD5IVnxzBzGtXjKK TXlFR1fQoQskj6A2bhg9Kj7YVrMQK8su4cqhcDE6ohVprx1elX99zdco/SfVrdGKp0 hv2uhrdHRSujCjL9dwj2sHDqvqpD4yOPWi8BBUFJPRyQI8IY4Sgcm2J8EU/aJr8agO 0pK3tD2m0hOTw== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:26 -0700 Subject: [PATCH 09/14] s390/vdso: Drop unused '-s' flag from KBUILD_AFLAGS_64 MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-9-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1516; i=nathan@kernel.org; h=from:subject:message-id; bh=eOzKxLrRsBTq/MljE5/gHOkCQwsBUGjl8YrlO4iJnbE=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3Y/2p92pWtCrfcjzsJJVhnNfAnBHq5/rq8sYufa5lUR Enevo5SFQYyDQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAExE/B4jw+eK8L9yJiISoa62X1doum 5y229/SH/HIV7eHjPJ0ua6Gwz/jPb8OprUttuTOfrCtG0f3V67BM34wv1t2amjhTcmvr5SywUA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns that KBUILD_AFLAGS_64 contains '-s', which is a linking phase option, so it is unused. clang-16: error: argument unused during compilation: '-s' [-Werror,-Wunused-command-line-argument] There appears to be no equivalent for '-s' in GNU as; 'as --help' on x86_64 notes that '-s' is ignored and 's390x-linux-gnu-as --help' makes no mention of it whatsoever. Just drop '-s' altogether, as it has been there since the introduction of the vDSO, which means it is likely uneeded, given there would likely have been a report by this point. Signed-off-by: Nathan Chancellor Reviewed-by: Sven Schnelle --- Cc: hca@linux.ibm.com Cc: gor@linux.ibm.com Cc: agordeev@linux.ibm.com Cc: borntraeger@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-s390@vger.kernel.org --- arch/s390/kernel/vdso64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile index 9e2b95a222a9..a2fe9383d452 100644 --- a/arch/s390/kernel/vdso64/Makefile +++ b/arch/s390/kernel/vdso64/Makefile @@ -22,7 +22,7 @@ KBUILD_AFLAGS += -DBUILD_VDSO KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING KBUILD_AFLAGS_64 := $(filter-out -m64,$(KBUILD_AFLAGS)) -KBUILD_AFLAGS_64 += -m64 -s +KBUILD_AFLAGS_64 += -m64 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin From patchwork Wed Jan 4 19:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22CA5C64981 for ; Wed, 4 Jan 2023 19:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239830AbjADTzL (ORCPT ); Wed, 4 Jan 2023 14:55:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240263AbjADTzD (ORCPT ); Wed, 4 Jan 2023 14:55:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0986A1AD9D; Wed, 4 Jan 2023 11:55:03 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 956DE61812; Wed, 4 Jan 2023 19:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46AABC43398; Wed, 4 Jan 2023 19:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862102; bh=5O31/XAlnhwnQJPlhpwoSbHf+ZiDlbOC4a1CxUANeAk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gQmdMK/SRWnAee27fDhmXVD5oLyGSteYXSK2Yy/Ia5/p6Ow7SmjkDWqikzVDxG80x Amc2M5O7c4RZX7n/NT4dNjGoRtl0EykkYA+vHnR73JWZ7XaRlicpwSedZF3kCsxG8c tEPwFo6Cg8ivTUHIFhsPJzfhFA5SEyTfVe34z7dwAH7VF92EJeoaacOtIRzkkChuVv zEqrnXUJ8Si/1GrsAk98ThmSeM2vcjtG22C3agPniOczkdJejPen9wxbG+WMTZQ/RZ O+oRxhX4ixadzuu4na1OVUwLumWMdnHJpcW0/InccY7CcrscQhKJmKGZ8w94JrbSqI 1NxyFSAZcgYIQ== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:27 -0700 Subject: [PATCH 10/14] s390/vdso: Drop '-shared' from KBUILD_CFLAGS_64 MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-10-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1359; i=nathan@kernel.org; h=from:subject:message-id; bh=5O31/XAlnhwnQJPlhpwoSbHf+ZiDlbOC4a1CxUANeAk=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3Y7rfl6cl9SyN2pqtnZpq3hiZ9Yjl19ddDg3F6nGU1r mkPudZSyMIhxMMiKKbJUP1Y9bmg45yzjjVOTYOawMoEMYeDiFICJtFxg+CulI+7Yx7K0qfvWb/e9XS 4/D2dcd/RadsPHOPOk3qqMd4KMDEcnf29fV1fU9XuV7bTbi6TWO6Qv1uboP3lbvSnv1e037HwA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it points out that there is a linking phase flag added to CFLAGS, which will only be used for compiling clang-16: error: argument unused during compilation: '-shared' [-Werror,-Wunused-command-line-argument] '-shared' is already present in ldflags-y so it can just be dropped. Fixes: 2b2a25845d53 ("s390/vdso: Use $(LD) instead of $(CC) to link vDSO") Signed-off-by: Nathan Chancellor Reviewed-by: Sven Schnelle --- Cc: hca@linux.ibm.com Cc: gor@linux.ibm.com Cc: agordeev@linux.ibm.com Cc: borntraeger@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-s390@vger.kernel.org --- arch/s390/kernel/vdso64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile index a2fe9383d452..34f9542636e9 100644 --- a/arch/s390/kernel/vdso64/Makefile +++ b/arch/s390/kernel/vdso64/Makefile @@ -25,7 +25,7 @@ KBUILD_AFLAGS_64 := $(filter-out -m64,$(KBUILD_AFLAGS)) KBUILD_AFLAGS_64 += -m64 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) -KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin +KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \ --hash-style=both --build-id=sha1 -T From patchwork Wed Jan 4 19:54:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB63EC53210 for ; Wed, 4 Jan 2023 19:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjADTzj (ORCPT ); Wed, 4 Jan 2023 14:55:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240113AbjADTzG (ORCPT ); Wed, 4 Jan 2023 14:55:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49743E0CA; Wed, 4 Jan 2023 11:55:05 -0800 (PST) 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 39C80B818CA; Wed, 4 Jan 2023 19:55:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30D45C433D2; Wed, 4 Jan 2023 19:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862102; bh=Wq2xy5rFWf75vfk6CLmeCRvK7xMzUB8bK7uoSW9gNDQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kowh49BE0vlyOeGqVIEX40KPeHVEcDwAr6nyxSIsrGz3fErLZJ/U57mzRd7bHUO2v KJcxJQxr4Iu+UOaNjlbKkD3F1Mk/WeMZ3mQIgZlFKAJC9IvMeWcQE2qmw4VPku8DvO gv4rBxjsuKEqwKjSXUr3O8F4s5ZVc8bFQ7zJyBl3zrIHfVV01fLuQP731+ZlVxf3iM LEXQ0nboH+JrxYEEYqu9fYyeNc/i6D3cFwCMXwh52iXQAxsD/8RisCiZX8/Uqkt3Kv kmQycMaZqy7oRpoqnhx2EvcxQCV7gmLC+EnHh0xdZ8sAlGJKKqTN5Wgc+K/eUf6u5V uuKUMPFcbMeUg== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:28 -0700 Subject: [PATCH 11/14] s390/purgatory: Remove unused '-MD' and unnecessary '-c' flags MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-11-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1532; i=nathan@kernel.org; h=from:subject:message-id; bh=Wq2xy5rFWf75vfk6CLmeCRvK7xMzUB8bK7uoSW9gNDQ=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3b7ZBf/rn1s+nZr5eJ2yd8LEiWKcwNmRk34Xbvz1Laf FevaO0pZGMQ4GGTFFFmqH6seNzScc5bxxqlJMHNYmUCGMHBxCsBEbHwZGX5afPM8fnO9+KX1YeXbtD PDo+M4rjWu1izN4BLf/Fsmponhf4lvgOKFPQ8Zy7gvTT+W8oTX+LLVkQY2mXbeCxtObJzOzQEA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns while building objects in the purgatory folder: clang-16: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument] '-MMD' is always passed to the preprocessor via c_flags, even when KBUILD_CFLAGS is overridden in a folder, so clang complains the addition of '-MD' will be unused. Remove '-MD' to clear up this warning, as it is unnecessary with '-MMD'. Additionally, '-c' is also unnecessary, remove it while in the area. Signed-off-by: Nathan Chancellor Reviewed-by: Sven Schnelle --- Cc: hca@linux.ibm.com Cc: gor@linux.ibm.com Cc: agordeev@linux.ibm.com Cc: borntraeger@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-s390@vger.kernel.org --- arch/s390/purgatory/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile index d237bc6841cb..32573b4f9bd2 100644 --- a/arch/s390/purgatory/Makefile +++ b/arch/s390/purgatory/Makefile @@ -24,7 +24,7 @@ KCSAN_SANITIZE := n KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common +KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common KBUILD_CFLAGS += -fno-stack-protector KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_CFLAGS += $(call cc-option,-fno-PIE) From patchwork Wed Jan 4 19:54:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF1D9C54E76 for ; Wed, 4 Jan 2023 19:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240113AbjADTzl (ORCPT ); Wed, 4 Jan 2023 14:55:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbjADTzH (ORCPT ); Wed, 4 Jan 2023 14:55:07 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75EC73FA2F for ; Wed, 4 Jan 2023 11:55:06 -0800 (PST) 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 2924BB81665 for ; Wed, 4 Jan 2023 19:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17389C433F0; Wed, 4 Jan 2023 19:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862103; bh=3WzrVDuXq+USW1wkZml39mLL/ZYu3zbGbhzJyJTaIjI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZVc/xmAxP30rj7pQ8bnb8lKMBi5jVA1T6RkNRBFFwn+pZR7alSdElfuWXP345PJzF m/mqsSKcPcCV+c49p/aK6WTX9QLwhen8jAca1xfJ5/kVtSjMMrJjkThq7yMxlvyMpQ Spk2ZIlvC27RSybElCtvB57S3irGP7ERBPIEGOy3aBVwBI5R7ZAcb16S8zH5iUic4H oj9GyYCbQYVVsMT7UAP+Nla7yMjE4dbJqR4u3PDtBt7ELwdXhmCgCD4HN9crSKXdKr AoxoEH7YuUgw6qbx97LviiIFom0Hq8QqYgks7Eqs988RzmcCYRVMUfDsuagPOUog3L jUtI2hJ0hPJJg== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:29 -0700 Subject: [PATCH 12/14] drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-12-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1394; i=nathan@kernel.org; h=from:subject:message-id; bh=3WzrVDuXq+USW1wkZml39mLL/ZYu3zbGbhzJyJTaIjI=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3Zvv93PW778jH5o/NacxuiklqMCEnESqzz3PZqZ0vYv s8C9o5SFQYyDQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAExEV43hnwnruScrv0hWTWhKTGK7vW LJ1/iiJ3N9P9gaON/9X35jrwQjw7SCGVpZT56UNmzWL7ll3WV0W+nLbTHGqzZMs9aEdonXMgMA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns: clang-16: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument] Similar to commit 84edc2eff827 ("selftest/fpu: avoid clang warning"), just add this flag to GCC builds. Commit 0f0727d971f6 ("drm/amd/display: readd -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines") added '-msse2' to prevent clang from emitting software floating point routines. Signed-off-by: Nathan Chancellor Acked-by: Alex Deucher --- Cc: harry.wentland@amd.com Cc: sunpeng.li@amd.com Cc: Rodrigo.Siqueira@amd.com Cc: alexander.deucher@amd.com Cc: christian.koenig@amd.com Cc: Xinhui.Pan@amd.com Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/amd/display/dc/dml/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile index 0ecea87cf48f..9d0f79dff2e3 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -26,7 +26,8 @@ # subcomponents. ifdef CONFIG_X86 -dml_ccflags := -mhard-float -msse +dml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float +dml_ccflags := $(dml_ccflags-y) -msse endif ifdef CONFIG_PPC64 From patchwork Wed Jan 4 19:54:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C044FC4708D for ; Wed, 4 Jan 2023 19:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240243AbjADTzm (ORCPT ); Wed, 4 Jan 2023 14:55:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240246AbjADTzI (ORCPT ); Wed, 4 Jan 2023 14:55:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4723E0CA for ; Wed, 4 Jan 2023 11:55:07 -0800 (PST) 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 B8E40B818D0 for ; Wed, 4 Jan 2023 19:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 183F9C433EF; Wed, 4 Jan 2023 19:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862104; bh=GMQ0SwduuY/Xwbg4h7JUpehtJUeZBg5u+e9loL7IqS4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=u4/HrF5zesCj0gRuJ6LTJgZSEGYyRMykXJCjma89eOrGX2QRpscWFUKODyyvXarvk GNO8DJ2X8UYYgmWXuQ1XHVjxeEIanl8qGAlASo3d3rP9SyO9fwt+56Ymtnh/BUsSHx C3xEbT90v5dcWz/zRuJNCNAwZRq5UQ6auM49S80yT9zUzkAtlwS/C6+uC2vZ4V+IBV g2GB3O+hTiGmRvQWXgPpUeMHMuOB2UxtuuZJE79hDEmH9g7LiXZjLsETsjdYJioPRu q/9Q1DfJsh8k6F4GN2hVD66ppRbmtJuInHlCRLNKYWilc/UggC5LQCI7/F5UPpuWUf NPl61x9kS23Xg== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:30 -0700 Subject: [PATCH 13/14] kbuild: Turn a couple more of clang's unused option warnings into errors MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-13-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1104; i=nathan@kernel.org; h=from:subject:message-id; bh=GMQ0SwduuY/Xwbg4h7JUpehtJUeZBg5u+e9loL7IqS4=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3bftyiueSL/VJ+bSfLg6YDJa3P82Kbp35+i/j/t0Jb0 +6ted5SyMIhxMMiKKbJUP1Y9bmg45yzjjVOTYOawMoEMYeDiFICJOC9l+J975Hbq8j+H7ti/WJW8/H bH880RlyyY+x+mcEW69RqlMy9gZLj5c0/yWt8MobrXam3RhWFW25kY1dlqWZ3FhVXyFblP8wIA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Currently, these warnings are hidden with -Qunused-arguments in KBUILD_CPPFLAGS. Once that option is removed, these warnings should be turned into hard errors to make unconditionally added but unsupported flags for the current compilation mode or target obvious due to a failed build; otherwise, the warnings might just be ignored if the build log is not checked. Link: https://github.com/ClangBuiltLinux/linux/issues/1587 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- scripts/Makefile.clang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang index 87285b76adb2..70b354fa1cb4 100644 --- a/scripts/Makefile.clang +++ b/scripts/Makefile.clang @@ -36,6 +36,8 @@ endif # so they can be implemented or wrapped in cc-option. CLANG_FLAGS += -Werror=unknown-warning-option CLANG_FLAGS += -Werror=ignored-optimization-argument +CLANG_FLAGS += -Werror=option-ignored +CLANG_FLAGS += -Werror=unused-command-line-argument KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS += $(CLANG_FLAGS) export CLANG_FLAGS From patchwork Wed Jan 4 19:54:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13088890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ABDBC46467 for ; Wed, 4 Jan 2023 19:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240268AbjADTzi (ORCPT ); Wed, 4 Jan 2023 14:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240175AbjADTzG (ORCPT ); Wed, 4 Jan 2023 14:55:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226103FA25 for ; Wed, 4 Jan 2023 11:55:06 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id AD5B3617ED for ; Wed, 4 Jan 2023 19:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADF4CC43396; Wed, 4 Jan 2023 19:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672862105; bh=tTrQfczjuETaSOGxfQJLqsLErfJo6Bv4ivE/dvWNz9s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BJNLJlodI+/96CSfUaWvmMuOZ0oPdmLT1hEzgscMSOCXiFOY/QHUf59fy29zzeJ2K q51ZyIbB3bb/kGq66Un/MArKCxFtauq2xqmg67bwlGnc9GKER0SAZUq2ipjFHbVYmw vKPabcb8kMfigC+jIWDX2LQ+X5HfuiaAieyxXhVQtGwdAH0vGU9Gi6LpJThR1KcLSV AyXghJfsz77HlD3wLhOsU1hPERuvI0VUbjBbdxn6PujtwgdJWLTBZ11nqXHPz8heMo phkyaeoozS3Earu9aj2D3hcoes/4Y/UnESp0UxK+GdkmTeKu50CIXw12nNm3FbCn03 vS6YV5NlN0oJA== From: Nathan Chancellor Date: Wed, 04 Jan 2023 12:54:31 -0700 Subject: [PATCH 14/14] kbuild: Stop using '-Qunused-arguments' with clang MIME-Version: 1.0 Message-Id: <20221228-drop-qunused-arguments-v1-14-658cbc8fc592@kernel.org> References: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> In-Reply-To: <20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org> To: masahiroy@kernel.org, ndesaulniers@google.com Cc: nicolas@fjasle.eu, trix@redhat.com, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=958; i=nathan@kernel.org; h=from:subject:message-id; bh=tTrQfczjuETaSOGxfQJLqsLErfJo6Bv4ivE/dvWNz9s=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMlbb3Zf+xR/N3ltT1dhPZfFafeOWZcXhbeyHZjuyhV51PNb sc/RjlIWBjEOBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCRFV4Mv5j3Ly5fzPpzQ+xyR1uf03 leJ3x8YlnCzJe+7gybMkf7bRHDf2fbtIVn7n8p62EK9w83iBZm+LfFtjKucD9HJbdYk89GLgA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This option masks all unused command line argument warnings, which can hide potential issues, such as an architecture Makefile adding an unsupported flag to KBUILD_AFLAGS or KBUILD_CFLAGS, which will cause all as-option and cc-options to silently fail due to -Werror with no indication as to why in the main kernel build. Remove this flag so that warnings of this nature can be caught early and obviously in a build. Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index c05b4fb7121e..4bc79d2a42f2 100644 --- a/Makefile +++ b/Makefile @@ -878,7 +878,6 @@ KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y) ifdef CONFIG_CC_IS_CLANG -KBUILD_CPPFLAGS += -Qunused-arguments # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. KBUILD_CFLAGS += -Wno-gnu else