From patchwork Thu Jul 4 07:24:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810538 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9964E1A257B; Thu, 4 Jul 2024 07:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077932; cv=fail; b=Y3vEbwhsDLUeCZtqowmE8sG3d5Y/kPU8ZyIJZuoqK/iFql0NiTohdxfJ2ysspFWPmjFXTJcIGlNV5peXKUw3HT5GHpvgE7mIT3dwj2xJ5p6xJZueLMkVDX0CmlRiuqYg1OccuYV8qTc9Ug5OnM9kE+7vQ5EbCr16+Gqn2sORw8Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077932; c=relaxed/simple; bh=DTgQyBw9GXIK9jtF+2JVzwIyY7Rc1dncgmx3AN8ftAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=AOkLhG6YqCNLcreEYJjw5YrEC+F5Eo0+g0cBMXABGPIg6yfK4oY5Uk09rGjYUlMGwV1rShVgULJX97wMWKwvmua9ALh66Il8ixmoZmbdt8+7mMiWjJheG89cAioPz5qICKBEj3/e4z380WwJYiVnbXwWN8qF+5xTEQCvJVEOcBA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=fc9XRb4R; arc=fail smtp.client-ip=40.107.93.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="fc9XRb4R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fo4K2mTaQY2J91KIybMea/E8Vy3hAeX2sDPSpWgS0PQ+xZTjWSZsPRCKLAEynsNMs6ke4fQErJ18OFkCZ/P+nnzo+011wyNPzdo9swaRvV9GFdAAreSJUcgO7UQcy+ARFr0SQsgbuw/wu3boW+17lKM1sDdTTzXCwv7Vwq83UDhdqoVjdCVgTB0b6ooKrQ/Rhjngu8unAqbp0n5SbXFcXbqXO6fH7UbGtGXCOLTnPusS4CFa13etc29nG2cAD6luaIipR+e5LDnjIJYekAHbILnEsNUA8HdecWFYXFwcvgxoRz38Vp5hX//fivEzdA8uA28gydtKcMB7M/I23Z9yOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TiO9fnNaxrpy1qMqk2msiESE60kkn1veq7Dl0qy3pms=; b=fFLi2BqVUDeLIHRlvbhokcl+m/rvvmxzvV/9sw0PQ7XT9jdHqFV64ScqjEHbIh9Sn3c21i+w7kRLFIEwSddy870tpL2B9/MV9M+5QSBwMZKgYqEu8F+BwCm7K9IIKwORRWYhAJVvFMldq4qwWjG8G8JLwRwduMTDRQFe2TBFWsLxCEiYcOzVczAZ314IXr7bFvGye/HvklCojvkJePhbnQxkeueKYCKM11Rmay8VwU5SL4kc5DSWxVnwxa0ThR+0B9wcTGozTyH3JBs+8C9rvkUHnGSTmXdaRMhQ9UcfNjz/47TAsMiM5FJlwbJlnAN1nFHH72WS5agj7v7zleKavw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TiO9fnNaxrpy1qMqk2msiESE60kkn1veq7Dl0qy3pms=; b=fc9XRb4RZAHFD/fmg2afykAp/X8xi5Z486Oa3W3JL4nHS0y5BsPPUVh18nqLWz+EJnPsIiE4TPRYwI3sTco/tVnXo2uAiz3EUjK2FnarbeBYHrpXy5typV6yDi5MDtYWwm6aw9/4HIMe/EnbIAZ7LryLSQYDgh/Mss+3dd0LiwotoWNyzl9WQ9N0bbv/tB4Nr1Bj0NsVUuF5yhjbghodF88VxKnRNXjduVW7MwkFhWZnpxTdxHZRda3XwmsdDIAjUwUXDQAhSDs1TcaEf7k/+8qdXCn5/cKPF5JpqFpYeR7Un520zPSQ4NXh0ffNgozHf10LVnlc0+gI1uuLsAxFhA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:21 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:21 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 1/7] selftests/x86: fix Makefile dependencies to work with clang Date: Thu, 4 Jul 2024 00:24:25 -0700 Message-ID: <20240704072431.111640-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0199.namprd05.prod.outlook.com (2603:10b6:a03:330::24) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f66860f-a632-4262-6859-08dc9bfa7688 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: XsxTyXSUfS7i55Jq6x/dEy+M3A39XRb01mnIsAV9C/4aaAJ1QKtdOBFcnOniuiPuxO56hEvM70UKuorRBCF6m9VtxaCfczsrFvCx9hGqdJYV42c0PMrp/4AVLgzilhXnFwRoHflOa4Ts0YXVVb/jR+NFJQIwEwP80d/DI622/9iF6Fi4DmQ+daJazmUMOLc+0jWnwsAOV4s9FIJa+P1YiMOqk8NFpNmvo6qmFPiA5rUvu65WlQXWDpSlTSMKqBAkA13jQxprkEL0quM5V/yMBT3KSQviMMmhK57hzb6ErFJRzHmK1wjTY9qBeHixtto2DIP8IdFgbwJhh7MJWmX418h8mUoh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:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vz0qcBIzSrgdaI+C6DOoQkPpCZwitjYANQkZFXi5QU5ohoFj3zKl4z6nUnoBxjlYfxkp5kug5C6sAn6TGLHJx4o6hUmYCiXsSLNWEuWH8kwEYiTCvp6Mt71R6MltkK7wwrLHowYruq3QSdZ2FRTalitqUMJmb5r1fa5n6ccEYzK9/r9eudGira7IAskypGkaBmsustglZP4D73zRq/UPXry5JSFJJCIuRrWjOsuqmj90PgxFM1d9/XUlrYnP0KM5oaE2R2kKluNx4TQp6aN+SBZDcoKrvrZGGY5ZDPbetPv3kKjFa8F0LDl5p+WCuo8YYh/yw2I8OHToe4F+MNF89ofnIunEBgtNXX+dIF+eLjKlfGHaQAIr2vc1Ymoa8+05l2fugsTi8oE5iAQ0HOCOqbkq52BrlBc5ZcNZVzlhn5vPmCplxHTWDJbJdbxpak1zaQBtqRpT9+wm4UG7Ot/ieaVT2wZ15NjTQXvgb0L/5wGJMkUbh72Z5ipApKgW1qLb099HfyAP9RGugh7doJR8RZyXqPJDPQJt+leuUdSPEG08Ed/l5UzLSU2PdLaoVtzMseCw8Jo7tV7vsqg5wAsjyMcxzskq1Ej5Va3u/XKcjWozJhmzBQJNFGff64fciZI+3DYYVUhdWjiLU50vrTGesEVeJHwPISxQFJu5QuM0N1lGlW3Fk75mL+EZy34xLvcYYMLksmRrT1XmH9+SYJmTMAsDrYaemag6oGM1j8z501RZinGTWAdvobt9Qk0sCoLESxP7tvASHm5y+Ibh0Lh7QXwXriNNfZC1QA0RFtZ0AAU9AKojirz/SYhNBrLH+XBAslKq8SU69YWky8z14Uk7s9SYGpjozeQZoXS2bveUDUHsu2SrGmuvraffU5DnvMMh04Jz2rNulrQI4zgX7vcIMxrWKIjRR47YW5BYyw8s5iBiN6wuHHkMTh6x43NIPLtaa0ZFz8LmBzZ/U+2UdKqxgdCNYyCp/QmAJ0SY3PyittGANuOs9QRRQZFnvHyVsJJMjhxS43FNXdubyNy9TsO4smsg/poSjycD2boZRmSeA68isI99YLnCg27zX2Q1maKoULhtlIzdTVIUkpwIZfLgkoCxRyuv6Wc0GGwtuVrIrojIINa32WA9VSsd19dU3g7SDNtI08DZetppxTnFpdck4C/OFQUN+GCZuIyetSHqp+47d7T1VqBktg4x6uXZ/uUjSZ2simCbutqtFBo8TBJV8gRLgF1P6UR8O3kDhDuclvt6nCZz3QBo7H8d78vruO926LGjI1iNKJgzMR+WZZSda4lTrghGf+q/4F4N0Q0It96874HYG9GJ7woW67XTPdOhtdkdeVAzUmso81z8rYuJ4OwyhsdjiLc8m+t4cJmQ832ELkQPF9cSyvfGaLNls/rvESutZp6jdRoTHzwTmyVJsWPvHkdboo4MIXhih6YNWZ4vbfn51WLFnqq6ZJTc+G2Bmhy4X2mgcBZ5mOBDOoQB/zmBxe42zr425JhTz7XB4WT/LCpRBi3L/tB2fja2VTdTEw3fLyMOACJSMVkXSC3yEjMYRGJdWEJcR1ZTBMMQSr0Oci5ONb6mqtqy9d7KMg3xoTGYXNmPXb8FQyMsuHAesg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f66860f-a632-4262-6859-08dc9bfa7688 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:21.3164 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TbsEX/Uq5N4u8kBacoCHDT/0nyd9mvvr9RDv1GxuzN6CKLcVZSY9+gHNJNJwKr7zyv942Bva83VjB+gFLc/vGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...the following build failure occurs in selftests/x86: clang: error: cannot specify -o when generating multiple output files This happens because, although gcc doesn't complain if you invoke it like this: gcc file1.c header2.h ...clang won't accept that form--it rejects the .h file(s). Also, the above approach is inaccurate anyway, because file.c includes header2.h in this case, and the inclusion of header2.h on the invocation is an artifact of the Makefile's desire to maintain dependencies. In Makefiles of this type, a better way to do it is to use Makefile dependencies to trigger the appropriate incremental rebuilds, and separately use file lists (see EXTRA_FILES in this commit) to track what to pass to the compiler. This commit splits those concepts up, by setting up both EXTRA_FILES and the Makefile dependencies with a single call to the new Makefile function extra-files. That fixes the build failure, while still providing the correct dependencies in all cases. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 0b872c0a42d2..c1269466e0f8 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -73,10 +73,10 @@ all_64: $(BINARIES_64) EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64) $(BINARIES_32): $(OUTPUT)/%_32: %.c helpers.h - $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm + $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $< $(EXTRA_FILES) -lrt -ldl -lm $(BINARIES_64): $(OUTPUT)/%_64: %.c helpers.h - $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl + $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $< $(EXTRA_FILES) -lrt -ldl # x86_64 users should be encouraged to install 32-bit libraries ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01) @@ -100,10 +100,19 @@ warn_32bit_failure: exit 0; endif -# Some tests have additional dependencies. -$(OUTPUT)/sysret_ss_attrs_64: thunks.S -$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S -$(OUTPUT)/test_syscall_vdso_32: thunks_32.S +# Add an additional file to the source file list for a given target, and also +# add a Makefile dependency on that same file. However, do these separately, so +# that the compiler invocation ("$(CC) file1.c file2.S") is not combined with +# the dependencies ("header3.h"), because clang, unlike gcc, will not accept +# header files as an input to the compiler invocation. +define extra-files +$(OUTPUT)/$(1): EXTRA_FILES := $(2) +$(OUTPUT)/$(1): $(2) +endef + +$(eval $(call extra-files,sysret_ss_attrs_64,thunks.S)) +$(eval $(call extra-files,ptrace_syscall_32,raw_syscall_helper_32.S)) +$(eval $(call extra-files,test_syscall_vdso_32,thunks_32.S)) # check_initial_reg_state is special: it needs a custom entry, and it # needs to be static so that its interpreter doesn't destroy its initial From patchwork Thu Jul 4 07:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810198 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B76541A0AF5; Thu, 4 Jul 2024 07:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077927; cv=fail; b=dnX5VWR79EEVjIJZMwi6+1QjuGbL51nEyj0hxJOb9t+hnm9lnAJ5i7eqiQmd9HN4b8aD4U7Fr/0rt+qCBzWlTMqrymjW4Q+BmrYQbSSXQW3gu7SCivGuQCLdpkFnGsCtsWXi2WtI565ndUki0Woe3csAkeKjdiIqc6rQcoWfBAA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077927; c=relaxed/simple; bh=p+PJupmuoDhNmvW8qc3bY15h8zhzVVX0bDoh75u5Xng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Rk2p61h+ySFtIV66umjel7J2JucCWNM1jkO+VopTIlmfGx5Ih+zoGvIPQGmPGrPTKR9rPldXfriWtmI5fmQAy28tNLDuNpJ0iizvuON4r9b4ZBU0outabycXit7sH/P5+an0VkMcp7184XexZ6A/K9mkHFizE6JsClMohlVtizk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=qbIthqmn; arc=fail smtp.client-ip=40.107.94.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qbIthqmn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWNqD3NWwQzx3wlf4i47gwnoFbT2ugVD18gLXlfwGeZQjhrltHbq8GxQ35zgclLS/XtCGGHZEL/uG4VsTIVk1mQ3MPZuLOo/yF3KjdAjHgtvvjoDIRAGJqBFGFXsjjhXekTR+N9GL+Mx9vLXneVnjIQEi3u/AZ4m1/QXeFRigWR7azzA6GcIXKjQDRy7X84M8UAfRTBUVojP0V6n0Tg3I2LTS/GiRiBeN4oqN2k8z1c5WEfofrMaAZ98j3imqL+oOvn3kuJ6t3/IGwAxctKDy/R8knkiNNw3MnkzOIwvXZ30iQhiWNX5Sty3nqhJt0uIEGpokldj27vvXGbqwpcjHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=63Wjs5b1chJ/8HD6wi57kzak7hjwZLpjsmt8nRaBgb0=; b=SZPUNj3NOPriFUDnJAtD1ZT3VQ8kiOVQaJR0CCu1ScE/lB0kRDbxFa8f7QOFT41jRr+0O/+Gz+rsWhn/Lns7PuUUgQ5nDK4jsg7PA/zoSeSlEN3LOLKBlap3JbyMK4QaXvPMwek1ALNRVUdKxQmOxbGTlf0sNTQknPswXuTJKvADr4k/sOHzxiUQ8dWNTbmHrxDm1qNGyk6CuFYqL0eRAYLlIaazmQRqqbSfEfyy+F8l3XiQeb5czxW5gko1ICWQ24DjxvyiEiJvz2ZD5bCYPpGTeE5PesFp4pSyvqwFbUEHRuk/MQ0XZYJDUJWmByp1v9FlWRJdZ1FIuqabuM4iHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=63Wjs5b1chJ/8HD6wi57kzak7hjwZLpjsmt8nRaBgb0=; b=qbIthqmnKYOP70+hIIiHjeB8iRVqB4O9qGacrUoe4z0SCsRVoDYSSmrNjm+z/yZtf22fnqeabYhH9Opjz+BmWTQamtP7oq7SGJm+kQrB7D7QG79UcLXHuzaqdQc8a90LjYj3VHcFiskeP9wBYkIo/t66yB/9xtTZ9Xn2JCDwYAhcLA7cutJFT2SF3+asEtEEEDYZMUYa8P6ectjc391ZsIiO45lSynoqe2a/DIOKT9wSQxupZMsi7LTuB9hpOGEtIBTnJdlQ68DUCR8/MCnOMGyOe65FVzYS9U3Zdfesh3UnCSVveXezOy9yOfxBUxVLfdSVsSg/UqYczDqQ7LaMMw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:21 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:21 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 2/7] selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Date: Thu, 4 Jul 2024 00:24:26 -0700 Message-ID: <20240704072431.111640-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0130.namprd03.prod.outlook.com (2603:10b6:a03:33c::15) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e26f6a4-462e-45cf-78e8-08dc9bfa76cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: ZLrb2NdW54bASPxJ23u26rgNSC0oK1inyfR23sv0iA5WIrf0v8ou/z7yVUYYU7sBmRtrnPGi/DOkgKQXT1JyLmAf123AC2aBKheOvAWFFsjNMIz78NQyKb/rj+JtXxB1SxjBXeARdDbu1YId5m0xUa5WSQcF+hL5OmDgl5flNXYVY+odXg+nXMKNJ/6uMQURp23C/BenvzKrjRj6oq1TOauMpSYYjTBdGO5fxd1iOHjBHcQ6TIzNPBudbO48E9m+qafZC7W2z29ULPUp1WvlMEKvMF2fTXLYlw6JdN61G3jfX0TopWFHa1n0w+E1pCTZUF1kTeq/JNeCa/MIqIcIy/czIee/aKABH0w2pGIMebaC/XkenJO+aRn9o16YUvWZ0FPgCoQk3JgWT4PyfKsIcmC7Epkf4l2+krFbUBT636GcJ4Ku4KYcMWZuoHj2rX6it6Q/AWfqYZXExg8l27w5SxMsFQVbqNO8DupDIj1zSUunhE9ciWTdqIHfiYsS1dyEEzZEcrAVVlo/BgSpVDo7wXfiTJOjX6S+TTKByyJKYwAu8kJeWCE/ED94AIKMmXtS3tq/kn8Yi1wDmzMi6ruze3QCGCVrLE+oorm+8yoYSr41Eu4W4F920EI/tr5Tj3BE+bhIf9Downj5fKNQiBq4R7zL8MZv0jjNLillyiwNxlTjKqGc3QQNpm7H280+ZUJn92GcvVBcmGas0EREOAcNaNsNcOCBrvWZjZ5liYIbybWxmDdSEp3AAtuMCt9M+3bgO69tOD8dV1XjDuq8PgBHRo4c9X/X45NE9Y303wVw4aCznr5zyY7pAd7ySgbUXEG0JbthwcQCrtiB3rXiQuqVUaPt+2sPrkRhdWS/PinQTTjt9AP2pE5FNNH4fu1jJ3zxBG+ZfTNx8eTK9lZ94DvjMWrVsndwFunDvCzTt58BXGs6DtmIRJh3A9ytuiR3xePCQXwdMpM/p0fxT+zVJtfVcrRe2OEk/dauOObSdvdJqSm4G0xir0IDbEO+/j6QyB9mqZg7ela8JcLiphrxYlfWp9VciLUCTZO3GlzYvyfDVaC//5K0wUJTk4LvmmxELTOtY0bmoC0fIYw/7b6k8xxDp8M5DQcXmf+H39o46xqX1CRFRvmKt4j6HGXOR/lhfbVHe0vVddjcn2NqCToeFZXJCiZW7aOL7cOft+R2CD9yFTeaL4rVMthehB7kalnhewxSr7747oiDa0RncI8drE1UORkj6DFQoFLDBOxULZPNmA0prjo0EfQMhfowX8ttrI3vTNK8bUdnm9eSqOv7iYHghzqTQfWcY6zVRQRVkKPs5UE2kzjff9GIeujnLrDkZBJMXM+e9/6VR//Djku8kz8nMA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sa+v4MDqXVruaaIYVc6YAqwX6jqrGB9Y1TsDTicEMGkdX/HnQAPnsWxydIEm+CIYuGemEMAjVOjxyG4yCG9eGMjrRh7jQUX4qgLqkxOexK4NmeCvcnVO5wfGY2onctIpyFRSl25qlkGNKMzpISwcs1yWHCHeo0HqVV0wjmypdp2qzUblaYS/GOJoflLSkAL3hW5c8DEAXKAgdxbaFnRmtXNU17MBRpu4TCJa2JyNRsf8jFcdpsIW7gWBUZ2RD2A3CkI0CF26AXhj9TvZRkbYwTG/K32d0nSX9AtOmhc0skBAc+qPveDspDz4fwl7NqjliSPeeGrVbUt9vuONZMuVyLx3+HtK4KFX0GtNF4tiq4CAf6AUKtDflOWqw+1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/CHNav1ths4e/iOWalzCImkj+ytoCP8391oYJnoxQnZtW7jrYmWzv9IvOCLSwu2icijJUFwvxIk87j3cTtC3ZgqSveDuRxFkZTvfcGdnb+LYSmThXX9CXtXO112YcWNBBqs4MjiOUPXE9w3t6OjDAs8O3049F4zw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e26f6a4-462e-45cf-78e8-08dc9bfa76cc X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:21.7539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IDQXK13TR+qKNd8IBOIVl/nAHf9fm43RQqKoaO7Z3P9lrHLI0LwcxqNXZgdLY2u6p9SNLugS0kQi4dzo0c2TBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 From: Muhammad Usama Anjum Use fisttps instead of fisttp to specify correctly that the output variable is of size short. test_FISTTP.c:28:3: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl') 28 | " fisttp res16""\n" | ^ :3:2: note: instantiated into assembly here 3 | fisttp res16 | ^ ...followed by three more cases of the same warning for other lines. [jh: removed a bit of duplication from the warnings report, above, and fixed a typo in the title] Signed-off-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/test_FISTTP.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c index 09789c0ce3e9..b9ae9d8cebcb 100644 --- a/tools/testing/selftests/x86/test_FISTTP.c +++ b/tools/testing/selftests/x86/test_FISTTP.c @@ -25,7 +25,7 @@ int test(void) feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fld1""\n" - " fisttp res16""\n" + " fisttps res16""\n" " fld1""\n" " fisttpl res32""\n" " fld1""\n" @@ -45,7 +45,7 @@ int test(void) feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fldpi""\n" - " fisttp res16""\n" + " fisttps res16""\n" " fldpi""\n" " fisttpl res32""\n" " fldpi""\n" @@ -66,7 +66,7 @@ int test(void) asm volatile ("\n" " fldpi""\n" " fchs""\n" - " fisttp res16""\n" + " fisttps res16""\n" " fldpi""\n" " fchs""\n" " fisttpl res32""\n" @@ -88,7 +88,7 @@ int test(void) feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fldln2""\n" - " fisttp res16""\n" + " fisttps res16""\n" " fldln2""\n" " fisttpl res32""\n" " fldln2""\n" From patchwork Thu Jul 4 07:24:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810539 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A83B1A2548; Thu, 4 Jul 2024 07:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077929; cv=fail; b=FMXxqe4iMTqTM4R4vjS0Ax2Sg3X94rDvlYz+LfRYH/XEyuFrZ93LpXxr1J0YRbOKGODrpx6j6ZsG7vi9kKWBduShlJFqhDns1k5U0eKeYTPIZ4E+2261xLx4KNcjGDYOkDduD8n3fm0reYb9Nj+XPtReeXkjiCH3g5QTZohWMs0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077929; c=relaxed/simple; bh=Q1CNzg7KFgrBpGICrW6otC8HFz8qTN3t0zVW1WchG8Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=BADbzFgU3BIfFEHsfbVdf7SYRMmIPBZgSlL0PAiitlpHRPgwSpd/O4aPuPPSlTdm8Gkb0kR/bYwa5MG2R7CqCTgVjaHueIjEASez/2qM/DRFd9gWAhzbIAYPDUeOaUdn2KoN0oLGo03dE3wu1W1rz3Du04KtdSG9sDa5dMjA5Y8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=OTFM3nmU; arc=fail smtp.client-ip=40.107.94.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="OTFM3nmU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oP1ZRtDBVLP+YrG4yBVSbryDMhsXv8/CVYiaglA5P+14Vq0glTVE+F9oNWlDIms4bYaGVaklozYa8+kAu3OE8Z+wyfBZRSBBAYjWHws4H//YFcafmF6BT0RHd2kprNMmenPN8KzyBndTVWNZvtMfzDeONxfolSS0yYc7Oad+Dg3cOOrNzlRR/sN1nb02JkhubW2x9zuCJbZ8OYS79P6MSrGF7sPM2lUlcY1qb+dkdJQVEYqHSBihyp4d2fIQsKV6ZBvKPXzFCSIpzOfQ0N2csQtr7hVaUv1s2qSMqPqHVWyqce8aBVM6yF5zG8MLBaJoNM9k4CGBeRxM2qbHs5TeTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NrObOgsx3VK7nqLySm8Y0XSVs0ljqbPqnKHPwavHT9I=; b=NeFPRrNMZMPrZb/vIdS3n+tLUShxkRDXFxjWTMZaaE/o0pubBd9eWs0g4H7VU0n/8Yt/hsaaAGIDfUcm1feVgqwpIhCQnvW9mWEnN1/A7CHEKZm4f2vhNrkXfn0U0mPRi0CJPyJlT0Z1ISjHPrGnGHWlnVSPDojUm0UWFFpwnvGiZu+bSm/iA13cG9glJ2bMov0KP26biAp+E+iARBbho/12EpW1hao0n0aEMleJ3H1ENcEiOCieKvyyH8aS3+ZS+rpowS1Nh59Aq3blIDWjzoAQzNpd7Qi/5/7UKYlNR50/BZG0kS5ISIJdh6tjKePjf1yHonAwJ8BFK2uzmgf4bQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NrObOgsx3VK7nqLySm8Y0XSVs0ljqbPqnKHPwavHT9I=; b=OTFM3nmU4gL1H9P86mo8KwEyloidJQ/wHjHUd4leEn5M6BARQBV/Zt6rXLLGAsLpHskKvBhrT4GNAkg+yWfq+d7Ys6fP3c5XW+w5NPm+od/AoV8wt+l82YxfiwuUuRdaIh/KRqpn4LVgokWa23310Sg04OqmVcTaaetclWntrEhx9H5ulvJp/SrZRurAyTCIPKPFSLrKrw2YzLd01ySx7SJUQna2Wa2A8uh+BRUkTu8E5lEBnxzaveEFEZy2TIVGq5lY2O5rrKnLYbL2y6vFTuCx4235AToFTcr802kQnPRa8FFnRofdJrMo3sJjhf5RX0bU2ps+ZXyF73pT4jKz9w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:22 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:22 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 3/7] selftests/x86: build fsgsbase_restore.c with clang Date: Thu, 4 Jul 2024 00:24:27 -0700 Message-ID: <20240704072431.111640-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BYAPR03CA0017.namprd03.prod.outlook.com (2603:10b6:a02:a8::30) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: f57eb2c8-f3c6-4042-e794-08dc9bfa7718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: 8xN/ADqC4LuwHwfPsLV+lXqtMlJZEsuDg3iCHN600QaaZkTuw4qPqEKc396NA/BC8gu7QGS0KUVpMVMRTNTfBefzuPOUoSgVj43PjjaJe/xGOLmFJ12O/R6glt73wHenv6atiZ6KHXKe3WABU8VXeFcYK3g26TI74Qao4rSzqFdqg8BMXypaOWRGdW9r/+rLL1NWX01bGD1n8mR/RvIAdw3tlCoUJtNYcMqejZD9RtD746ocMFDQBLd2NciU6dpew1zvQ5lhVf9E/itUz0UgOmaoY7O+/XuJb9BSPN7PZMtTWHooNDre7pCbfsSrWeFNJRxnJOOxk/4TMHii+tUy3SswzfmyjmQ20c4f9qeJKJ15V6DHwsrvXRDem823x+l+IEMTfO0IzGoXhANL3Hyz+IorBuDOkmcOXLOoDbFBuvncig5wkodEiifTStPWhSqwComx3Ra6QOaeiH7QXRM5b/9fs4D5Xja9uDR6BX32JPOM7UBaGfajXp+NA/HtbXhRvchT7qbZ4EUXeRPm+D4HLPlxbnWKUhEiWGgwLMrvP8M1tBLkxID8cbZ6HrPUPQ2I7atfsCVQDrXRxxy6ZkGxYlLtXv7V4Tbd1U63fPly0CMLOoKu5HoGj/roW0kzcCZXNsf8HKlAmdaDNYGyS7PoQ19tXbYMnmY53LEEiLT05n/LLTu9N+00XCaoi3kjF467k9AUZ9pqq3W9u6P/pq4Q8ik+IbYEha7XZWftKH63qiS8lTaZbzJvVJ5q8s/Rh5Hzr8SJmgM73EDeo+tYo8TirEDn/rcMO+4rpx4Q0U8GJQt+T31+Gp3CE8Xcza9XsiMwea7kguVZIKhzZzANzqa1bRywHcHTZwskbUj0UjZeb2hKYdDL0drWhbm24jQY1x7lMdgUE/CAdJf+1Pvt1ZpO6azEJCbY7kRbZ4pu+nVXR7diNPhtDAoAz0ngAqneJhqJNKvCpS+6NxRiU2ZKZa1ErVX2lZNN9A3n7RXOQXYVtX5svuRtZWX1/OoVD3jfmhQvaxl6taJoCQIjljyTnvAoN4+f6bYaqO0MyUff5rAvFF+ofha8ioqSpzfjvxQMz8mJJA9RqwxVbGRzr1H3GbFht4bxOzW5fR8mWK4iDOIieRBXPXnYR2O2pYarz1EwGoEi412TmhNmjk9onq1hCiZSc7VBOgNN0BR5VlRHy34mfe5gCeI1HM/fb4Wl0+xsIOHCIHIuZ6C+zQlR77c1OTXhlGcQJZmDX358IOAj+q1q+KtwFT26zIRXxaUEDX+qTO3PvYlYX8RaoB/YNuBJhC2zfF1Z1fHZ7wazZe8Ceg0iqw1eq1Zkr0HjrQ9dmEFh3Rnk+UzhEr10vsZGKZYa3WLgTw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IJd9XbI6cjcZRa9MSWROoBz8tM8cgLvS4oXt3A+NKVeQiLyFVYK3AVHcdh5FgmVgen6OksZHMkXH50ImCEd30bdrKB1SIsW1RpZtnasE12lnf0rgl9ptPgkppp0oBkQeh37bxRSq4DL6pNSMlNyHte01vvh/f7hkCTx5v+CUIBpW2jGfpebQOwFDyl9M4n0n/qfHkv9UxKS+lHxX46MHYNKwNpo0I2vmsHlpULhmJ7J7zMS8OTUOwdvgdk3dUv00IY7gWvDWh9Fy3jphu2R21xX1eCNJscwmi2rQx7YvQiZGm1tig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jLs/oAJ90QzMNsODLtgp49QGk7gl8IixyFC1OKEE7XN9NKssctbedStbYBmdqbw32ksyZOqdilb+WSsYNNQcfY2Wf8riuNMJrKCbCClCw+6Km3/q8hnazqNkbdYZxQ4LA5IlpsnmUxWBr/PZrkfoYTmLMm6MUIRpOl57yyhySdcSfY53HG6gDyBJSOeULEKAsygAAgaYjKEJRgdFFhrfLLtZIZw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f57eb2c8-f3c6-4042-e794-08dc9bfa7718 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:22.2609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s9n4XtMtBwaqPfo4ZDHKSNYls7jpuXWdKwGkTiZIEvoFcSJCk9l/vcUWtf6Q2NcuPWEM1J9an2rGOparkQkTQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 When building with clang, via: make LLVM=1 -C tools/testing/selftests Fix this by moving the inline asm to "pure" assembly, in two new files: clang_helpers_32.S, clang_helpers_64.S. As a bonus, the pure asm avoids the need for ifdefs, and is now very simple and easy on the eyes. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 2 ++ tools/testing/selftests/x86/clang_helpers_32.S | 11 +++++++++++ tools/testing/selftests/x86/clang_helpers_64.S | 12 ++++++++++++ tools/testing/selftests/x86/fsgsbase_restore.c | 11 +++++------ 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 tools/testing/selftests/x86/clang_helpers_32.S create mode 100644 tools/testing/selftests/x86/clang_helpers_64.S diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index c1269466e0f8..99bc2ef84f5a 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -113,6 +113,8 @@ endef $(eval $(call extra-files,sysret_ss_attrs_64,thunks.S)) $(eval $(call extra-files,ptrace_syscall_32,raw_syscall_helper_32.S)) $(eval $(call extra-files,test_syscall_vdso_32,thunks_32.S)) +$(eval $(call extra-files,fsgsbase_restore_64,clang_helpers_64.S)) +$(eval $(call extra-files,fsgsbase_restore_32,clang_helpers_32.S)) # check_initial_reg_state is special: it needs a custom entry, and it # needs to be static so that its interpreter doesn't destroy its initial diff --git a/tools/testing/selftests/x86/clang_helpers_32.S b/tools/testing/selftests/x86/clang_helpers_32.S new file mode 100644 index 000000000000..dc16271bac70 --- /dev/null +++ b/tools/testing/selftests/x86/clang_helpers_32.S @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * 32-bit assembly helpers for asm operations that lack support in both gcc and + * clang. For example, clang asm does not support segment prefixes. + */ +.global dereference_seg_base +dereference_seg_base: + mov %fs:(0), %eax + ret + +.section .note.GNU-stack,"",%progbits diff --git a/tools/testing/selftests/x86/clang_helpers_64.S b/tools/testing/selftests/x86/clang_helpers_64.S new file mode 100644 index 000000000000..0d81c71cad97 --- /dev/null +++ b/tools/testing/selftests/x86/clang_helpers_64.S @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * 64-bit assembly helpers for asm operations that lack support in both gcc and + * clang. For example, clang asm does not support segment prefixes. + */ +.global dereference_seg_base + +dereference_seg_base: + mov %gs:(0), %rax + ret + +.section .note.GNU-stack,"",%progbits diff --git a/tools/testing/selftests/x86/fsgsbase_restore.c b/tools/testing/selftests/x86/fsgsbase_restore.c index 6fffadc51579..224058c1e4b2 100644 --- a/tools/testing/selftests/x86/fsgsbase_restore.c +++ b/tools/testing/selftests/x86/fsgsbase_restore.c @@ -39,12 +39,11 @@ # define SEG "%fs" #endif -static unsigned int dereference_seg_base(void) -{ - int ret; - asm volatile ("mov %" SEG ":(0), %0" : "=rm" (ret)); - return ret; -} +/* + * Defined in clang_helpers_[32|64].S, because unlike gcc, clang inline asm does + * not support segmentation prefixes. + */ +unsigned int dereference_seg_base(void); static void init_seg(void) { From patchwork Thu Jul 4 07:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810197 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EFA41A2570; Thu, 4 Jul 2024 07:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077930; cv=fail; b=UzPniwrRUK5L7yx179LCYwxXzNQaie0u35vZK+d0j/VgHbDaWtygz9YOPQXeX9T4KWSGoAfBHn0j9/AlCIpSiqKbdPRt1hQoGTdpG59cDw1Ns4Gbe/NqGjSGPVZjq0AqT4C4WnOTY+r0c2Sc6zREfO02OtS2HdKWmLNxRWn+/js= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077930; c=relaxed/simple; bh=niEUSUr5jT39XwuYK9l7lc//lUEMKOU3BgbAMYzwjok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=pMRbFVNQzV7wRYiY6xHum3xANw+mq5t9Vcrr0zpElJPU+b9drXtKR0JwhoZp+1EQJkTg/fKPVmF6eOmsQLTD4uT3AgEpjPbndR85XJHY+EINk9ER2BgZdyaZjjUKeIAupGvrEH3zJBm9DT1rc3raH8CDbU+krS2SgVil8vzRnI8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=NzupmT2l; arc=fail smtp.client-ip=40.107.94.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="NzupmT2l" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ofb3hLMIAYL0+kPIngZhPl1zkLB+6ihi8sMJhXD/JYYZDXCHw0rX835J1EAu14Of8LQTN/WsgNXRB0qyoFlfnEjAJCZUDBF2gjEg6mIZoJPw4Sunlfp2JHDjrcPYhsm7SATKWsAM6aNRjUhBbGtAAc9QrztoCw/yJwnRZ6l29D6VXvKg4fslNHYQcK6z5wGu13gMi82b+AA6OHHRjrk1FO57i/NkfMv2Rl8i6hhSCPnHPPR/jAkmBRsAvTR1shnWeslX92ooUuumWqopHLcyZY2EOfksH5/svu+9JPiuotl3JMm4ltXATVLlZrRhHLG9dTwxjaKgZMf4Oplc8lZa5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XWPco6IexFMyI4ntqp4WT7USqkIwQMDjZt92k0D7mMA=; b=RVrXIujdHcYxJm+rvkvbtdT/yCj+LtevnwnCciwkMusbHhY+vbFQ0HDFOZcBZk7hG4YxS9eQnTGoNhVZb/jQLspk9J60+xm3SN8RTa2b2X5Bqo9IgpFELy0F7d6lNAsIEJAbEcTR0soa/HChAE+ghVu1FWUXPSstiKOpz0mi5VFAN573ez4XgrroWTixYQn8kqw0PyPC5vbpYhWJGhTBRxdXwMpzL8t5LJBim3viy1lZ6zjE2yYa/5Lg0S6LU2en/TVOSE6NX25kw3AvzLGt0z63G2KqBkPkHTyfLLq42dpoSf9DSYoCTRrYOVghh7SFnjvxWGYEGWyRN/xvrNDQ/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XWPco6IexFMyI4ntqp4WT7USqkIwQMDjZt92k0D7mMA=; b=NzupmT2lWZItoS1QHYBnw7Li8eyyyzbh3s9pb3MbIxkUByJrmvKiCqKAiI87fZcWYzupqqhCldhzdYB74p/aIVVA6sdUONSpfJwiA9DArfSxHxCRt0J71HK+vLzl3eD2S+32A7lL8sP7OZ73AbmHZVcydvIZ/IvyLk82/aEFkmYaTqaVq/wArl4wHW5IdynkTxhHYwrXuimErBSdAtNdURoGCj5ANdSbN+Y4NDQnWtm1Ip7ZKTb9l3JCEJgJ89Jd+qpFubsdlxaOUduA9qIcUE6+kbWahFPKzVpk4WiheknV3Adq3UcEgw6oe+UCPxrnvJYz28sXyrEIZZmQL8Vxnw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:23 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:23 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 4/7] selftests/x86: build sysret_rip.c with clang Date: Thu, 4 Jul 2024 00:24:28 -0700 Message-ID: <20240704072431.111640-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0197.namprd13.prod.outlook.com (2603:10b6:a03:2c3::22) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: b88e0389-09f9-4ef6-7135-08dc9bfa779d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: ZGRiHVZnXtT4tCcpi+q0fzZNKHrKkJiGaqtGCwZSYDDL5Weo9+eNS95LgSGCRdBkDeAcHO24+9Or478rOydMweqaIGLVPa95K9wkrSnz9brnUpbA5d24vWHm8i4tJ/aiK8Pxs39ObPnXJltAOtf8GPXBLpIOEbhaUtSRtH6a1Ua0exu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QGwG+ve8gE4cfkoPyPq8fCMBm8HgacStiWeuZ36PcFMbHVQV6wnJO14pnHgrxQ2VHs/9Pue44ZAMSvNFLDSEiCQX152JPEBkbXEDYq/9RfB9si7tAhCFenw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1Oj8hmvi9P0PjiAxDBlQOJV8KdhWEJDxKfStao6yklZxnD4ZkoxC+YRBhLnUZpKSDZgFEvAoByJjcfrw+23mvBQ7hr8qvoUG8v0NZbE8kMN+g/Qi0B6rHyRkgiYzHpuGNJHulS3/Y/bfB0OqlYIrpQVwuObpHUGv8JxTJT0qts5OBWcFOrV7aRO7DAh+CCJNjSFkg07q3fEaxOWs8zFeS0MSO/SMtCMjrIi6pJM0ZNhZZfE5+7nSEegFlNKdCJN9eEvB2vCTpnYXfZtqMMjhayEr8GAgypGPIym2aECt207KT3En65lbKykk12Kz09P/3bY1enbQkTNTqfE/h8oYSUUG8KvPRQiJF9Tg+ZRi9FpGaPRYK+GFp9NaJiSR3BLsCCsuLwORAiIuaH3bMY14rPoXJqVzu5r8mCVDc0A6X/o3LiZDddJG2hUTueVXZPn9u7JJr3c6fHsXg5t5cOtuEIDLmuVy5IjJVRT22unPYLsHJxU+7cSHH+w8O/EP5Ks1ADxCLW7BKxb0o/vsZKKRJYAbp/VJiWg01cNqZho7YHjtoCZebxiMGqIPdK4rDHv3l+6IfPg1/8VDW6G3W1mLVQV+H/Wa6nYJhJLh6BLuhlZI/Mz7d+7p7Uf5oPScqET1gR1qEBDuqX+DXqyO7Z2PfIyYZHvmVmSeDCKUX5riN1vR4PG0rMfAFOxfrEk18hgk/1gFYtP0Lw3cYLrEp8pleUE/smSNCBoiNMx197fzA0+fbCZXdUP/ejZAgCVVUgatbg5y89h96RYcsfs3tRcqMIPpfP557VdVr+ncCjLrJZd0WdCiSEB4UlBh3rZXjT9im6FTroY55arWR+V9fH9UBBcSHbIPU8zcqXrW00LrM6dtlHeUup3s5mD9633JQhEI4x1q09MXPxfK8Ro8TiX/eU1CIGXiMhKNT1Y0SX1daiT0x8iPf8Exmyh7e2OPamTzlx4s7hy0KO1FYsNSGFz4WOiKygqWgQDnZYot4Zik4vhuc0IE5fC8VZB5aS9sPGXpGMNviQ4Tbnxi0gtKeODGqO8nJ1Wa8KnQrAI7SwkW4vBI2348PdYaB2XXWrEVT67M4vzamRk4KTt4w+tsNPZhJZt6BEDnaNaaXMw8Bdph0rlw8OgHLUupF0y1w+CP1p59g+gXaCgBgtLDKQwHp2fCPaMzcUR0JWNkXhkZRSXBftJygSS1XfRm8gngt8VIktWFy3f8yTD78/r+0tvsA3eZ/F/fShXvTsQyGEAkBSFC8Hr6pDn9gYO5X7NcLoeBmuXnPsJyfN9qmBeUM7yQ0jmxxR8Q3cXobwZ4bMf77eXJ59xolOMUy8QSmGa5WQRZsGURsH44p09kSjpJgzGpOoWF5CYyOvTvOhkKlYFZXeWDdib5lGVQ7qDPCz/GbcC3SVvN4Km1BH9Khwsc8htZSlkFv3OXE4GBr8Q0NMGzvTQ3bd7wABenE+2AbGMpyYiLYkHuDFmTitMb4b+8byYUVMBTeE1vG3Wa62/38hzFkaAY2yeAHwDTejFg68CR5OQMySOUcBB4JsQQOG0gVQnLOypiueQa7jfhvKJ78IoeIYQClYvM7mV227CtO7yBbeVjOG6namdK1jlRNBnHSwhYNQsHGA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b88e0389-09f9-4ef6-7135-08dc9bfa779d X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:23.1406 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QinwV4uBbGOhdiFfPyQ/dxde480YyKj2Otwqss3PSDecYldZOQyzbzPFKpGdlDv/vFOLeBbVKysS5H/8I7TpzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...the build fails because clang's inline asm doesn't support all of the features that are used in the asm() snippet in sysret_rip.c. Fix this by moving the asm code into the clang_helpers_64.S file, where it can be built with the assembler's full set of features. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 1 + .../testing/selftests/x86/clang_helpers_64.S | 16 +++++++++++++++ tools/testing/selftests/x86/sysret_rip.c | 20 ++++++------------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 99bc2ef84f5a..d0bb32bd5538 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -115,6 +115,7 @@ $(eval $(call extra-files,ptrace_syscall_32,raw_syscall_helper_32.S)) $(eval $(call extra-files,test_syscall_vdso_32,thunks_32.S)) $(eval $(call extra-files,fsgsbase_restore_64,clang_helpers_64.S)) $(eval $(call extra-files,fsgsbase_restore_32,clang_helpers_32.S)) +$(eval $(call extra-files,sysret_rip_64,clang_helpers_64.S)) # check_initial_reg_state is special: it needs a custom entry, and it # needs to be static so that its interpreter doesn't destroy its initial diff --git a/tools/testing/selftests/x86/clang_helpers_64.S b/tools/testing/selftests/x86/clang_helpers_64.S index 0d81c71cad97..185a69dbf39c 100644 --- a/tools/testing/selftests/x86/clang_helpers_64.S +++ b/tools/testing/selftests/x86/clang_helpers_64.S @@ -9,4 +9,20 @@ dereference_seg_base: mov %gs:(0), %rax ret +.global test_page +.global test_syscall_insn + +.pushsection ".text", "ax" +.balign 4096 +test_page: .globl test_page + .fill 4094,1,0xcc + +test_syscall_insn: + syscall + +.ifne . - test_page - 4096 + .error "test page is not one page long" +.endif +.popsection + .section .note.GNU-stack,"",%progbits diff --git a/tools/testing/selftests/x86/sysret_rip.c b/tools/testing/selftests/x86/sysret_rip.c index 84d74be1d902..b30de9aaa6d4 100644 --- a/tools/testing/selftests/x86/sysret_rip.c +++ b/tools/testing/selftests/x86/sysret_rip.c @@ -22,21 +22,13 @@ #include #include - -asm ( - ".pushsection \".text\", \"ax\"\n\t" - ".balign 4096\n\t" - "test_page: .globl test_page\n\t" - ".fill 4094,1,0xcc\n\t" - "test_syscall_insn:\n\t" - "syscall\n\t" - ".ifne . - test_page - 4096\n\t" - ".error \"test page is not one page long\"\n\t" - ".endif\n\t" - ".popsection" - ); - +/* + * These items are in clang_helpers_64.S, in order to avoid clang inline asm + * limitations: + */ +void test_syscall_ins(void); extern const char test_page[]; + static void const *current_test_page_addr = test_page; static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), From patchwork Thu Jul 4 07:24:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810196 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D37FF1A2FA3; Thu, 4 Jul 2024 07:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077934; cv=fail; b=OMVSoG00uFuNoKoES/aEpCNqKqwu7hCFZkWNSHQJzPuM+H3KCIJ1I7fSMfv+z4Xa3rRaq49mhSVONF3iZB43SWAj+MbPX2yg7ubeQpmlxhL26TaTfUJpZsoy5LL/5MsJOPtH3jaNhOcwPsCxyI2RdrqF4gtKPuSJ01EYCYvXEBA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077934; c=relaxed/simple; bh=R2uFp7LxQhjHDxOETaUQduZRHgkPJuFGWO9Fm6/Vg94=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=aeJAjEE2Pf2rvdJoQZfhNr8l4X/Bpvq1nOOcvHZ3bGfTctN4mjKUtLaPxDufxToDI8lv9zcAx7FSLuSAq55mp6JoIG37g63sn+uWXh8bJQKNLsYVGqGFc2DTzE8dN50PxMsiFJtOwZI9eSqitKYry+9Si9yomfcGkvfjk9Z2rY8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=CZNb9M8Z; arc=fail smtp.client-ip=40.107.94.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CZNb9M8Z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h2Q6GF8UiIGy9dKUmkodKLGcHtbR8LoDlhRcbIZ8FSPMf+r+IAHhptYwvIvRvPwnHpmMNz700ppeMUC7afLGgTtiejHH2iK0GwSbiRECsCCyv4HZOW7qA30dWxbAzbEojZx+l7aFb0+BfCR+EuVgH4UFyPURxxpdxqDqyN6Ow2gr+ZblXVx4uPDt6JDGI/tKsluZIhc1W5m6nO24wplglU//TOW23sYT7UK1leCaWNmjCueJpsdf5qwxxpiYY4gZHgw8WmFSD9kOfyHWybUsOPdIYx36wtXb5QqmNiWxaMFHP5AFpZnXoPPgq8V2mOkunX734lHbmulc+4MhLxp3Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dN/cxnEpgOPiCihYwocCeyUVpSZd/JqCjW3g+U/bO04=; b=VD1y92ReLvzuPmJSRGkSPglq5+jFZDEfXsvSBunbrz5DdukvWnpHrdLhbREVqL3nCfFwJR4fsbEdgdx2ugY+SGFC2TSTh1FnVEv97U3f8NN3rvpnUWImOy9cqKfYZOyrAiKCgdfdszPBWeXtF7O5IMGHXREDTChvd6mzLM8vuktjtZn58Uu+SsOPagwlaNNHqGItDoEAgWBvmGRFwIwpd91AEIr+njOor0CffA/uIPD1KQMm+YVcFiPCY64y2X6Iu7dk+h4jLP7vTOhuQe5NCsKhDEZB/At8SF27oQJtwAojWxVDSXgQRaN1oV905Z1773zzyFZcd/IQeIzCGHeWNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dN/cxnEpgOPiCihYwocCeyUVpSZd/JqCjW3g+U/bO04=; b=CZNb9M8ZBE9RFM6EfFXm+vslllYMvBfnwNsiaRvSIRPrIrf+YbsWnH68MSI33a+PZZUHykJ6k70MvobLWPtLhlOwcUvai/jvm6bXRpAruJBrt16vKJT4j0HZ7gUQPZRDWK4e8gEM2dKMs4zbKhDt9y758aRXeKexTNQo2S+kw3q81J6ipxXHDcZkOEWZeNXnRNDh4dZgziJTURxjw9IzQL/o2SnW86RBrBB8FCw9MTcd27pJcKFBAi7JVaolaMHgnBWQa4Q4gMJdkzi3sXb/qp41Pc2NPe/Wgd4GwUrExuCBCWic1UqVZ/r1r8ZOD75Y5ujVH7IqCx5W+AU6mCmFIg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:23 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:23 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation Date: Thu, 4 Jul 2024 00:24:29 -0700 Message-ID: <20240704072431.111640-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0149.namprd03.prod.outlook.com (2603:10b6:a03:33c::34) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: 09d21942-8c13-47e2-38e6-08dc9bfa77fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: VwI0wrIs97+lWCYWRdWfCb0aSJY6Z9TfdtdC3prSFMzsVQbDXxQl69nzMCLdUdgfaN5PTUggFVk0EYZuvKV43AYXCP52F7ZBr1MhFyWE4QXXxUvYg86TSqs8uumJzfod2BjLyvek499tygYc9trcfAnNCo0Wx6CeT04/blRuLMTuPzz0JYezvjDH48MG3gJ8UivV63fAx/eMIdoPjwL8kU6V91fvcOoTw+pBP44vTOwfEvM/6T70J3ETQXiPXkE1L/2JLX1rIkXidq+wjzsWL5yEm1OQiScK6/yeE0eTbnptIGl49V8buPMLrgIqoxeAkDUxsG3jUVzbzcDir/rpDY2SpqRZqUPlBXMpilcHKN2rJXVbfVtIMLculAg85WMtfZnv/y0KgS+wI+ApSvvAmnsW6U0wmlliA+ND/wpk3lr/8twCsjEUNNhQv+TN6zFURM/Ko2wuctsHT3EmhFpYzqaQ6CNFjZ0f7mNOe9EmAiO6Z7UAtjlyK+kp4aQ6+M8Fn29CH6rDMdOPCAykQCW6TU22b7NCG8cVJXXK4AxtOMt7G+FFtgbEDkKKmSYMPU77VB35w1M/hDxYq20FN24hqx6459lqBb3mjLZuLLX0Y1qcf+m/eMMBZNEky85+Pd44jYIXmNEvPwiN1/ETpxQBWFT7yc0vo8CGktjOuEi/ANOoohuYGSiRzkrlPRHkYjE4OeEqzSQohzguvIGBGpWtRHDIK0MVrCwkdQIx3xF88WHuNiKgdk9m25RibJkarCxrWWcvk+/CRfAziDuamwIgEEj8mRpnfiifKH277IrKEDfGRWJfIiVRTtzvscdNcQtWlZ7IN25+W962FDZ3IP4ja7xzkgS2Z1qWNXdQH/FUz/YCM4crkx6iGcvfgTX1eX9pNugQT9GC1mfrY5M3wLk0Q3sSFfxkeItMtKEKoJ22F6A20jSg21ltaHeozt2S74k6qPOIMPnK3t7n1uJTW1/SAi8wJtxiKD9uEI+xB5S6PlZbMkzqQVGjhAIBOJZOCDjy7CLHp1jMQRPgUqNDP/0xeU26o2f8rQQQpeVmX0MbgKB4Ly3So430Vh/w+y+m/rByz7TMMltqYBxB9vGcyjQ/DQV+Mqgcp5tJb96zlgZRBL1A7oRR4964q4yl7nojbTitZpFsiBovY0p22087pIA2EnkBcvfVRaQIXs6AmZ0WizT5EKj+oV5CcRjCnkGejS4ycLUZhRlRfMrST4DjPPMRzozOkLej+XQ2wQ0AfusSKyLk78NLLKKiw4Ya/p+dPi8jtp5GHLOxATtIYSUPAFSByaO1YOf+snGSV4q4SkiySG2m+WYpbmzHmBqyyW/cL1MdDO+nyT4w666vrm+kOJvvhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uSE9GgiK2LPyIniwlbZmfuf/Ay43kC1+DrkHyzI3Z7+PkOmh+pkSVC7NjpUNCMbqa9yQ2PX/5TBbMO1ejAXaHWxiM5DyXwW6tqCAx3mYe3sFkRnwWDa1YsF4UOnCp6wyi++NxqdE8crT73/9/wiLrpIwxAKBiQDOrIdB4mo2wegBd45FHNZWW+qMEyxKtavIdhGFaiQSZ1r7zcx0hXjNxIfpdykhNvW2naqbWV3ZZvojisazMpOH5BVZNpKgLYLIFS3jkkt9ChIs9pW4emFRUdRVGD19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COA/060Y/Xp7BlRMoJK73zVzdRp8aUWIQQ8ic510Gycc8TKN1EcX+zO73K/7R0E9owwJhUAui6d/7TeNGVlEwL1MOe9xo7PzB3YmWiPuMTLVxWGOTrnFFyVIaCcRGnsj27kVS2ZSZq2h/x2YhyEP/MAAmxfzplHCBDVob8pgbntigly0Vkgdcs/fE3AttO61UPpRw9T7oPInY3UwL0xahOc1oN8yv76mAbNf7NmVcrjiIx0RipZborkvp5KiHw+2n5g== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09d21942-8c13-47e2-38e6-08dc9bfa77fc X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:23.7462 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tafXZ/F5tStBrTsJeva1d618NVpgkR2qKCgcY0icRmzD2gUBPxfbcVnoTuFe6wYhqa4dXypshVC442w8mHzuQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang warns that -no-pie is "unused during compilation". This occurs because clang only wants to see -no-pie during linking. Here, we don't have a separate linking stage, so a compiler warning is unavoidable without (wastefully) restructuring the Makefile. Avoid the warning by simply disabling that warning, for clang builds. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index d0bb32bd5538..5c8757a25998 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -40,6 +40,13 @@ CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) # call32_from_64 in thunks.S uses absolute addresses. ifeq ($(CAN_BUILD_WITH_NOPIE),1) CFLAGS += -no-pie + +ifneq ($(LLVM),) +# clang only wants to see -no-pie during linking. Here, we don't have a separate +# linking stage, so a compiler warning is unavoidable without (wastefully) +# restructuring the Makefile. Avoid this by simply disabling that warning. +CFLAGS += -Wno-unused-command-line-argument +endif endif define gen-target-rule-32 From patchwork Thu Jul 4 07:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810537 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCC5A1A2FBB; Thu, 4 Jul 2024 07:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077934; cv=fail; b=qJNuAz+5V05ADhjDV6ZtWvX6nxidKIGFKBE6qxsu3QWupmWX1vYRjyuDUtAfW64xxpqVa9nAozkObzsOoXdDthJ3X1bCEp4EQetRzVRMZTPfrSfiLdgCInodCDSQV3wXx0M/wYcR7RCVut4dgksmoByiECJHPDA6Pb6PLCPRLOY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077934; c=relaxed/simple; bh=PJkb7pOjet9akjxtdL3weN9511lk7kYO5jQcO/1Il9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=XIT/rxidVAMlSWsLGgyuE9HztAuq/WuzLuHMEqK+mbhq831R4sIYj351auHS4clwg/vSMlwVgkENQd/8aXCz9V4hpL3CkHwE/s5LX/gyplcx9JISTXIit2WQj9P8tnJfvTWH+IHIOZljyh2meNVmUZ1NUa0yZ5T51OS5r9Lr30Y= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=aapGBSrL; arc=fail smtp.client-ip=40.107.93.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="aapGBSrL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JFdbHvDZvgc8MsLa5WE2t144fqwtYq91xIiYMsRl6Hk8voyB7x3+6KfRSjvfjgqfZpVyCLP8IMDhwOS1Sjw1TVgx9giHVT3/w8i48crLIgtnm5pmNqt7DGwQ2MafkTHfdTXlD4MhV/w9EI0O5fFbXzw4a0CUfhbS71O4+dbJAAAWd3Y0ahayOTsTgwGC8TwCaJ4oLcoZC+oc4QAJQkLux6iR/iboVBj1bw48vg+pQHvEvONs0tMuOMuYhp20v30fa4hbIVou289+COiMZnqmzeGa63GC5FMzQbZOvS20cIpq69edazVZYK2Y9qT/YaFTCR2fXopNvx/gidNgVTSygQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8AEZVE3Uiw5qEDEQbGcpW//gGLlgERAuhbrwbTfJ1E0=; b=fT8zReR31fyercTkuPgdMVRA0ktAkcX3jcZQgJ3uvsa9KPovKtkVfmZ4lnMe7Q/rx5MPhIMm2HltW9FYdAt76+8a9MJpnGxDxjhpVhb8m/Hk9zCCy01wwJYCqhEXmobZuYqBFQwb4ul/JE0jmkyPxjgoyQ9sQ2Qksje3lZh7/ERSnnBJdghW6Go3reh3sYlVx6PEKksmNfxXMBSYc3Pw1ozA2uP2Gnk/EmY4xVBv1JkoMTErKuoR23u4VXRrN9qRXbRZZV3235j1E/TGo7Q3PH5lpYAugWtN5/JEmOK4HZobBJaOF049jXScEbFAGgwORh5x6piTP39+5f7BhczVZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8AEZVE3Uiw5qEDEQbGcpW//gGLlgERAuhbrwbTfJ1E0=; b=aapGBSrL6BdcgfmMMzvaX8uZY9+IQabbHfYk84cXiIPf/9AYxUGZAVJoI+zPQmPWAqVTp/46zvcES67z0ugfrZwHdGWVjS0UvgekimbQNaLrTLu+8zeOzMp5ffcv2o/KiYXH+OV91L3sec+OSY+q+Cztk0MAf3jB3VTmFVOAnRDVQj1JN2NpxoWkG+sOaMrZtGYlMKKWhgXgZHvqNeFJwQOXwZpBexMLeq1oFztDuTZrvxbBkXhC1VN+ES2ixHMYUNOY2+r/wJFB9hVl/Pm5wGFeEqfVl3MbVQEPP/Y8n39GTIryl2oCRr++DQPqJL0/v6/ElmStXexitI7X7iIMSA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:24 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:24 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 6/7] selftests/x86: remove (or use) unused variables and functions Date: Thu, 4 Jul 2024 00:24:30 -0700 Message-ID: <20240704072431.111640-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0139.namprd03.prod.outlook.com (2603:10b6:a03:33c::24) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: 033eebbf-4b25-432e-e040-08dc9bfa784b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: eI/GL3y7CkqtIxWYe6yo66H9OtQWlSYn+r4IPEpn8p5ir+BmNKqV4IiJmHLoUcupnqm4rIE7CVK69ofyN+mtcKxlNsvuIl/9X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YR5OQ1Q6aVGT//Vc3wsaFcd2TaxwxeHihkTTwAqZ8m2rDT1IrMHjGXb4a+k9WDv9sbgI5mr5m+etCn4NMENr+7ncCnDsZYrqNgHJuoOSADB5RKqw9o38Vjx/fnmChVqxETBYNQ7RCJvvI+CWkSJzPWW8fpg/CbOMLmgv5Eup0mhLESjo7d81xoMyw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2dmKaVBcIJHoUtD4zod9EClKAhT/QbNbJVZr2p0TIOxEfHHODmDatl6sT4p2prEjvk1kWJsQAxEDfHHvl5zhHThC9y7inD39e5Ku8hyPP6OAoal/OrKrSErxXxq+C5KpKvhdvFlcjoU2Xr9Gs5VAZSEzfymGqmMkUfQSU2zqI/JJl48S+CjwL3c6R4jx7opS9F1dL6e9IrBzQ0zBHtJ/wuWCKX3L1Tgw6kxA1MyenpP8o0iENw7HZ5JdKPSqRpgibjbOtx4adQgHGcyB8dMo0IiPQyJgIkf+LArn3Ku/qBQ4MSxrzCFwtAXBF98/yigVztXFv+lUr1dbhj5F1ofmvyfbsiXWZ623mlPe/xpVLK9x04qs4MIpb+iWHTVoUw360zOEiPTkPL7NWry/4xRPD/YK3cuY1U63k0UnxnJYLG8ArqQU6IvO3Chd6v+GvYmI+NZdgebk+b4bL5ls6hU2DR7iGNAxNcQJVRuYqNKzFH8H5VaS9E4pdfKuAASG28TqFk+rWLTQ3txaxqJNpugrowm+44nYifsXEGTCTHu+R8AkuNKAPalOsi3Yhh13CxkPNFIdTTHDqQcjJ4rX9n0YP9slrj0DGRiTwelgMzIglZMjOng/LEvtGcGQ3PxY8gfnisMhgDDgzYwt8KxTLP3BzJ/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.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:24.2872 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8A1f4ex4hpOJu1tTz5rGfGyDImTvUVLpG4T99bH8nT5xYepw6Oj5IO9iPloR0o7CDOXN0av1UJZMV0RHDVxiOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...quite a few functions are variables are generating "unused" warnings. Fix the warnings by deleting the unused items. One item, the "nerrs" variable in vsdo_restorer.c's main(), is unused but probably wants to be returned from main(), as a non-zero result. That result is also unused right now, so another option would be to delete it entirely, but this way, main() also gets fixed. It was missing a return value. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/amx.c | 16 ---------------- tools/testing/selftests/x86/fsgsbase.c | 6 ------ tools/testing/selftests/x86/syscall_arg_fault.c | 1 - tools/testing/selftests/x86/test_vsyscall.c | 5 ----- tools/testing/selftests/x86/vdso_restorer.c | 2 ++ 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/tools/testing/selftests/x86/amx.c b/tools/testing/selftests/x86/amx.c index 95aad6d8849b..1fdf35a4d7f6 100644 --- a/tools/testing/selftests/x86/amx.c +++ b/tools/testing/selftests/x86/amx.c @@ -39,16 +39,6 @@ struct xsave_buffer { }; }; -static inline uint64_t xgetbv(uint32_t index) -{ - uint32_t eax, edx; - - asm volatile("xgetbv;" - : "=a" (eax), "=d" (edx) - : "c" (index)); - return eax + ((uint64_t)edx << 32); -} - static inline void xsave(struct xsave_buffer *xbuf, uint64_t rfbm) { uint32_t rfbm_lo = rfbm; @@ -164,12 +154,6 @@ static inline void clear_xstate_header(struct xsave_buffer *buffer) memset(&buffer->header, 0, sizeof(buffer->header)); } -static inline uint64_t get_xstatebv(struct xsave_buffer *buffer) -{ - /* XSTATE_BV is at the beginning of the header: */ - return *(uint64_t *)&buffer->header; -} - static inline void set_xstatebv(struct xsave_buffer *buffer, uint64_t bv) { /* XSTATE_BV is at the beginning of the header: */ diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/x86/fsgsbase.c index 8c780cce941d..50cf32de6313 100644 --- a/tools/testing/selftests/x86/fsgsbase.c +++ b/tools/testing/selftests/x86/fsgsbase.c @@ -109,11 +109,6 @@ static inline void wrgsbase(unsigned long gsbase) asm volatile("wrgsbase %0" :: "r" (gsbase) : "memory"); } -static inline void wrfsbase(unsigned long fsbase) -{ - asm volatile("wrfsbase %0" :: "r" (fsbase) : "memory"); -} - enum which_base { FS, GS }; static unsigned long read_base(enum which_base which) @@ -212,7 +207,6 @@ static void mov_0_gs(unsigned long initial_base, bool schedule) } static volatile unsigned long remote_base; -static volatile bool remote_hard_zero; static volatile unsigned int ftx; /* diff --git a/tools/testing/selftests/x86/syscall_arg_fault.c b/tools/testing/selftests/x86/syscall_arg_fault.c index 461fa41a4d02..48ab065a76f9 100644 --- a/tools/testing/selftests/x86/syscall_arg_fault.c +++ b/tools/testing/selftests/x86/syscall_arg_fault.c @@ -29,7 +29,6 @@ static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), err(1, "sigaction"); } -static volatile sig_atomic_t sig_traps; static sigjmp_buf jmpbuf; static volatile sig_atomic_t n_errs; diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c index d4c8e8d79d38..1c9895cfc660 100644 --- a/tools/testing/selftests/x86/test_vsyscall.c +++ b/tools/testing/selftests/x86/test_vsyscall.c @@ -97,11 +97,6 @@ static inline long sys_gtod(struct timeval *tv, struct timezone *tz) return syscall(SYS_gettimeofday, tv, tz); } -static inline int sys_clock_gettime(clockid_t id, struct timespec *ts) -{ - return syscall(SYS_clock_gettime, id, ts); -} - static inline long sys_time(time_t *t) { return syscall(SYS_time, t); diff --git a/tools/testing/selftests/x86/vdso_restorer.c b/tools/testing/selftests/x86/vdso_restorer.c index fe99f2434155..ac8d8e1e9805 100644 --- a/tools/testing/selftests/x86/vdso_restorer.c +++ b/tools/testing/selftests/x86/vdso_restorer.c @@ -92,4 +92,6 @@ int main() printf("[FAIL]\t!SA_SIGINFO handler was not called\n"); nerrs++; } + + return nerrs; } From patchwork Thu Jul 4 07:24:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810195 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A50A1A38C2; Thu, 4 Jul 2024 07:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077936; cv=fail; b=myK4RoUsWW+6yS7p0ISUD445iz8el4ZxWzNZ6fz5cF+62Riv9pndwX1JUg8SuktD6uQ+uQN4qH/4+1Seb1RsRpPRhwwlf0g0S/2NYCZr0GetqmHi/dkct0Emii46VpTYzh4wqj+sKMpy6iJpRcynQUzR5QBzXjnp3p+1zbRIQP8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077936; c=relaxed/simple; bh=SaE/0Pkfzvvk+suDwmTUuWvjvCY4+8vjETCePovQka4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=uqRt3dkcvH+M5aeOw6Qnf6fpmmrWjlRFDVS1D6BAAB2mOuRgg8snloxqC8DfoyLsugn3/HuvFjTb/9+R4fs5UZkFyGbJbX7KfS6hN9vuNFmLbSqR2c3OFpmIH+sOTLLEp9Z0x8PP9xXvNPqujX103SKg0ozJFNyEp+AKI8FCRu4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=M89PoW+s; arc=fail smtp.client-ip=40.107.94.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="M89PoW+s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTj2HEXJ2Pm/cZjiDrDg6Lx71UXPkb47WR4tpJNjfjy5E3WLbAnp+QC7Hwehfc77S0JbU0N/WByIVjMPc+5f1IKjr+W6M0p5G7XRHgRDJlwp13hYOt1uIhqyWlNoHfetdklX0d5eHufFMHmf7T+s72CIccYENOGlGitFQIBYCRcLrftDbt6MufApMAWcncRYr0+FyARuR7ZCsfFBNXrlQ5dggdWZYLsESJGMo8w7HAdQyrJbbKN9+NlGbg4qDLcSR7/jBPpN+0Vmm18RC1yyn3mfg8rL+1UTa2vuYaTWcMtHiCCc7ALnRpeCqbMg/T/Np8oEtTEOSRGTAAdJccVuXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zb5DkSrbT/a/sdIvEdu3XVmNC3ITCZ/3J3YC9+olM9k=; b=GEu9jXFr5AjLnLGTXF5VHkfQnDOVCh+Z9PNV8bkWS+UTiHT15jexGVaONxLUzWg+R66EaqL2L1XEYq72h8jda8V5zerEY3GY1H5FXjMS3o3wYQ8cXZcSblem0NQDauQcVD5Ltp99+I4EVZgq+oO9VaYBlywJeYUm8vtPCpQBbHzQ5yNooYgbJuyTbCBIF9NjwGzwj4OupmneQ+SJc+Bp+YhMEXOxeK189TPzoRfy2LgoDG8loL5Nx/Kgrk6gt3jFeZc0n/xTDRrS4+aF7oBgmDS6nRflrgR9umzgaWoenmIy8fBFUXT+HmpAFpQr8MeK3B33HR4+FaWXEDBUOdy5hA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zb5DkSrbT/a/sdIvEdu3XVmNC3ITCZ/3J3YC9+olM9k=; b=M89PoW+siVqPjs4fzmdWHLM8RpWdUrB2+BDLkdLyxXHMJelAbNgryypzg/yKvXEj4PtSLMfi/+tO/bXiCVYfjc1JlZO/YtcqOGaP790psHPsX8mBnV/AtiJb3ZSH+ubWOO7Wy38Jmm7o6j1QNbBj/JpdDrzfBfKrAtqvKHpRnINH8ZfqPCtVTsf57o+EA8Wm1ltGyZww/jQoTXadefQ90tIO/bCOK3DRuKgm99w9Hdxl0jKn4utxhNPNuoNL1VBTFk9sxwwCSa4xbNI3FQGCtsR8mSnx3uwnQwu2EUvOs8bZsPKugZhhR3PxBIzbZhsJYK2ZQg2+nmjEJd5Le+8KBA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Thu, 4 Jul 2024 07:25:25 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 07:25:25 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Muhammad Usama Anjum , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH v4 7/7] selftests/x86: fix printk warnings reported by clang Date: Thu, 4 Jul 2024 00:24:31 -0700 Message-ID: <20240704072431.111640-8-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704072431.111640-1-jhubbard@nvidia.com> References: <20240704072431.111640-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BYAPR03CA0014.namprd03.prod.outlook.com (2603:10b6:a02:a8::27) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: a684b971-c664-48b9-878f-08dc9bfa78bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: CTCE91FeZLm4FyUt/Nv//bzDW1NwjXQ6txH6JtBJB3/pWWO6wcR0vLqpX3+oK5/++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1/fluoQmuA/SBaDt6phwyUqYVyoJV3AigD2QTAnlSA4AkHe/drMibVAnv7929TfhbMYrQLx3oyVY5OpOOTuBoaSbWUQcAHb5yer4UFWHsPayO1G46NFidBAHkYhw2HnzjKm7XJ0qBbrggN0SoA7diFDHrYWGn+36HTtYm65pHTROCOjRIF3FP6FMeEoP9Sy09jq62XyaXNYk3AjNjBk3W2RA+bq/T6vsLUAo28AQyfBO7fQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4130.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DNQwpyPKko7Ysth6UupJPzFh5m2558jx15EA+TAJKMj2xfAYlfwbp3rgpa4pmehwsEypHZv3Ppo9FpiPBCmn4Spj9fsv73WzKfacuREhDm7fjg9qBqZa6czYYD5+MTCAv5gXkAbioiekFw74B2POKXVWJQbv54vga+Ahq15fLt8D/lSVHsWzHxhEzacvl9QFmi94pM23cs/1R1eYVsc7fW6k3Oa4YFonYqPL5ea/b2stQ8OnUB+5DxAg2fDYFPRkqxzsynCPotcKBo1vopnLggCrOhc8vWn0DOzdaBEYmGTOjMff3Nnl4CtkmvK8Wdqo0+nhT8h1wxKe56adzwx7G0fayp/Z0DBul5uP0+gwBQPcsX7GY6tceK7/hfSeiHvMUd5HGjC2EUeKZ0ONGqp1EtY9VnfyVLb5J/Xu2Ws11ygOci7GJfujjeG1CDQsS/LwxyEepeh8S2JoKjfvFKmd/97hh5HB63F0X+/YZqmZVsOBfMslMNpO/OFajgSQwMo1cxZ9PA0RzTvhzgtU8h67yCvHilNAukeiLX17ywDdiGvE03yXaUCC9t79N773Rl8aOYRf3ekgNgwiVwq44qJIayfKkXOVZbc2e3x+kOJqEx7z1DNEhxfvRhA4ns8sFGQ6Yklg79sDtJCCcWWe6PaTxjXn8f3WlKNFiOVSsMxg3HHL01z4dmcJEXdKqPF9SOBi6mrA193ywTS52pjS2JDQkt3m9Jor1OTe+CQm94O6PrjyR+IR9UIS+NnLlR4uvK9khA6Q3md80oG6x7rI6uBeaF0YxPT6zmuGra32z0NtWhuB6fvMusjgljjDGBInBy6hTc1VUVgNChqv9rRCs6RWuxzwMiDFg0F073NLZdhZaNxeT8T7qTwrNgz29ZYsQxlmUQyjW/obrVG7zvimqOcNS8FDPHvuMFFh8npNWsb9htqxSScacECQIpugioFsBqpTaRGX8HbRY+6h5UAw7w2OaChb2c+BxRlWn21SrRwzfG4BvUfLQuRUc6w0HrBkW94AAwFMm5SJ+JF4DRmWyvW369JurNJ/CmyKFBua43arGPWOAgLzTtCIORIX0RHz68tSeE8jgVSjHsMdgjAsXXx1ggW2ZoKA7V3E5gb677hOcc4TbrCYZ7ZBD9cHG8tA2LIJVfCpZzphXKDib3emVuqx6FR4jccBOcgfpdc+fRQXcu5SX8umI8sXCLKqoYvym/FG5J7tIRRtljSmqYqGfPqPX5ZMGotF3KnhMlEghM1DVoxwMJnNyfSJBQEdmZbv8oOrCiFlVGXGOIKscM2L1+9AImlx7kzcZu/KMv6QtujlOOPeojj6AhUoa8r5jusCdy8WetdvE6EDx+IMF3vQ2/pXL7q7R8tcji170Fckch+4iQqjtj3YsId41K/zLFSVQYYzC6Ju7LKKUD8rWa2DayCG/6cPasjPTek6T7jJ9FmteCmE+tzKFoxTd+71BlGsnjrre0Gy1R5atuHjJYw60QtS1zfurkmnOT7i+5ECgBIqWFcCc1gF7Epq7uAz0mp2zE+qYQR2/hnxZZlBcW1UN7Zb11fsNJyEt7Ro+3MhF+Z+srZQGmT+zNdcr2FY3jCsZXHjSfaqdmPuhS+blkzcl91EGw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a684b971-c664-48b9-878f-08dc9bfa78bb X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 07:25:25.0244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ubxRCafRkXZy/+NRojQF0AbTrqbNaI6Q4YoBH4UyPEn+o36n7PNwJHegaB0S6JPbx22McgdtZg4VCd3XvELjKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 These warnings are all of the form, "the format specified a short (signed or unsigned) int, but the value is a full length int". Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/sigreturn.c | 2 +- tools/testing/selftests/x86/test_vsyscall.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/x86/sigreturn.c b/tools/testing/selftests/x86/sigreturn.c index 5d7961a5f7f6..0b75b29f794b 100644 --- a/tools/testing/selftests/x86/sigreturn.c +++ b/tools/testing/selftests/x86/sigreturn.c @@ -487,7 +487,7 @@ static void sigtrap(int sig, siginfo_t *info, void *ctx_void) greg_t asm_ss = ctx->uc_mcontext.gregs[REG_CX]; if (asm_ss != sig_ss && sig == SIGTRAP) { /* Sanity check failure. */ - printf("[FAIL]\tSIGTRAP: ss = %hx, frame ss = %hx, ax = %llx\n", + printf("[FAIL]\tSIGTRAP: ss = %hx, frame ss = %x, ax = %llx\n", ss, *ssptr(ctx), (unsigned long long)asm_ss); nerrs++; } diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c index 1c9895cfc660..6de11b4df458 100644 --- a/tools/testing/selftests/x86/test_vsyscall.c +++ b/tools/testing/selftests/x86/test_vsyscall.c @@ -247,7 +247,7 @@ static void test_getcpu(int cpu) if (ret_sys == 0) { if (cpu_sys != cpu) - ksft_print_msg("syscall reported CPU %hu but should be %d\n", + ksft_print_msg("syscall reported CPU %u but should be %d\n", cpu_sys, cpu); have_node = true; @@ -265,10 +265,10 @@ static void test_getcpu(int cpu) if (cpu_vdso != cpu || node_vdso != node) { if (cpu_vdso != cpu) - ksft_print_msg("vDSO reported CPU %hu but should be %d\n", + ksft_print_msg("vDSO reported CPU %u but should be %d\n", cpu_vdso, cpu); if (node_vdso != node) - ksft_print_msg("vDSO reported node %hu but should be %hu\n", + ksft_print_msg("vDSO reported node %u but should be %u\n", node_vdso, node); ksft_test_result_fail("Wrong values\n"); } else { @@ -290,10 +290,10 @@ static void test_getcpu(int cpu) if (cpu_vsys != cpu || node_vsys != node) { if (cpu_vsys != cpu) - ksft_print_msg("vsyscall reported CPU %hu but should be %d\n", + ksft_print_msg("vsyscall reported CPU %u but should be %d\n", cpu_vsys, cpu); if (node_vsys != node) - ksft_print_msg("vsyscall reported node %hu but should be %hu\n", + ksft_print_msg("vsyscall reported node %u but should be %u\n", node_vsys, node); ksft_test_result_fail("Wrong values\n"); } else {