From patchwork Thu Jan 12 19:51:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098745 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 2DD5BC63797 for ; Thu, 12 Jan 2023 19:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232083AbjALTyP (ORCPT ); Thu, 12 Jan 2023 14:54:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240218AbjALTxs (ORCPT ); Thu, 12 Jan 2023 14:53:48 -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 AD1DF1D6 for ; Thu, 12 Jan 2023 11:52:18 -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 4905C62178 for ; Thu, 12 Jan 2023 19:52:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B48FEC433F0; Thu, 12 Jan 2023 19:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553137; bh=u6+yBWXwlJoJ5QKUR3rLnp8LjmUI7kWiCb26aeGf9b4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tT8CBbYfUxpiwY9BAs2kt6xrfDvINXVkVvh83wXJtq+XmlQOF9EImoIuQdT7SC1Wi SQenIEG8ZUCe4+d26aSHCwJppBwG1/go4aNUHY+5T7agT3+rRmku15E4DoEd1/C4/1 kBLaZG7G7MDy7s5n6+V4N2RIpHNaM0IltUI6HWuqrTvin76eoZJlYJU9FXgGxlYrue yvcUSnwRMv3cJwnVwnmlnAETRTCbgMUsEMKC+IL7G6hjo+N2s++iRtoe8iLE+C5UNr +lAuOB0UNqGEwgv+6sdGBofodAplGV1+tMu/d6bTo/MKe9jBvTUyjCvRxoePWyxOno B3cMqdIqnoSVw== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:47 +0000 Subject: [PATCH 1/6] kselftest/arm64: Fix .pushsection for strings in FP tests MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-1-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1036; i=broonie@kernel.org; h=from:subject:message-id; bh=u6+yBWXwlJoJ5QKUR3rLnp8LjmUI7kWiCb26aeGf9b4=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGToDfmBRw3aMYCrY+koTvPBIZmSV1XzYVl+0CFR j9N+3q+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6AAKCRAk1otyXVSH0L7rB/ 0WfOLlpAWfJg8CT1tANCZiXVIrxqeLnOvTnMpKvcDkEdVARFwSrK+B2w/jKO4gHiQT4kZJQSLRK9cR jrK86NA9Yad0czjbl1hKaEswMtIpIohAFllEWly9HP3MliHdF2tb/Zgxh5T9hp+KFKsoMgzUEt9KKm tmMbKG9tGeqcz2EMNkw8dYh2Pv7caXfr3Jj8BWxA9bEWKGs4BIR4AdK7XzFtNdH9kMjVDxRmKuCy1r SMgbUHjUx5XaRtyGohRSSiJ14PFPgCrwfGSFeXXDTZfLRONZtT7ypalxyPTorHWgsZKm2jKznraQl6 6qrLakds5hclklpgQ+uL4HcRmdZ/BJ X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The .pushsection directive used to store the strings used with the .puts macro in the floating point helpers does not provide a section type but according to the gas documentation this should be mandatory and with the clang built in as it actually is. Provide one so that we can build these tests with LLVM=1. No functional change. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/assembler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/assembler.h b/tools/testing/selftests/arm64/fp/assembler.h index 90bd433d2665..9b38a0da407d 100644 --- a/tools/testing/selftests/arm64/fp/assembler.h +++ b/tools/testing/selftests/arm64/fp/assembler.h @@ -57,7 +57,7 @@ endfunction // Utility macro to print a literal string // Clobbers x0-x4,x8 .macro puts string - .pushsection .rodata.str1.1, "aMS", 1 + .pushsection .rodata.str1.1, "aMS", @progbits, 1 .L__puts_literal\@: .string "\string" .popsection From patchwork Thu Jan 12 19:51:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098746 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 E48D9C61DB3 for ; Thu, 12 Jan 2023 19:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232135AbjALTyQ (ORCPT ); Thu, 12 Jan 2023 14:54:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbjALTxu (ORCPT ); Thu, 12 Jan 2023 14:53:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B877228D for ; Thu, 12 Jan 2023 11:52:22 -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 63C5EB82021 for ; Thu, 12 Jan 2023 19:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23154C4339B; Thu, 12 Jan 2023 19:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553140; bh=nY4bpK4Ck7cDPkgC/IhOZ5jeJAItWSvowi3Q3Mk3wv0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NNyFLjafIIfmG/gmmbTNu/sXFUWW2nPT/KF0tXmUf8A3AsiLcW9+1yqBPEcgaq+8+ QqPdHymz+hxT3GCnsmAGQ2wGYfFuEhCtAAbUYsFAaedjYVEyC2meZKaCRvVgMNAuuw sxiKH80CbvDPN5B+1JsTtjuLcBtk4IdGgbCnYoP4KJYHClSkQ08AiXuJlBEu2xqFjd ClvLXMQV3SSS0JNCe0vzKYqeUzAblrYxUX7y6H0r/9C+ndpH0TLWId3blT+zVHIQa6 YlE8vMzX0HFOIdotQSTVLc2TylT321+OJfq1mzSXi2FdRupSHb0qUjE42aE7Tbao/5 KUJfanang4v3w== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:48 +0000 Subject: [PATCH 2/6] kselftest/arm64: Remove redundant _start labels from FP tests MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-2-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2429; i=broonie@kernel.org; h=from:subject:message-id; bh=nY4bpK4Ck7cDPkgC/IhOZ5jeJAItWSvowi3Q3Mk3wv0=; b=owGbwMvMwMWocq27KDak/QLjabUkhuQDKS/Tgr6kfuizvHC94dEytQWuQkccqq0Mlh5nTwwU1HUL 2MfWyWjEwsDIxSArpsiy9lnGqvRwia3zH81/BTOIlQlkCgMXpwBM5CQ3+zelOVpO9stT91Zbx8uUHu y5stvlk278sn8i95caPpnuXjOtQJS3Umhrhqn8XqufdgGfO764Wyw6EH1bfOmlfjsVlTjp+4XJK7+o /z7az+JRaTeHITw+XjSY4+nJ6eqWB65tL2bdYF6f8i75oubCe/zV/S92WmqKbuzfIX6CoXYO08c9Ts VrTlxI9OL6zbyv+vrG3zmTC295SlsXVKs/ls4JmiPmnGoq+7pou9kOZU2V8rmOUfXddU7RnxgmHLII UrdxevtN/dj+kngPebn9upIr+fgZXZxKflvbXCzK6tpmau++f+GKvm1HPmQy25pLKx8qKj1WwOH24E f4N3FGR8G13Tf3mBUpXsj5yg8A X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org There are a number of freestanding static executables used in floating point testing that have no runtime at all. These all define the main entry point as: .globl _start function _start _start: but clang's integrated assembler complains that: error: symbol '_start' is already defined due to having both a label and function directive. Remove the label to allow building with clang. No functional change. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-pidbench.S | 1 - tools/testing/selftests/arm64/fp/fpsimd-test.S | 1 - tools/testing/selftests/arm64/fp/sve-test.S | 1 - tools/testing/selftests/arm64/fp/za-test.S | 1 - 4 files changed, 4 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/fp-pidbench.S b/tools/testing/selftests/arm64/fp/fp-pidbench.S index 16a436389bfc..73830f6bc99b 100644 --- a/tools/testing/selftests/arm64/fp/fp-pidbench.S +++ b/tools/testing/selftests/arm64/fp/fp-pidbench.S @@ -31,7 +31,6 @@ // Main program entry point .globl _start function _start -_start: puts "Iterations per test: " mov x20, #10000 lsl x20, x20, #8 diff --git a/tools/testing/selftests/arm64/fp/fpsimd-test.S b/tools/testing/selftests/arm64/fp/fpsimd-test.S index 918d04885a33..8b960d01ed2e 100644 --- a/tools/testing/selftests/arm64/fp/fpsimd-test.S +++ b/tools/testing/selftests/arm64/fp/fpsimd-test.S @@ -215,7 +215,6 @@ endfunction // Main program entry point .globl _start function _start -_start: mov x23, #0 // signal count mov w0, #SIGINT diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S index 2a18cb4c528c..4328895dfc87 100644 --- a/tools/testing/selftests/arm64/fp/sve-test.S +++ b/tools/testing/selftests/arm64/fp/sve-test.S @@ -378,7 +378,6 @@ endfunction // Main program entry point .globl _start function _start -_start: mov x23, #0 // Irritation signal count mov w0, #SIGINT diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S index 53c54af65704..9dcd70911397 100644 --- a/tools/testing/selftests/arm64/fp/za-test.S +++ b/tools/testing/selftests/arm64/fp/za-test.S @@ -231,7 +231,6 @@ endfunction // Main program entry point .globl _start function _start -_start: mov x23, #0 // signal count mov w0, #SIGINT From patchwork Thu Jan 12 19:51:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098750 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 4CB2FC61DB3 for ; Thu, 12 Jan 2023 19:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbjALTyT (ORCPT ); Thu, 12 Jan 2023 14:54:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240256AbjALTxw (ORCPT ); Thu, 12 Jan 2023 14:53:52 -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 6DAE63AC for ; Thu, 12 Jan 2023 11:52:23 -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 0A2FE6216F for ; Thu, 12 Jan 2023 19:52:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 865D1C433F1; Thu, 12 Jan 2023 19:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553142; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sEwDAdHG+WS9hN6kyw8Xez5NVsbVf5Kn1PAxwDW2AOp1xcpAf/IrQaE5jWWWN9Mp7 Q3GV8VUZsbrM4LNoU+EpIKpq4uyeydyXxODfl+eSg/4TRFTwvFNERkbamnGdvxFWRT pClywv+UHvLXlSHlloHydDWFKk5lm+EtoViBRPt9+1kx2PXy9zwJrjIa+I1OS4Lq42 T+GnVHdkixPsxMOplHZVpRfekMXgs2baCetD91ADVBAnvNuOsm5NW7dzFEjzYHTGed +ZZznKUSAda2/dZTDSFvw5a0r9UNM9iBxinm+CKBprUuegAZnZ4Dnnq9YeX1+o2TPN jvG/iN8MRRDBA== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:49 +0000 Subject: [PATCH 3/6] kselftest/arm64: Don't pass headers to the compiler as source MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-3-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2253; i=broonie@kernel.org; h=from:subject:message-id; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTp/f4zdF4G6Q+1ACaPAaVth3j1KTCyjFadZQDV xgtTaKqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6QAKCRAk1otyXVSH0JMOB/ 0WNFW0Jm+7kLZdGWl+VaZ4OSqlRsDp8yCHKDqTnxQ2j1ByMorud1Sz50ptaH+0Upm4QDcreK+/zn4Y pdD1M2iLk5LIZQBNe/8V8A8wH08UK3vPG2JCZczQdKZI97s9r/a1zCvi8iu5K+IiW1s4MttKQZPjMx /rzViMmQPmSakWp2GgIq9ia2dKXh5Re8n126CU6xcOjhcP2zelOvr7+kzpF3t+kGCOgC18f9Ey3AfU CJxRzx7HKv1nEK70BMoDC/cNW6boL8JvetV5j/Bhmrq6VEKp99pcQSPCo8vz/IsgTAQUtrwyAQSi3w MAmOeCOOy+wsQm/7vdl92ihLsD6Mxi X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The signal Makefile rules pass all the dependencies for each executable, including headers, to the compiler which GCC is happy enough with but clang rejects: clang --target=aarch64-none-linux-gnu -fintegrated-as -Wall -O2 -g -I/home/broonie/git/linux/tools/testing/selftests/ -isystem /home/broonie/git/linux/usr/include -D_GNU_SOURCE -std=gnu99 -I. test_signals.c test_signals_utils.c testcases/testcases.c signals.S testcases/fake_sigreturn_bad_magic.c test_signals.h test_signals_utils.h testcases/testcases.h -o testcases/fake_sigreturn_bad_magic clang: error: cannot specify -o when generating multiple output files This happens because clang gets confused about what to do with the header files, failing to identify them as source. This is not amazing behaviour on clang's part and should ideally be fixed but even if that happens we'd still need a new clang release so let's instead rework the Makefile so we use variables for the lists of header and source files, allowing us to only pass the source files to the compiler and keep clang happy. As a bonus the resulting Makefile is a bit easier to read. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile index be7520a863b0..8f5febaf1a9a 100644 --- a/tools/testing/selftests/arm64/signal/Makefile +++ b/tools/testing/selftests/arm64/signal/Makefile @@ -22,6 +22,10 @@ $(TEST_GEN_PROGS): $(PROGS) # Common test-unit targets to build common-layout test-cases executables # Needs secondary expansion to properly include the testcase c-file in pre-reqs +COMMON_SOURCES := test_signals.c test_signals_utils.c testcases/testcases.c \ + signals.S +COMMON_HEADERS := test_signals.h test_signals_utils.h testcases/testcases.h + .SECONDEXPANSION: -$(PROGS): test_signals.c test_signals_utils.c testcases/testcases.c signals.S $$@.c test_signals.h test_signals_utils.h testcases/testcases.h - $(CC) $(CFLAGS) $^ -o $@ +$(PROGS): $$@.c ${COMMON_SOURCES} ${COMMON_HEADERS} + $(CC) $(CFLAGS) ${@}.c ${COMMON_SOURCES} -o $@ From patchwork Thu Jan 12 19:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098749 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 7964DC678D6 for ; Thu, 12 Jan 2023 19:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbjALTyS (ORCPT ); Thu, 12 Jan 2023 14:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240258AbjALTxw (ORCPT ); Thu, 12 Jan 2023 14:53:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF63B91 for ; Thu, 12 Jan 2023 11:52:25 -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 69FEB62169 for ; Thu, 12 Jan 2023 19:52:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E02C0C433D2; Thu, 12 Jan 2023 19:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553144; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sIBKwM6q2YIoegjX0mohwbxLZDvtg1x7VE5rn/66w7ZeSqLQCpyi7Haj6GcbHL6EX d3wEqU1n01YsoXaCDqglbLpFO6O/2DfYm9v9AyoGeO5Gv29cmVsj/JN4laS4tA2G6Y fdJ8Q3oYijHq1pWEK/zVM7DmOUix8oitEt3if7gIRvddCCxeXXKwO/+MBGXKGm0xvS WEqQG+X2ubN42vYPdFbtyKrPCOKxrGgnG8VqnNrdHTFwjlVw6Boj7ZsfyLEfHdVpyd LzTI05jKJ7gT03Dniby8DwWuAq4vHVNgXIeNt4MNpFbqKe25ryKjUV91uMQp5o4uad hrDmHC87maTqQ== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:50 +0000 Subject: [PATCH 4/6] kselftest/arm64: Initialise current at build time in signal tests MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-4-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1382; i=broonie@kernel.org; h=from:subject:message-id; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTqYecAhNJ/68Hz+3JWPKmFN3mjZna3w4n07K/K h9NKUNqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6gAKCRAk1otyXVSH0DYxB/ 9YH/AZ4hQW8JJhM5Y7Ox2Deko1Gjgk+ShcDmSER+HI7olFW73U/z/vsd2yD0GFFGZcxD5rPG+4ODpA u11zn3hPs6rtbaeHK15IFpBI8Ce96gIVu2kinFt1mL6MOAuUGZ+thzKro4Hl31ffHz8YcsC08zn7/V 0w9DjWZ7rCXnNhHi/1U/Qtifen6vSRHS+hXIjm8DCB4raN1qq+4mqixf9DpbZqB7pqjMOtjaR6Mkjl UDRHQJpV+skBGnz7fm7xU1i69GAWR+yqIpV6Duh8LGYbCbF9du6YwgBSfkQh+bb1y9jhqcr8K0qDAh hCrgsiiqLndHDckDbIHEAROl9fkv9Y X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When building with clang the toolchain refuses to link the signals testcases since the assembly code has a reference to current which has no initialiser so is placed in the BSS: /tmp/signals-af2042.o: in function `fake_sigreturn': :51:(.text+0x40): relocation truncated to fit: R_AARCH64_LD_PREL_LO19 against symbol `current' defined in .bss section in /tmp/test_signals-ec1160.o Since the first statement in main() initialises current we may as well fix this by moving the initialisation to build time so the variable doesn't end up in the BSS. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/test_signals.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/test_signals.c b/tools/testing/selftests/arm64/signal/test_signals.c index 416b1ff43199..00051b40d71e 100644 --- a/tools/testing/selftests/arm64/signal/test_signals.c +++ b/tools/testing/selftests/arm64/signal/test_signals.c @@ -12,12 +12,10 @@ #include "test_signals.h" #include "test_signals_utils.h" -struct tdescr *current; +struct tdescr *current = &tde; int main(int argc, char *argv[]) { - current = &tde; - ksft_print_msg("%s :: %s\n", current->name, current->descr); if (test_setup(current) && test_init(current)) { test_run(current); From patchwork Thu Jan 12 19:51:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098747 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 9FEF7C54EBE for ; Thu, 12 Jan 2023 19:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231814AbjALTyR (ORCPT ); Thu, 12 Jan 2023 14:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240260AbjALTxw (ORCPT ); Thu, 12 Jan 2023 14:53:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46946C61 for ; Thu, 12 Jan 2023 11:52:28 -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 CAB9D62161 for ; Thu, 12 Jan 2023 19:52:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47950C4339C; Thu, 12 Jan 2023 19:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553147; bh=QmqB4tlR6U8BFzd9JJsRGVi0Xek+w56l/71nPQDypns=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KIs0ci0945zkDLMc7Y6BAH0Ni/LilgpVNeItZVTHSuduQ7WOU1VP06/ejmjckdMQM G6YZ8jDGWqdOTG1VUqCEOJMyJKhSHcWWK44Vi5sfT9xdz7kylarWRYDC5NCWrEwhn0 2XkBFe4HfWOXct/y/5sGlG/3tPG0MDzC60zjXA3xK7Xg8NQustBSYW7BJLtsRScLsa C/HP7kQBZQIUxdMQJ03bIhN5mVttu3e7Xl6n/sogpBfnxoCuTwRDZyKHWLyy1gk49u xyTDf/a1cg8mh7E6Q4QldVQ3OeGlEpAZSqpIayrO1uk7+6Fj7nmej6R8k8256NEzFj ATHMB9OwPM8aw== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:51 +0000 Subject: [PATCH 5/6] kselftest/arm64: Support build of MTE tests with clang MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-5-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1910; i=broonie@kernel.org; h=from:subject:message-id; bh=QmqB4tlR6U8BFzd9JJsRGVi0Xek+w56l/71nPQDypns=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTr/dveUlthPKb/Jm4BV50ZdjQ/TD3DOUtj2slE oMqCu46JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6wAKCRAk1otyXVSH0HCQB/ 9LqXrVxyKEjXgtmcxf4ooUM7a26O3dIUTegMwxRUwnw0rLT6g/LlcZbYkpn8Ay1bW+jEYHFwE5muhd 5N5SNPCvyA3cs/Swv20RuvXlTnBDaDw0TvGoH/bSvJEWeUOSrwLbdydIs8/5i5p7kX2+6yZQNhVvji FgxBkBj5qPcjDLXpMrSWMKQQ+NqWqX0fojOETQwmYnfYUetWSRBt1KPufCuwx6Hjom5jOSRxvnx1F0 a369jjQ81c7RQUq0rzsSpjHglsYLbMWbbZXrYD9F7NiGAsZxSYvfEiv8PD381z6AM+e/d2pMdnqZHn qbbmYvAXdzHJ73eOc9vhkiGvs+wt2d X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The assembly portions of the MTE selftests need to be built with a toolchain supporting MTE. Since we support GCC versions that lack MTE support we have logic to suppress build of these tests when using such a toolchain but that logic is broken for LLVM=1 builds, it uses CC but CC is only set for LLVM builds in libs.mk which needs to be included after we have selected which test programs to build. Since all supported LLVM versions support MTE we can simply assume MTE support when LLVM is set. This is not a thing of beauty but it does the job. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/mte/Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/arm64/mte/Makefile b/tools/testing/selftests/arm64/mte/Makefile index 037046f5784e..fdb9acdca42b 100644 --- a/tools/testing/selftests/arm64/mte/Makefile +++ b/tools/testing/selftests/arm64/mte/Makefile @@ -1,19 +1,29 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2020 ARM Limited -# preserve CC value from top level Makefile -ifeq ($(CC),cc) -CC := $(CROSS_COMPILE)gcc -endif - CFLAGS += -std=gnu99 -I. -pthread LDFLAGS += -pthread SRCS := $(filter-out mte_common_util.c,$(wildcard *.c)) PROGS := $(patsubst %.c,%,$(SRCS)) +ifeq ($(LLVM),) +# For GCC check that the toolchain has MTE support. + +# preserve CC value from top level Makefile +ifeq ($(CC),cc) +CC := $(CROSS_COMPILE)gcc +endif + #check if the compiler works well mte_cc_support := $(shell if ($(CC) $(CFLAGS) -march=armv8.5-a+memtag -E -x c /dev/null -o /dev/null 2>&1) then echo "1"; fi) +else + +# All supported clang versions also support MTE. +mte_cc_support := 1 + +endif + ifeq ($(mte_cc_support),1) # Generated binaries to be installed by top KSFT script TEST_GEN_PROGS := $(PROGS) From patchwork Thu Jan 12 19:51:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13098748 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 55CAFC678D4 for ; Thu, 12 Jan 2023 19:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbjALTyS (ORCPT ); Thu, 12 Jan 2023 14:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240269AbjALTxx (ORCPT ); Thu, 12 Jan 2023 14:53:53 -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 9FA1FC09 for ; Thu, 12 Jan 2023 11:52:30 -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 3AA8E62178 for ; Thu, 12 Jan 2023 19:52:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4754C43398; Thu, 12 Jan 2023 19:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553149; bh=ICx+HpIiOzKXWwzoSA2cqLawt3Xl+ru72A7xtP7W+TE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WF7lQj6QfR9mCeU3KNbxa00ixi29nLbkHEig9oxDsaAr0FdI4BcYqcbxHFlf1TDvI A5IC6rvcVpGFytrxXl3baAyQ7JC5tIkXP0jYA7BfRGEUWdeUu3HoiodpEyXNby1wb0 ltBTyewDPHv9tuB0+4oCFBlMALCbLwidiz6QQEHbQ+I7xznGg0kdjwEgyz5ALSJmEo IoWy1G4BVGki4RnQGICdf+cUUckBZcG+Pb45NObyf1kG60e6E/jjXLvE9iVwC7MXwI ONpTwU7Xkp09D2x+t+hzst0tQMDfOoqkEmsTIb9LXa+ZbVbYw3wuz8qQnBrLLFkB8F kElqhkz6Pz76w== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:52 +0000 Subject: [PATCH 6/6] kselftest/arm64: Remove spurious comment from MTE test Makefile MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-6-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=838; i=broonie@kernel.org; h=from:subject:message-id; bh=ICx+HpIiOzKXWwzoSA2cqLawt3Xl+ru72A7xtP7W+TE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTsWNGGWScK+qgi2htLnu3tdBn9KAu5AdQrMhHr AfaKf6iJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk7AAKCRAk1otyXVSH0MsdB/ 96aT8zdvFD9mXGi3MABvxk1I0jrSNXBwDkydqEddqdCLaAPefZ/nRWjTma+Kvfsl5p8WTb9EuUjFNS bWlVUXZprYcpOO2O0+M48SofgglVTkvNmQXN9j4R6dTrs1E5e0vaQIOMiOt0wjllaQ3TysvLb8pE6B l+IWl5Hpl7zqG5jRES04bbeocgXL72B3NOqQZ/N6OBfYqEeQe5KXJTxvU6J2Cl0GCsk0gqpCAHsj+N gfLjEEj/worbYSFSH8sdMxW1bjtt0RREpC52FHMbx2E2o93EWPWOZVD5D/bl+/lfTW707OTxmO+twB UsVi0ecJdVY3n9aBlDSHFw0r+UX7Gd X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org There's a stray comment in the MTE test Makefile which documents something that's since been removed, delete it. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/mte/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/arm64/mte/Makefile b/tools/testing/selftests/arm64/mte/Makefile index fdb9acdca42b..0d7ac3db8390 100644 --- a/tools/testing/selftests/arm64/mte/Makefile +++ b/tools/testing/selftests/arm64/mte/Makefile @@ -28,7 +28,6 @@ ifeq ($(mte_cc_support),1) # Generated binaries to be installed by top KSFT script TEST_GEN_PROGS := $(PROGS) -# Get Kernel headers installed and use them. else $(warning compiler "$(CC)" does not support the ARMv8.5 MTE extension.) $(warning test program "mte" will not be created.)