From patchwork Thu Jul 4 07:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13723341 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 E0DB3FBF6; Thu, 4 Jul 2024 07:25:23 +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=1720077925; cv=fail; b=owN5pyGFH86K+/PNmnI8YNmT2DSCZ5joJQGvRlIYx4zgpYaD+qvroT8Xua+uhAXW5ht4jiZ7UEpwyzqaM/JDaoSRn06eUULAyZUr8eOyJoCWnRazDBciRdrwCqNNFfmXj8lDZRKx/8xlSlqkfiVEx4TFy3mK84A+9lJRV45mKTQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720077925; c=relaxed/simple; bh=+r/caTVU7+hmaksrRkNzg6jg4B6JenlwNMrz4SAi5ds=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=dfMYwiZPnS5p3me6qkf9NVadBm+w2tV29lJ3fY6L9n9bxBiHz/4Z7NfrXJzE/Zve9fFoj+6wwgAXCWyugkIckbEzt1Z5rSVgLz9n+Dv+5Uo5sfl9lLOI3xHuERYleN8I5GKTK/R9elyUSaWHUO66rpyQDLcibUWXsFWquXlYsVs= 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=T+ZLXUYn; 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="T+ZLXUYn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+iL0BCV1/FbL7tasQUwLg0iI+OixEKQGNnpt6FDMxw/TcVyaIibJSOfLXfY9uID8x2rXevwwN9trRfd/KrPY1gJu24gwfmkBVkTmQdt6YqfuvkeEQjWvKHMqJlZLCeTveqJiz0cBXCu5iVwB4X/D32TgREJAQMP03Z+ZTXDHAkFc4T6xQHysCIWnLk47MtgPuCU0TqOoNC9chcBvRPreb9v9C0SlcLwSHOJHQBeYIiXbuiPkGl18N2A1lPY6Ou2AMrAxzE9OM42rcn8Xeh8pKUbJ9j3c1hjaPuZdVS4Fkexy1jCPJtRgfjU4/XBFIvx53Qqmi6FVYtbgKEfPLTKHQ== 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=Ua2cKYpBDMgb70zC/Qyj7u5icbVdIQutbiR5ekthnQ0=; b=RNeJ5wqLLtxym+FU139fncEScLNzgRzFN894SWzJpa8gNQ809zhVl/3XMqOaxv0CZah4qiB4TnaPZk6r8vDWN/uf9HBGdMXS8q0xvyF9hpfoMy88BiDvH4BNSIvDwHAsAgBydgjyERb7zFAWxYJzPH6WD4LKktR/6qiTGLX9HQyrQuzYUilqu+fQU8DVsuzgXOrpNJ8YiUWbsI0wzdaAx5fDd+o6g36RT1Xl2v1XVA8f3fIye+ryuqXgVquMJhmHUETeQ7Chp4vyB7iCGb6Y3aMn0APKDJ5Ua8gzmG9mP9JQcbdKV8QiqF+Zr3sfTpbhl+8DC1XNsVouTPdD/9eDnw== 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=Ua2cKYpBDMgb70zC/Qyj7u5icbVdIQutbiR5ekthnQ0=; b=T+ZLXUYnqrfS4ApWBfqbbtNzOofJcvJbURkVAACYwMJ7XstHn0Ofqp5vELZLpu2GDif5tlqhW84FW6XI2gOKn65qEcjaQCP5NaajPfsOGfBDSak6LHXG2YlJFvVlikyKZQy9QFg5z/HMU+ecBOSDxGra9DnWlTGLCopnCERroQUCBGdJGvOt1uWN3cvIADN380RSdIw5q6CZOOUwoI60xNM69WOmTVYCneA8+cyeKdYEUkDn5iaWbpDgUKNIk8wXVxfu5J81x82pISra1GWUiC3lQSwqFvEz3wGyOTlKpmealA2kjabSea8de4WIIn9+NOWqBXZ+dpxKMfu7EIvEYQ== 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:20 +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:20 +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 0/7] selftests/x86: fix build errors and warnings found via clang Date: Thu, 4 Jul 2024 00:24:24 -0700 Message-ID: <20240704072431.111640-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0074.namprd13.prod.outlook.com (2603:10b6:a03:2c4::19) 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: 5c5a47c7-3c1a-43af-9d5e-08dc9bfa762b 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: OzJnyIq1QL2BhAEn0ylMiXU7eX/VeDptvcFOiPkuJ/T5BbWU8PNbiWtTlLcrjIhocWIztSVpJ6w/JLx3yIsemFcBj2JvAC0+zJTXeQKKApAT+T/gybcbw/4NByj4pFTKd+QyVXaZ+Arbuwp+g7oBUXaWBiOzF5+rfBtndkNGDi7impJMludfBm0vKAiMcoEoCEdJIuhJoALbkgLre8psJP6kJxj3RhWGRQYdkbdbu8KV1vJH69ejUYG4XCiBL9dAyiVcdB63hptbqq2nsnrBjLsf43J9IcfqkIRi5VetRs5pnH/7Ft0ly4n+AHEFd6d5bht3uNKUx9Uh1J8VMYRsMJ5e1S7CDiz8YE1OH+q3nn+P0/EJU1koQPd5UmjsMPWnDYFNQAJDtJ6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look.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: hAQAQ01TsQf8m/DXaSxEb/l7MgaQgH5okrOzeMVUXRLfK/5wyIR9qVVfACtw7UOKutJii1PPy1aN3H+ZEuKhNhmWAd36qTNQj5Ek2cjx0pYoELIaHP6C5/glu+os2x8pLkP1yv+3objAlIV55Z3zu/f3Cdo7poqIw7Ig/Wq7eQVq4A6Cb6eHPE2XBEliblI5kyCPNrEFQhHZ/EXInjmuFTkD9dCDxH/E5mFufMG1Hq0DISLHSTNJvlP20L6PQA3war0VMev/RVxWbzKFskeYKefR5lQyGZmBduKgPJcxlihkAlHIGWtB3FYBaU7DM0EVSkgjhN1WDhwEieqXpYV5H5frBqxOIZGC8SV0JXI1WRZ8OdmvILZNLNJG04C4zQ6t0Tu1gRTMD3R9G7he6W5Kl4dMZcmj2b/1WeeeoyNUHbAPBk9f8XvU7P77N22ERiLKXRL2Rj3eKg7oDO+xex6hJmBPgGFg8ByBYnGEe9zXZGseeGl3EoaQ7XjW5GEnjg08g/5/GxiXojPBogTyEeShFtSNeM/nO6F0ARMRI62XbbkyEEvfhJEpcSjT3K3YQcn1pljEkL4VbWBjbPG/QXVLP4A8yFj0I0l8Knb4tCnpzuKUQnFaOsM27m5+gNwP9qMA43LQBYKEIE47K1gsr2nCwntmUkL/tyjL+YT7sQBhGY8D3tCyIBREFS5bYMRF4iW7+zxn84SSLAj6gDhvYRZHTVnPmEP1MT9s6obSVKUP9dcCw3bTP5axOZ9KGBgYEXatZDcBJlm2hA+31IcRFLtNYj082UMR9GwR0c+UxwO5Qvgghx+2N23X92zL1OStBKh07DiKx+EiESO0mDIKVyv+kDY+E43OvFMnl4XrO4yV6A1woK6Pu9vwqK4XSkZUg2uXjFC+hHQd9klLfWbwqkeuSsos6sjVbcNQo18qr45944uOAHMJvDvGNaumAI3LzMMXK2taIG6KoucPXiakxgmnkO8umiCRk/NKCQaYOdh61uCrs67gBDNJfjzL4bakQYADngRN28kJr/uXwa/vYSWb6GrLNlfu8LG6cGPM9SobP5447od/6iesVh2mBAWc3345kKh5Wcz3XrQLAnJQp/J3eEWJWRWHWEhIG29ayid0555fGiOS3ZJ9uAMipzQr3Rol/o8NRdweWsrwrTyScFB48L5+bnecT2fwwJPaSzud813nStPJtDTwP22l4+vVGsnhGuMzKQ7BlpgiF/r7M6hBQT5xdk/loS4oTFVb4l5a7aEYWHiymPOQIziwZG+Kv4zcFSG+GbueyJDudstfJWtb4WpQJpmrqJvyyFNf8JJOyC2RuBNz3LDlU375BdRsCGR1mEVocJBF8wBmfISOUUREl42LcN76pNHxwruusZjzAy653dfxAjGb5pEKwpl67A6Y/+SiB6ahFliJzqFXYCTkQ28ScJusXmTYJ7rKdLSGiduG4Ic+vXNcXKm5KmkLVHvVHY/LNGqUVyVNiFRw8NMuzeQTUklEs89f/rO1vv1PNYMWVK9FDYz17gOo6ehwApYMphadH3bPoVKqOu+wREnj0iYyTfB8mQbB43Ikh2gPppzt3oa2D4ud0e6ul9ef2dH0c3htl9h6g6kH3yoVCfSzBA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c5a47c7-3c1a-43af-9d5e-08dc9bfa762b 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:20.7290 (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: pH+Jc95Do/uNQsyYEojiXw6jV8mpVf7cZ1a2NyBd16l8q4m+Fx5yDo88vRQch8uHJyAnhYkbcDz67bZHoXeeKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 Changes since v3: 1) Rebased onto Linux 6.10-rc6+. 2) Added Muhammad's acks for the series. Cover letter for v3: 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: 795c58e4c7fc6163d8fb9f2baa86cfe898fa4b19