Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp671020lqh; Fri, 31 May 2024 12:39:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJdsi/kRYeRBpxtHoIyaBxk/CrFnTLl6KPeIi/dmeWwhka6OZqtruTgV+3/Q+jsokHOxZ1Tfd7DLZp30qkOihgfHG3wFlMwnBvqGoUzg== X-Google-Smtp-Source: AGHT+IEN9KTEPK4aGsTW+ZXUSpYE2xSWfU/YS6wyPU0tSC0bXy2Be4CVueWzpf34KNrxOcX2ePhq X-Received: by 2002:a05:6a21:3392:b0:1af:ac8c:4366 with SMTP id adf61e73a8af0-1b26f2d54c4mr3900938637.30.1717184356425; Fri, 31 May 2024 12:39:16 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-7024435741dsi1928491b3a.137.2024.05.31.12.39.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:39:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=DcSWg5ps; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-197377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1AD0428963D for ; Fri, 31 May 2024 19:39:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2093417D8BC; Fri, 31 May 2024 19:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="DcSWg5ps" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2063.outbound.protection.outlook.com [40.107.244.63]) (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 2D8A117D358; Fri, 31 May 2024 19:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.63 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184325; cv=fail; b=r6PkkKOYGOxbJGrqcIF4T0aViNuzft2ZW0Ye7iDBGXWdX/AGs7BpeZ0gV5PwwWo25ySQ7E+yUE4prKAJg96gQbSuLXfGaypbAmBt5FRQkKaKbzFu9RvdGrZi0X9JUCq4CNTElpodH+aGiB96nz7x4IGwH9pj9+0gqQqh5JnDxrc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184325; c=relaxed/simple; bh=ie2OqclMHnylLphlJ/DT+yCw3LgxNA7ecDYXdCmGTVc=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=MHJiGLLNLU6O7W8tMwWjsjya8uPSMBHG76q1NiY99gLQ9ClnyS3757YSQ8nCPF15Xgo0UwKjOW0nY1IOwAl2cHsV3nSqWHRy7j5JFwZi5kdL8BK3qVqcbvFgK7mAeUiSUeRedZIU2Y8wLeJt/FdWlrzKHCez1fd+246Wc6JfbSo= 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=DcSWg5ps; arc=fail smtp.client-ip=40.107.244.63 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g+W2i7kVKO0tYWtTSQsSvg5ql6OzFNVLUGp7lLShjhAWz/LwNeeGSeAdGYX0UZoYBWkTlQPCLDzSy8+wunDyPBjcz+ZO7qVkAntIWr9g7ylEZM4GomQXzOm1KsfjhRMg/4RejO2MnDL70b+JhqFPDpz95Y07TpPfXkMIf7lznxGstzYi/NpD9lD2IkbGFIOUsUQHftzjYML6UtO0VZoP1xM4idO2frL24L23Rmw7OSrzITjjBSzDZ1OYeULxapvXNiP2LIQJzGlqpQ9SRSJ4/uzMn8L1KtZGQo0H9e5Shrpu5fHslHTz4JRFKinvo2RY9+w/nC5z3dommKOM8pw+yg== 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=0gbvJvlxgGSEfx8wcjWwvCw7mOfUZfqC8rRe73WXMqY=; b=BvpPBMat4+gJuIWTuf8HKovVvHoDD/r6AIL/y7hKb+Bd+G7S1VADsJXVr5MNLrx/YRXgYWfHseDPrPiBcmldZdUd+R2saskqsH/POZYv2P7437N94Ea8amUTIeUXgqh4wZc3BWIK+Tw+aElf5WmLjnTpenkiY9O463IHiX9mbYinQ+TsmRWk/o8MGAZPJKXebeTtbOwlQL3rcWWbBbDo2CYh2ETtc7Cou/40V9gpsqgTq/udxLRvFA1Nz47H7AUAqo89sv8dAZxSFjwWKf3+IFMOf8tIoKlS8Hou0V/Czvucpc+/HrHA476bavNQ94IT6cw+xVOimHV2vVKjRkRYpA== 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=0gbvJvlxgGSEfx8wcjWwvCw7mOfUZfqC8rRe73WXMqY=; b=DcSWg5psnGjl9zoYon4osqlyKt4gVJijqpMwYmOw0Y+Bg8G1DUANIqDLgV0ulrcRPFDyBu4onu7RTpMG5JYuQ4t4qi18oOQNI9AEpkBSugBKL2RFRX77ClPlgWmuR5ogBhUtu9/FKiA/vlO27DEvNQZxbwSIsH4dGo2y6nV4sC1EYmJSe003QE8OJb0SSEGJI2YlWsJMb5PJ1QXmclLQY4k8lrMcKNd8Ez+VC1GvYv7BbFZAalV3iHF4UKdFRcKRhhToYpCEzgTL0SLhgBf3kOMWuLC3qXMY4Yx1qNixMUwuu/TabagcMD0jA1QfTGcxz4jLLn9ntWdRo5XlqBt1+g== 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 IA1PR12MB7712.namprd12.prod.outlook.com (2603:10b6:208:420::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Fri, 31 May 2024 19:38:40 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7633.021; Fri, 31 May 2024 19:38:40 +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 v3 0/7] selftests/x86: fix build errors and warnings found via clang Date: Fri, 31 May 2024 12:38:31 -0700 Message-ID: <20240531193838.108454-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 X-NVConfidentiality: public Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0018.namprd05.prod.outlook.com (2603:10b6:a03:33b::23) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: a00d64c3-83aa-4367-5dd0-08dc81a945fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005|366007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KK5tn7+mkpihbUgYxAwVy7y1Odd8685avYygAxtw89Ps2gkjMx13RfrBHcif?= =?us-ascii?Q?sKVPKy3h+LJIWuHjB4dcn3EEMuKAN3GCE78/UHJT0iJnVRVqWcrJMuJMZXKd?= =?us-ascii?Q?Z3+BlaFEc0dQvifEuNCwC4q4HqCXZ9Xxid3bwWePaBbBniyC5PWOSkMNRKPn?= =?us-ascii?Q?kTIg9H79Ezdi7TDdOLntBq6kdoUfr8vA4oc0OV1iHhBjPu4ETzsR3P1GvN4F?= =?us-ascii?Q?hgHfgTrJev7HSEOE2CG6MjCafuZhN0dHNZWDYCyS97Dv2SJIrOkmgEq63JbH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YLB2ckNLbQso4fQltwhFN0?= =?us-ascii?Q?M0r2yON5C39Oo0MxJhP6iSDg5tJdRtbkBbJCJ/SqfgKGejdr1MqgCrn5oGdq?= =?us-ascii?Q?Ql7OtRXdaNrEFz6YRx7/n1DUneqdBAghq9egy5S6oA=3D=3D?= 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:(13230031)(1800799015)(376005)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bBeZDNtMgtmO97bdwAdcphg784Tj8bkR03KfF/06vjBCcUlAiVJghoPauZOd?= =?us-ascii?Q?VOE5UD/em2RXcWXvlAgJveUE3l0L6TwAIcnhWFaGvkADUupFxD3NJ3iY3RMH?= =?us-ascii?Q?SOYoEXxQDJZkZw1k5m1/wZwMmiU+uI6K9bl42o90jBeCd0v5531SGkKrpnTf?= =?us-ascii?Q?fZHLr3MjcmgbWr3ogdcyrIvB7meFCWyaePptyxsMLPNRSjc9Fr6fVtO6h+K6?= =?us-ascii?Q?UF3rVTO0U92D14JmQgC9ld5AmFW98wU67xsAcmIa4KGTHUshrR5GlzdLattV?= =?us-ascii?Q?z6mEfHI0px3lom9rpM7LRNPHwMNz4oJ/zcTJtJrqbAdSnzdmkU3pCXl7pJmT?= =?us-ascii?Q?gslnxX/rA8xGY+EgpxAwZPG0M8+bSa8kMe3HDCxKFklTUAY8OhC/eFkxB+3C?= =?us-ascii?Q?3RBF3YKl8AAgSBZbalxS7PMI+6s1RJfoP0rtj36vrLtKd/43ClgxVxbXMU24?= =?us-ascii?Q?ZW2dhlkAitEqGpdj8AgHa6hYkb0zW8IoX6DURwnlsRQnXUllTVh/HjMvlas9?= =?us-ascii?Q?dSldXD4ITEQhwl40/5hROPY1necBx3z3Krez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8mNr14pK2rwX9HHzYnYB+HnJzXwjv652GeIwUewqbnnzvR8AEnrwzEQwQO?= =?us-ascii?Q?q8JK+sHV+PLA1iKukEr0+F+epR6e6g57hfsWEKSIQbC1ZddXziQFLh5yxy+N?= =?us-ascii?Q?pigoNU9d/hAn1az4m0pY2fEsBONa0CK5b8/dmqCu?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a00d64c3-83aa-4367-5dd0-08dc81a945fe X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 19:38:40.4416 (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: rLfGlM+6H6f+TbOiaRxx8ZcW0V9r/ENz6j6gBh99rGkPYLf4YMJ1ekhXZFuEFbjkpuC8UQLpA27fwsDjNlnG8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 Hi, Dave Hansen, Muhammad Usama Anjum, here is the combined series that we discussed yesterday [1]. As I mentioned then, this is a bit intrusive--but no more than necessary, IMHO. Specifically, it moves some clang-un-inlineable things out to "pure" assembly code files. I've tested this by building with clang, then running each binary on my x86_64 test system with today's 6.10-rc1, and comparing the console and dmesg output to a gcc-based build without these patches applied. Aside from timestamps and virtual addresses, it looks identical. Earlier cover letter: Just a bunch of build and warnings fixes that show up when building with clang. Some of these depend on each other, so I'm sending them as a series. Changes since v2: 1) Dropped my test_FISTTP.c patch, and picked up Muhammad's fix instead, seeing as how that was posted first. 2) Updated patch descriptions to reflect that Valentin Obst's build fix for LLVM [1] has already been merged into Linux main. 3) Minor wording and typo corrections in the commit logs throughout. Changes since the first version: 1) Rebased onto Linux 6.10-rc1 Enjoy! [1] https://lore.kernel.org/44428518-4d21-4de7-8587-04eceefb330d@nvidia.com thanks, John Hubbard John Hubbard (6): selftests/x86: fix Makefile dependencies to work with clang selftests/x86: build fsgsbase_restore.c with clang selftests/x86: build sysret_rip.c with clang selftests/x86: avoid -no-pie warnings from clang during compilation selftests/x86: remove (or use) unused variables and functions selftests/x86: fix printk warnings reported by clang Muhammad Usama Anjum (1): selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp tools/testing/selftests/x86/Makefile | 31 +++++++++++++++---- tools/testing/selftests/x86/amx.c | 16 ---------- .../testing/selftests/x86/clang_helpers_32.S | 11 +++++++ .../testing/selftests/x86/clang_helpers_64.S | 28 +++++++++++++++++ tools/testing/selftests/x86/fsgsbase.c | 6 ---- .../testing/selftests/x86/fsgsbase_restore.c | 11 +++---- tools/testing/selftests/x86/sigreturn.c | 2 +- .../testing/selftests/x86/syscall_arg_fault.c | 1 - tools/testing/selftests/x86/sysret_rip.c | 20 ++++-------- tools/testing/selftests/x86/test_FISTTP.c | 8 ++--- tools/testing/selftests/x86/test_vsyscall.c | 15 +++------ tools/testing/selftests/x86/vdso_restorer.c | 2 ++ 12 files changed, 87 insertions(+), 64 deletions(-) create mode 100644 tools/testing/selftests/x86/clang_helpers_32.S create mode 100644 tools/testing/selftests/x86/clang_helpers_64.S base-commit: 4a4be1ad3a6efea16c56615f31117590fd881358 -- 2.45.1