From patchwork Fri May 31 19:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682043 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 011B11C6BD; Fri, 31 May 2024 19:38:45 +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=1717184327; cv=fail; b=V7SGjutARCCXITa7IYAlilmb2FXp6A1sphhrBWTgkS1EPwWLn6rnciNGBktFakjOBDNCyaTqp+85be3uHtKB+RqD14HT+Ho/R9gLVljAyAw9WHoZKzHwkKNBjWA46mon9nLLBJXNcFuuxxx2NogVT3bzynrVYK+26HEKKKWPDO8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184327; c=relaxed/simple; bh=NXo5OHWH1dlLO1+Cs6gbTvprRat8q1X+/kFGnMDxMP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=KuoPLbHOdipX+/23nq00zfjgO+Me++dM7i8ct29E6qz16MLPUxU5oIX2MV0itBxMxWftdaj6Xha8NZ8gmXEbcBWow5gpx73CkLiVML05IUcA4mnXicXM1NVQZ3lRIETChlmyR7TIu4dnfhMjyMJvP6l01I5nkXJG5+8OCeIbxPY= 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=qyTq/Gqu; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qyTq/Gqu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJ/uZQeQFYsnah7M6yGusGMj2aykUwxPLhADtCnOls3UXhGBWJbmT2m9XKkKBnr3DJvLeDHTH/aC0gqGfLC4gYqlfq4218ClmNowsTSgb/XGNSudHUw2VRU8dq8QTZN3yWC5+hja0SbexC51M8cNyaS2OPGKlOGcJdV+S7NgxB2ToInlUgBp3mnniTTh88FTt6y7yznCvqAGt0FM3bQVI7gMMf8AjIpR0dG/KVHRBSaj7cFML6tykt9YKJQFdjDqKpHmpxc7BGQjiZY2hvw0Y5Rt7geoxVozT/7xRZlSQ12PLK/C2XP6kHvmxalr8Z0Hp3uaxWQ9bL47mAyU6DKZlg== 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=3JpfVRS3ifomvkz9hJqZbKn/0k62rFK4N6x3Tzj4cz0=; b=eR9ghq3MPnSChwk7tkJEFR9+Toa/DePQVJyNlPP1scnDPcjNs8cy+mudSRp3DumCv/XZP7wQnrPUwXad8itQoO4mJhXznk3FcbXHO5/O0/jOuuITrNf/5JJZk/5ZKpwS6x9LYgapdpNf2iGFtwVBbN9mua1F6oan0rO883yCiKFa8GLUlzT4icMDBJhwt7Z6oirWN0r6Svd+qKZTkrVl3vQdt4fNrkIWMSXKvhE6pxPMtkvFLNeH3sLKcxVvEw4CEZHkFCVA32qB2n0QswxtJVdn8Y3v1qOYCYlRdMPkve3wo9DZnt5vzkbgZd48+0lvVaORiat5SkGCfKjMnqIdcA== 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=3JpfVRS3ifomvkz9hJqZbKn/0k62rFK4N6x3Tzj4cz0=; b=qyTq/GquVinKqcY7QBtTjvkgHc8a+0fOVOEQixPB0HAB29Ot6xEDYaTJLxkRl3H70kw1b8KXP93J2+f0akckcdCbbiC7vRImGXbIq7ZLZOfoOh8pvDF2d3yLG7Fx6EITKqj9M+1TiUquFlHJcYwoWaKWXSeo7LgnTOde+SR+ayHfn44K4a7YfHadyrSNBIHKbgYfl/URiExYvbSqy1ORJDVy7tYOt4IdXdcqDKOLmkLCmkUP3cVP85Sx1A7aYdA6e8BChrLl/NIQ+467mM+Uo2eU/EXFM0H1UIC5i1I58W0q8BeKDcYBzX94i1cq7zVvm4XQkWADw8bGTMj6FwR/Dw== 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:41 +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:41 +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 1/7] selftests/x86: fix Makefile dependencies to work with clang Date: Fri, 31 May 2024 12:38:32 -0700 Message-ID: <20240531193838.108454-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0003.namprd13.prod.outlook.com (2603:10b6:a03:2c0::8) 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_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e460985-5d30-4a27-257c-08dc81a9467c 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: ce6LLYyug3MFv/Y691+7BmeTzqnNpeQ7NfZgqRUyDeB1Bzgn9S+4Zv05gsieEUuAJ7lo3DKN+rae0N/U7BZu+oCTc2Hbf3YofF0VBsRw6XHsom3bJFYklV20NiSTZRjOjUQrw/Db5o9dz6iq81Ua4mXDdhGyUi1fLp6qMkf70D8ZX77O5DF3YW9tN/RDcrSbpiBu37gQ5YpqhSJss3OvPHW0LjWmxW4AWkAk6hiXisE7eNitH6Ue6pItgy2qAsNU9zkOtSlOSNH9ZEUl1x4GtTw3dr17drlqoy1pQlXvkrXtf6JHLolBjfKppdGV9rkHk8JdN5MwIQW0o0qTfLE5HFUD0PhxK6y2dd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EOjPlcK/iCthqa0DTPe3669oW87KAb64q3UC3QnLIKrQMrSKJfqTusDnbdSF2Wbx05Lyma/onSxcV6OB8CBfHmNFNqlKoKV1TNdjY76yqNcWDzoNQR+4gss0YzfXrfzi6EBfGR8uNoC6ZhDBAmgODfUDHypWwpUBFhTGABldysCRiBbV+jarfkibOhYX7cFryTY+rK7MB4v3eJeVgSg1KtcZzGi+UQ2Dxmo0Ohj09yHoQpmRaVD0nvRClejSiCIRmJHpPvXgZJwtqKWPCuPoNQvUzG4GBir2Q5kvKjKhowX2aGeAm2fgeP7SP/8CtiHMADdp/Csim7Vvvzk/ENdbfvf5qxHbUO4lJhwALkVBAWo0zYKnHCtnCFqbGO84FpC01P1iBA3MnPzxrHAKkMeX7xhP0ywe7a/PE3TW2PmeV1biD8dBgupUjkeDk+nJ9pQJrbgxXMK0TarIACXlFpJpz6NmqtIMY7PR1a359naL6+6HIGzTfItycqGInz/01wkUgZiGJD3QxThcoeKdaOSvz5bM/n178V4peAzl5tl1RnM3/ICTnQuItXweGkkxVWuET+bf3378JqPQr60mFhzbu204pbG4UYB5midqfE+1C/b3g4My X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e460985-5d30-4a27-257c-08dc81a9467c 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:41.2544 (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: cQs6kbB5hxdddPTu+SJfRc+MH3Th1ncD7dkBCalxE7lGCueEnlns3znTtKxPDm0ikcgloZWBj0gmQz7TrA6HVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 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. 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 Fri May 31 19:38:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682044 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 4CAB917E456; Fri, 31 May 2024 19:38:48 +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=1717184330; cv=fail; b=NHpT79Q5JTl9enYobLjzzimEtsjjRC/zNi00GrA0f1TxLVf/y4siXYq2ZQw/kMbB7X2yFCxDE8/Y1rGXe6BpIMjV1SHErjS+yoxmozF+/0+SAPVxX0TpD/JbpyjDdTtelpq8uYceN+/PlvRsGOiw0HKT0PfDC4Qi9tswbFxSl2M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184330; c=relaxed/simple; bh=j1r/O+m5/SnyXJQtoW7/oSbwHkqoSQcmc0v8OIHSqCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=EJf6yz4Hmhf7evnO8SPPC6wktb77WQWHqg4xVEDoINl8eJORRR0/LX+Gde4PvErx+2JuN6GoWJmDWwQ2FlNHYtZiFUi3nUFEdEc/S26Qa1htdYIJlTOjwI1ywnWwqcUuI+5LBqsuvoMjy/fEP89yi7gv9LkEKib0Bc0fFEtZN1U= 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=im8TVFn3; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="im8TVFn3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGsGBXiom3X+Jj8Gij5A5OyYmzRwU1dwqCfGCuXIx7Y31Zfsz+5/POiPns2qlVHKCbvfbQQ2twjS8HXeIgEotLW4ioKWcdEixitweOgbY5bFMHE1C/U54QvvbKa/2e4rBbZulWBgX2rvOouP/Bkf+IvkidQz57LpzGOvn6oCms1F7lTqFnF9HlQ8HDAnumWpemyDwuklou9bCqcUKqAbczq1msnGV3v5blzP8JYZerZ93UQWTzVZQ3WS0qU7HyQ08DiPs4zyxZD/PjrYbz5RZgFTGRf2c+KUDDtrOLXf4Vy86HQRC4xAri+Mt7L+DtwFzw+7kG/ZDzZLHteWhmM3BQ== 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=kifX0dBfivqv+TOr/XeTYG3usjOdVIqdYoKHiCltU0U=; b=j59Vg7HuGp6vOpuJLDQ18/OoUScDgP7mRPM2wQujhVxqOmjwvXdlO4HacktrxIlbq5ehLr3c9gE0MphExiYN55tFqfUqYnTNwJfN2SXVPReRnuAlcbu3sRbHY8q4F96oDgVYIJuSi92MI/Lm/UOEySHSI7xHfcx9M9ws9Bm4rbBNqK6lvyrXw8/+VQMHX+ojlI4VKLmevMHhf8Ret73eEK2pRnFirH80EZMd749nefbgTJnosgnRuV/b4j09KaHQKMmIOZF5oRtZ0xmVT1osUY+JYcbkO/sePjvlWoPN1CASu0N1AT68sA3L47rClnVhfWj6HjCfDfVT5yP2VtCa+A== 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=kifX0dBfivqv+TOr/XeTYG3usjOdVIqdYoKHiCltU0U=; b=im8TVFn3zyFpmm/dzoT3hs8ukGO2RncsgBxvW+bIYfQhDDC42uu2sbSl4Oag75IXz7qa1qmLQ99qAV9pBrcv00AGfCwZ4uYyzkc2d1iyE1O+eNb1urKQMCVLVbhe/g9gLDSubJEqqrpy7NKmEogR01DT/qW6kMO3rMCXJ+BSnQ47ecnkqCFBu/v1A5jZOnsNth9u9Mj2Z3MfsRqpWOdzrrCrXHA1SMKpaupJTo7eqvis2PTbnuMNj8n+X2p0uhg5H1wbIvAGD6hmiK6E9T+IX1josI8aXB5dZk4iT83ToBJQjffVG5QAt/lJcmmQkekp3VMbIFnrmmvlMdyp3nzuIg== 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:41 +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:41 +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 2/7] selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Date: Fri, 31 May 2024 12:38:33 -0700 Message-ID: <20240531193838.108454-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0072.namprd05.prod.outlook.com (2603:10b6:a03:332::17) 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_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: cef0077f-628c-479b-f454-08dc81a946d9 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: cc3qVp81Wsh1bsaFoXvJtVq8qg1duLI63hPHXzgqe6yPvz8XOJgfK1choLSTlK28EMerBHrY7ZHM/PmNzX2JCITqTUsryS4DBbePPQCFuh2fF55rNxQngL/y5g9+TKFqbp9fcx0kHLUr2QSuvWjS0+AS4VWZWflvY2X3dFN7twMzH67sqNUcp2QxYkPY757bK/G8QIg7uarwZO92wrU7bi1Lq+Z+1aCMbwKL/5bypYUUeReqwO3w7utc1HEPKdPTNu94H22h8bTqnI+WaIoF45mQ8Hgf2FBX9hLmBV7vWyWLMnCRXWfmY2EVapwy6bMeHJP4i13NhCXNRfSm0GKt3JrEVAmQzRsmgXeBBtKxfIwr9Ogm1qOusawkYZAITBNtlbLSEz/oO7jzs66Uukm54k5TP35sTfvJyzyV3Z9k40pKaU/JuGB57t1OMhc3SUieFDMG+IwqHDwfvCLel3I+VD7rZ1+D4ZrShevgn5oIB+iQOBkVC5+ce5o7meXW9IoHcWe26YJrzMOEgLxQhyXYmS7rDveIMJ6NOpqjpirC0iOY+BYS7F0JOZprsuK6S8o+vjMBf2fvuresLwdeR3tYN2Wo+TyJaAdJ/a6hM6Ar7s2zmE5usJABNoW4PvBrYTHXQ4CK22IEbmuTJrQdvWkQfRkI0F7fzmbpP7dsay/MMTMSsw5707ad3hQnp6moFwFA37Hj+UOViKIbtNr2tAmsDDq623slvyj89VDZniN+S75VTwP+BDicscpVC6unjcQ0V7j9vJyoRNaazi+DH0d8jjbNtZ1ouuTOaRKHbJrZ6C3yLrPJJEBJdtxur/s0xX+jobYznlszF/ejD80I48i7iMtOqhg6foEvoW1T5p6WeCbUi+KDmmIoCVsJl7BunFjkUXqBMfqUJdiPCRXZscKGwdcsa0aiHk9WJemwCL/lHUfqav3Kvfe90ENm9OimqtiwA4KiRZmT9O0+TKha/MdchcaRoxlh1rJQs9mPf97Vuzl+wmqdCbQ5oyS//1EMFhk3yC2he2b15RmNRlu5a+KoLUh5DTTQRiQneWdEJgXhXPyORrN9MWRNxOQZ/zIqbqCwzuo5d4A2BZtJl/AdMCBw00/a4Nz1TbcyjkQkiPViTYGpmFVKbUVcdZJk9EWm5quFNZ9dchPau0si660aj+UmL+c12STDmVUDaXerFQtCKx2wDWuHSWf7byEWzK+igxYZKLDyMUm+RGWCE89YmexBy1uTwomdBlKCpF/ObwGl+WsN7kh0jfySDRtP0E9IQLsa6cjdR1BWY4kKaUdqNYxshQ== 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: l3Dw55TeSySlnIrt4shEgLbfuat5p51eSoZxkYQuWGd54N1zzc8kYtreNY/J1579vc2UwMdxA8IVlwZ35gUa+O+I71hFG/lfyhv7sxJfm2TOUiBES6LpsIKLNW5KE63sEMmWRTTeeFA2v9u4r9RsAyAqb7P6C+Ty8sK2/Wr8SMi1JAgb7h9yBXqTA3vV0mFX6bB7OuqTx56GJp2CHGeaiDsgyAfCsu9vrgj2WmnBMgKK4nWVFPnSTYKBkYICLoeU6ZvHHt9JKF14q70/3Nt2yjHkc9V5wcmlBcI/gRjszlpUFB1dveY7K+TkKCmBYtkdRxWzLAATv+yIrdEoYvgG3ffBvGDunrF1TCK7DlcjIgnnJzjUfHG9RQ4NESSftNmjB6a5BR0KYVm9rGo2UmY4BSdXCZ7HLvK8OgxQrL4iVSSkgm/EDSVKRoXYeHX/Que0Opve5fYEGzj+kkqSm3LVwGEHb+88FIcxLF4Qc3rVhneGiwrGg8cdb1MFy2TX4NaPlxrqH1WIoEw0rd7vQeDphjE4SFSWFuJgAR5ryJnr6OMFRqz1nFcqqgdVc7YU4QX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f-628c-479b-f454-08dc81a946d9 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:41.8638 (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: NP5JlPt+tBcu6nnIeMzXbIzCVpjOKwe78gTLA+A8Xy8QJhG0CZOjUJcOUghukuNSra7nX3/ZYHOMpTnfXazTNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 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. Signed-off-by: Muhammad Usama Anjum [jh: removed a bit of duplication from the warnings report, above, and fixed a typo in the title] 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 Fri May 31 19:38:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682045 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 5E14817E479; Fri, 31 May 2024 19:38:50 +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=1717184332; cv=fail; b=e8rgw9rNBNn/3iUlC//HeCbvdkVDPU49DgFtKy34wNMKXi/y5wwVWj5Q5kbpeFh3rOC+bhxcrNFoDdJJIB70WbObS6GhbaAKXAK0UKhAprwIatGxVKAmB8vA4clKjeOc50BOdkPIiPpexywsaxP59dSCZiJ8rtfqEzsCkscsR4E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184332; c=relaxed/simple; bh=mBCT2MCnrTyQltQDei7ef7SuHYpumNtvDyYn7JVI9yc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=PAbKV+VIBTpyrq6wWhxx2tuULMGS4xDLqu50JIGOxreNk2UPK7yl5d9GDpMgCnyOk4H5sxlEK/+5F2uzCMUIwF2AaY2g2uN6gKmyqphREtH8tXATZaQvvxgGNGfMICyO5Ml0K9zMtZhLpNFMV0H0oMk1mGYTyk7LLdjWr0gENjo= 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=AeO6DSEi; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="AeO6DSEi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jObT7CsRZuUVVi6Vv1e8SVO2Rd2knKVMCR+JYf5OE3Cw/UO8jwdbxrJ8Owr2+ELOGVCxpH69JI4MbLInNSoP7bSJfqQwEgdOvXQDAVwhcBHTd/dl/BRmoNZHkwEmMIjjUBcSyQmg+TvVy98pcAjSbZYEr7X4sJD2T+R1R/GrjEKEkJZyRlcmwubLc8x91kY371VQ/Qr6CDOuxcFw+u9xXiAkF9knmZiVqJDu3ypN3fVFVwMh7ou4bkoC1HpIiCSzKjfxVu0pXclNS0quOIxF+COrsRqX+Ps8w86whlDvDWzivd2LfnOeuxuqBstqhNgWcURP8eL6eowYYlFKP+GcQg== 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=/tkbxLO6jAdxUKHgdSlhyseHH0AZgmarl1xrRnVbabo=; b=LO2crAuIUt/aVXXuKe1I2QyDX16BdNmmvhUdRL/0cF1gMw0/onC/fPDoUyRtImiZTuvsTZ49FMENm9BcBaGqAs7cKX7AdaBcnzkAxD04yFsCxxePNOjdRR5XpE0PacLwuOjwL2TwDB2DXZ5/ba4JaNfZl3BUweWV0EDpUfpjLolGZ/Wehsf/EYq12wEwHIPmke0AxYrhWWPX8Qs0Aq9ctgHDP68G4MyCiDwyZaRiN1EcmBAv7Cyut4O/rDbbEJ/DOzuOx8aCfQmosx9zlgfC8wMXff9FG4TFKIf5RDZYWgjqcnb72TB1PQ3wrlkboO1/fy8YfgHCXE7Vh6vxlPDLZQ== 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=/tkbxLO6jAdxUKHgdSlhyseHH0AZgmarl1xrRnVbabo=; b=AeO6DSEiVWTbRwjUSfG7hUoCdaKBoUpX+5Nvf1SQn6H1DzEDdlvuzpLQj4xufTPxGS6UbRuqlrJqrAEXn3hc5pvZWb817Gb4MUlD6Hxat6FVfjy8LjG6W/Lw0opy9t/4834celb7siZgw9L6a3HRHt1b1eZcu2ZqQDxfAlkL2ydRSmQHwyIiTLoOI/Kef9mdwPWn7AQMBTXNXtnOG8tUQFTk7Cv36uyCARX+wjcco1aWikPuRbc3+H+Yr873/95BzyG8Kn/NVi/u25+WycCo6PN41I5gvhfk961603CXmZQfxII3dPrjJcds8bMrU4KV36FLtkHoPt3Q8efuVU/8XQ== 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:42 +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:42 +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 3/7] selftests/x86: build fsgsbase_restore.c with clang Date: Fri, 31 May 2024 12:38:34 -0700 Message-ID: <20240531193838.108454-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0020.namprd05.prod.outlook.com (2603:10b6:a03:33b::25) 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_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: 41ec0ea3-9747-4a06-4d20-08dc81a94726 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005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OEvwp94VpjDdtIYeXkRIUKSFXFGDrXPjRxt6m4LtEYBcO0Pj0ckGXqWSNoeHfX8cOL55t3hy9iE4ZLxo6q+hmo0aaJtPyU23zwp+AKw85Mn+r9xCKk5seUzFDOGT8GzzPV4oR4jv+vC0A8I9FBr19nZpax29ZN7aOjCZi5FNADZ3KvTJFWWHjCWSyW/29Lv+QfjawS/hrGuns8qjgoZ6+lJuW/8OGGSeNa2aCdVmQQ5cbB9cSJ96wj5l6tN7PA== 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: r/EPgmt8j3KggWG+L4lY0sOTlnbjPNzLXrxQRJ9zNtL/1pNzf3po7GAX4USRT2OMt8vgBWve/WYGPAILzsJqDtbLsEBjJRnfYK1PAlyf+UKJ/pQT1T1q5+02o76NSl287G+ooMyvh7qZaS39N0t94t6mTfaQdNGf85eNmMiXDfnVw7iL0nUGapZ03t8zRMQQmMVJqhA5qaoog04yZiO3Hh5kpuGEik+L+IjN0CYj5d1q4V6g67j73213Qbm6ZH8OCNh4MyiszCZ3LIK+EWhLe+tqlA9hGnup+LKj9s6n1+xJ26bpArYJk1p8WD7322knQUPRfSWn8VqQY/m+xLquXsGJrS2V/8sggxHj/vnnugB6Lj7TZ1WvIQaUeW38o/hcqsIf4uC5VdKjy02k2QuLYCtPYecgihrV+5oT+hZVREOEuayYFZJp8Igvtabq5ALLI74PyE3ImhIZDRSMMYGYKonaWByPaGpABi0n4RUYJJVlvVcJCFK4Nu0mj2/unNc22R0Eijpml2G8W1tKlor7gF9n3XzXFUIQU6ReGUblmknJvmm13Ca8ZreJCBm4jY+mza1H0asTnVaQluU9KPhEeQfo3atjgDD633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ossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 19:38:42.3617 (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: Rz/TvqQZPWRsrcDomN7e6KpAjq7Knvl1XKZj3YHQt4wBAaljqJT8kBP8eul2+sTBttnt5Gj2DpylX3fITAcNRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 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. 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 Fri May 31 19:38:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682046 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 2854017F4FD; Fri, 31 May 2024 19:38:52 +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=1717184333; cv=fail; b=T4bX1qPCAM2sY017It7H8WBBZX3CL3BG3sYuIE899/ukb62ypT20F8UzOGdUzoJxBjNEfzEXaSbkaX7QyP0DhJMUDs9NDJaloUdXAUli5+w/LnPmu5HvlHlxbgpx8sFaJJtWVOCm2inFPYRKXNhXDf7d7PIfGWzg43+IqsaMwHc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184333; c=relaxed/simple; bh=sZCxTxWEtQxZGK+EifvLv5cZ5W/3JRXNJXdq4I5B6Cs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OwatYp9ARyZRvkIdbypGKtlX69wx0syTKrOscxObNhacnBDvGt0/ayzlTBQLwZRh2uJKlpyL4YPfVRjzGgicqdGozPKtLdAImy/3SkNY7TWUPGOXB9Z9gFzXxhRGxi88yqMCPt+XWP5Om591s3KshQX5orPOFkLU9LH1q2cBY6c= 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=NcnQlOXe; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="NcnQlOXe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XiRSHgosmFajUhurbwMmoB5x6tXWfcEox4+yk+Vx/xYcjxONjhk924ut8VZWF7TAXYHj1SnWNla6rDp0LwDWCHlpuLMdWmr9fbAFTIrLhBOjI8J5I3mHwIzBd2b1pYcPoY9A+jNP87oneyvjeTMadDDv2Gn/TDvBTePuWVuzfKzg+K8BAXkiPNkgNvQErs0YyIHt9ao6tOeYlT/xNv8S+QjTWSrR05cUgrDBrWyUFty6h3ysJqKNPBuKFCf3uKDyiKlZjHZ/UdHttM929b+2YKeFkaeRhxMSuY6NoP8lurpgRcbZV8FrrOEV5kt1nSfY9nqiMxVokCChudLyFWYMhg== 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=kERYs7d59/Z7pbTD2r2wglhAfIzLK2oz7ZzqEz9Selc=; b=Y70ttOb1MC/aX/EZD4UjBaz9tXFQBOXbpWk+rTZmM4oj2TpycbCUJ/m1USLI+dF6WNXrJrjQp7qrfiiqiPwOLyAJ8v9rW5p/HysAOX6wFLJsDBVOzw0UeYjZ9pNNZ6VGcPvkkclWIe9/qnnc3qgbcqk6jKwarpomybHsvIwyVnHt1wdPp8DwbBVDxWlvOOjk3ouMDirvbkq2qAWHWBnkkeD2y2450THEiKq+fN508f+DIj7XsQVIVXJOlKgCAyO20QEJ8LtWGuHg6nzUTdnTkQSfQ1zRkDiFMPvgfOK7+wVoSUeoystKg6+GnWXr720MG/otoMNDr5JAvRBlarvZBg== 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=kERYs7d59/Z7pbTD2r2wglhAfIzLK2oz7ZzqEz9Selc=; b=NcnQlOXeZEV6+LRHH+gtk53DgvGh3LmRW4BoWigSUqx+2+rVOlxZ6aTiG8Xpi033O9dvJ0sKR34TMS0S0/HSaIgjx/QFezsTlwypybI3BgDx6fPaLd8+DuDD0BAlXACHCLsX0UASvfFmHHlJNAL8A3nXw+3G7cq0idwsv33fYK24cINpRGA8ejJRnv75uXiRSWNwMZPO959RocQNMdd3T+Zx7ks/8Vv52+uI8zY6f+H64G4C1PV1qOS4ZACP0A/Y9Kz6GCoHlQnX2QVEBJQ6sHpLmGM7W/m9BmtukH4EHNHrb3SlAHum/zyCrjup/x54cya/jktOeW2D80qkGpvI0g== 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:43 +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:43 +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 4/7] selftests/x86: build sysret_rip.c with clang Date: Fri, 31 May 2024 12:38:35 -0700 Message-ID: <20240531193838.108454-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0062.namprd05.prod.outlook.com (2603:10b6:a03:332::7) 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_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: 729b9ecf-a275-4fe8-b3b7-08dc81a94767 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: dqlX0FPCbiOUjN4w0ux9tGScYxVDQmHsQV7BrxJF1zX/n3828zpf8M8NLIS1DSKICNIyo+v4o/FZrEhfyVF0KzIA0leSzuObeuv14pHvuuN27cLyGlhOqwg0vVQ8hnTXsHGSXtr8xaOitKpOZOgiqYLPTUoU9vXkQNU9NtYwDMCB3z/77Xmd6FkQCoTe2XNqo30IGwJmj7xbCngdvh7OSG7OjPzmJhiSAwmLP2kP7d9KVDnQEpcmVq4bSgks5nKMoDue7eI10NQYBjCfA1x2xSmgZC3soqCrbXV1ZDKlnwf4gu4R1TZC7xIPHXL4t9KD4NwmgCuKxz+PvXRG9ifg4/cs+ah6hlVAoLtwpwmP2I3bX/j23yvRRvcNEsv9XOFu8puQlUvof0kAe8NWwGureLxHsw9VPlyEtH6SKD3Fb97nvs2JwiFwJ8/f4k9ZV8EJUoEbvniABuLW4icyh127gnXWOFLE5IMv9om8jITgLLumFZIA0H+bxodD3PLC4ly9/it9eUcoa1iOeLyYRW1KEad4g+YSXrwtAKOBLflb4aOFNytRe3o/VbgCPwiOZgYHm6ZivIjY2opTnt9C4dmf+CR4Q0lCdlB/4665s7bL7jboo+hk7/ZYtIX4oHEq8BRMhvfb83JCKs3OrOUPZmAAOn++5hfBMSRVjbnOIKnveLwZYoYMHvfGuSDCsMOsgIYN+zbVyKXZDYbNKCTwSAlREYDN+52LoFv0N8FtFikKzb+J0uqrky1XJKC29ecfwrjMmemcqih22mRURrWt3u6zeTdQxuccogs+Wx3wBxLmPFJchT0VDug6hjUhy03nZPMIn7S2agsFV9wlTklv2Qv8XC03NnRyG8nTr+wI0isfXPCIoK9K9LIy5goV9APiXeMZME3ygbxdgSBzczpOKQXczBpNJVr4bmsVEeU5tAThE1Rn8Fbdio8RGCFV9iawtaFWfxwxKDRtIiG6hIZPk9v+PRmED1Ky1x1ojJjWAiUPNf66G/pf4E/xlTRNTzhWFgP3OTibjzEeFqXLhlFpqLXTv1XOyh8yhnhUaZaiSBT+pB7cjMyWZ7QAe5P6r+U5bm9pnt3ahF7x8q0edC184dXwzF5k9YYAbgJDWFGBQoNV7gN+v9OnlQaOORiT2McNbsczmWqUoFJOE+ddFAxFwE0PVkJE1xbTPujxoVDL1ob8Q4oRAE17ZP9GpgCqfUAdlOLkMtupbVW4VE6NV3ShaDQiCclxtwh7pSu0D/hVUr7iodaNMPZ81xFAjqUCMC7QmCMugMme+JwqCzUliXzblI84ng== 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: 1lzfvi86/FlpeuPQlVzXYMHjVdl0oU30EyQHMJkKag9Co3s3KPz0X9levqmByVosz30cEOa1DBPKGhd5D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ACvg3xg19fDekeEeUDr6GRRypuh90YR4cMHKktdUcC6wF6DlUZuUVBA5aENnQFxlhxmXq7eBDuB1MiqUw73j1//hpwR1YKONgEtj7go9kTWmhCISGVPY0eBsCQ6+I2TWpm2dfroSLDsPttlPJH0FjlqG29NP5m3MC+g5OrE77ZqOuYmxEJEtZ1iVMp1P5R9fyUSu3sZeVCfIq0/TRyK522Bc8MCIMQPb4/hxlmRfGs3utp2tcFVAmwZAYyFqYG/wkSEpaldCeluvUJR5gyLokXWkFJ7jCeomJrz2vELrj6bCuu9fe3opU3DpAyNEvwHjCsa1uaegN+wzi+GXIbzGTiJOgD492ZH6s2+di12gFbMVj3J6A0O8xHMOy12avXjTimR8T200RdzHOqXbYjpLnqgKiVIHFtvzG7mhl4 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 729b9ecf-a275-4fe8-b3b7-08dc81a94767 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:42.7901 (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: EvW7Hb3uRG2KZIuo/OQPjtyXAuLUHe/cJAXEvpJbTV7XNj6hAyrymJG/LpsoIO3k+iTszBRi5s66u9yAnopvYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 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. 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 Fri May 31 19:38:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682048 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 188C817FAB7; Fri, 31 May 2024 19:38:54 +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=1717184336; cv=fail; b=ZSpXdiZTo4Xf/vW5pB8zCETP/hoIM9X9V4yhEuy+kQX1dy3/0arH+TV9kVmkl2E5ZcaWVXUkuYxcd6kCcQOyukEJJE33GZbSOyY97pqcSySULxZI8O1OjTd9bP+/sN1Ajvyzm9gKz6H7Ofr04/UvEBDM/FrfcJsWv0sW+3WT9MI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184336; c=relaxed/simple; bh=YCkpda0WNd/UD5RJUAuMeiLh0vddzkZNaNoxBNXrz5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=k59NkQ5rpMnFyCW+4iXw7JzAMjCxe2Lpd25d7SclE1MQ3Ed5aaYpwHZYocMx72B+QwLx6+ydNx4nbEOcuT4mzsOCsr4BjOpxEsjgkF5cUBj7UUXFccyDQBiVEGM952y7GEk1X8XYY3Alg0eYjkIFeM0lE+2kvjpjdu1UvGekhz0= 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=S4AEGwnz; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="S4AEGwnz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cla7VV0fwKHJiL4C6dJ0MjXtioM1qCXHiFW4pMFsOLJmi+Jfdlhi3XHP9tPwC+hIcOH3zDLmvkqlleAuz9ECd5Hte+r1ZJhlx8CyPo4HQYUnhAvJwIcBJaZs7cyTzC66iiQUKY+IFDpRphrSfAG//kEBpjCYGSdQp8KW6VaM14JLwwkED6/VGMNPNAhF2K9NLYpWXmxRcZ34umw38QJZCg8ljmcpkUI/fTsgfU2q6NEyndvMzJ6sqB4q7YeM/wDUtvFwK9F6Nhni97IUS4Nirt6LLD7RH+kLQACT81l74TA/ai2ie314oZWS2DMrgIwck4grdyckjsY8FC/1bhNaZA== 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=9eKIWT+CwljhaTJQqtFCfM9Y+IA41PKiy1KCN6DW9zE=; b=loOcZ2mDi82y+RI/uZ0oXh3uFfsp+pAqYKAst1BCZlWcSWLwmS0u+9UtSsan6WtaOOJ2A+NzTQ+OOYm6xQrO2cy6gHR4ggrfgR1M9T6TePCfP5hyIItvitHLL6SEdTuIUw8Y2j6ceyPKYYSdHMs3+NlGeA0XwqAyBEAqMu8WilOH+4i4qcPaAw95t88JXLid1S4A41E3pE33zUrqjZEqgHaCtkh7xtjZ1+UJ7E2Jaj4ttXJnTdOJY1MwiRhUoaXwzZwTRgqcqQbsPazO5LWHb6HmyoLU7Qr83tZ0tN6gesxugc8Gs5aMpu7rJYi8kPLFjg/Qjl1Qq1oM1ro+WYB+zg== 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=9eKIWT+CwljhaTJQqtFCfM9Y+IA41PKiy1KCN6DW9zE=; b=S4AEGwnzvAoqzVfRGqCjoQilRsuyVPt7CvymW4ZVPf1vkb/Llqm3pdgcM2cRIvFQIqa+8R7IUUQHgjCy/rnho2StvGWTKAandlhSLXPf+5JpJ/GClSCUJyo8tA9Inl+MCWDe7O284XzrZwx4V/0vc0wXsgB9UhsG4v/z5yE2BgczA+h6INt+NroHz80K1pBCsFDVJwEx1KRy951uQzKtDKJvO5BoefzqreSk61o+FyHK8s0/O1KSpsohPsxVmYK3Q6A/i1SmGAYP1pYUOmRbaieGi38WOAem6MrckqhUuyaGI+I/dQxD3XE0M4fZtcrXlrqOtq/+jXe15kSzW+r7FQ== 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:43 +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:43 +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 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation Date: Fri, 31 May 2024 12:38:36 -0700 Message-ID: <20240531193838.108454-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0063.namprd05.prod.outlook.com (2603:10b6:a03:332::8) 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_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: eec6e666-5417-41a4-b468-08dc81a947c1 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: FLsD/oQkrgzcFB7JQxiGO4e6HZlyVQQIya4AgbkygiRb2uUVjDaoANxhro8fCRMG5ySeZaDdic3rbt9vlVqhakyAfLKZ4ZBfqLzWgel3wGP+/NSwptKnm43094dHGt3Bsv334ofBPUVkpt1p29WJ4qB0o3CawedSSYL8cJC9RmcfklK99mfOT2M52rrkcrRJpvsYussY7NJIdrNNpi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X5xRI2Q== 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: Mc2rtMkJgW5TeWVAsItNHD2D81RUqU/L9N3k9l4Glh2AEoXWOsGe/eOzvMZihzjTq7opPdJfgkb6OKpkF6DZrGyMXgnrWSmjMtFDarVItna4bbDLc7ArhhkygmIOvNJRuH7/4g81ahj03AeYSzI5IN+G+YqDdRlStHVfQRuCZTRMssaBLppIgApUwF4oLRFmnwJOafvkA+EmNTCAG8JC2omFG1BBJdpzXQEqUYvwDZC6Wl49nGUyRAkqnOJ1I7waUDbot0dU2h8YU+K7LKCpmyEwDCsC3R2SgSI16Yu5xAMqSUDC9bgVoN3nyaiQ5afTSy4CMaV63Z7cq2wBTn9ZMZw3vzBdk0IL31txIOztVtXfkaNjFCLuryQpbj3m6+7u3MsiIPlUjtwaYMgo99fqoNRmhMhI4tOCqgBREfdDU+8W9B0M35MH4g3VIGV6sVH+feql9bi6NRBy6N23yrSfoxnNhOe5xDRe/MGsKjvlo0Dn23nZSMD2e9dixXg8dvL9Paa9Mx06bu1oF3Skmv9ZvD3p6uWRTFtd72EEpTiRhOHtFj9FHWzy7wn9TuJOqGjhnX8jPtqAPFFxxzc6PAoWCQ7GxJWoYhY5bwlkwAtEvHnqr9kWDDbF3jsgsvKmsMEIFl4FkUK3iI/IyMJnsZYHyXhrHgLiwb+ccKWsJFCIe6Mss0+1sje12094u+OTcJadcdsCuf5+AW/dz3ZqjEU4qTKzR5xBqfa2YsU1ywWXbJkVGmM/d35k8/MBXwTLlOXkLbBaNvRPtABpnP7xwL28f363BCpRn9GWPw6eiKgfBNUIY0TN7bKkZWZuJ7bjZFUrtu1q8h7zzvOB59ZgiD+WuDsy9PcHrUtyhCI7eikN0k2dOkYCO3wQtBsVgVAHyRy74rodMX1q5T3x6+kW4ioTZnC2JpB8OwEoMnTvFRGWeN9we86bLJAYmGGNAuDkbdXdffIlI64Je3goyawFNuanBgKvT3U2OPOJXM6kg26iMlHTXkNexAdOgFeNEHNk7iFXnhsnJjNsyb+ne6nC1Ygnnzkf7utrfpQdOLz+aiipw55uhOtTY1F2yCe+nXMhpI5vIqn16giySy5rou7De51GXfVwMHLzGXsWASOuglIK4Ld3EApK7/B1Ii2dmR3KSEFx/12xmN0O6yRkn9Z5G/pnSL3vqQDbblBBAzGTB9OToDLccxBdlcRSAemfp+6epdkXHGXLIFrKxpgGYFqWG+1/9n6elYX1GxocfBJQ4/dd5et04CRww0VrE1dDnt2BTJZNmt3BGOAsWKtK2QAhgIsyNSpsZU73gkOSTS7Gxndmhrtrv4V6ZtzKBJIG4h0BJjLPaRKGA8XH2yhl99NxPAwor7jmlVg0BdRQUbG4VgIskRqMEeJ2jU7WhN0MlcsZDhyPrmAAannhvnc1yxuzX4vbhFs8ZBo4m4vAgLSEiN8MNra/llo+4JRtr6jUDo/UV1J17P3/++9TuA4G/Uph52KlniTd1991LAXgX/eurLn6d0/N3FCRALm6gawN5iMkwFB50X61jf71SpqooNAJy7S+q/SKaxezWfnNaRIbfQ10dfmI0oX7AUnJ+oqMsRrBgRUF X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: eec6e666-5417-41a4-b468-08dc81a947c1 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:43.4227 (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: 5AteHk1wSi+uLUfoPFhsBH4TcKZG5teGnd6ho7hB/I0lgHNU2UNptjz/jd9ZH+A5izPaKhg6y97zueIMRHOQAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 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. 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 Fri May 31 19:38:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682049 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) (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 B243017CA09; Fri, 31 May 2024 19:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184336; cv=fail; b=a34RFKGnJAM0VsDawFqOojx9wpq2hFPMqdXQeSUOZmnVixi8BWQnzRhDJXTfi/dyXn8YApbRKcVWrFOhrcESwOIuJJul8DExf51aEUw7vhKUoOsMT8D7ViGa+wbN8/xatc2FOtRP1/JOnNuMZQ1m9qIt7dY3imkT5M8gE9Kc44Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184336; c=relaxed/simple; bh=lkHfXOkuMLyiPllYiOpX/2ad0kFdXhkI3Oj2E82h+kc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=QGE7uA6bMmSDnvoRH2GsCIcMP5MBW9pznfOUpwHJAs+wf7l7kPcT1OFanzuRlPF6P4H9Io4fPRlheuvh0oetrkfCRDnKw9l8xDXgZ6fjE3yGz8k4Kd9tbLs77vI2P/9RUx8BvL2S3JWVrOpBowbhhMkdPNQg7h/DmSN/6l9oW3Y= 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=YItq/87l; arc=fail smtp.client-ip=40.107.223.52 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="YItq/87l" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=budO4adXbMb3am40Q/q4exmtmHA30iE6At/M38f5QvunGiPkFy6zdfGMDi7YuoMcXel06iJM8kfbogoXd4QZz/8O6FlXpCyBf94hW0l3vdAkoailK6zssOwzoi/8a7yRGFlgcnJ5K1rNw9l9VY7gUXNcCJIyubKGRqCkTLEm8b2oZrWArWF3B+Bra1fUuS+lp3r0qL2ym/nRdqsD4PacNXlEIqc0QvxPmhot6oflplK3XuixbQaeM0gaknv4q6BmDJoXI0iPqDG3CNYP++EGCJKJ7Dw8uNr4waxRRFxGxc5URO3JmVHTLvvLoFfRahCrAtePf1n9Z6zexQPtk9oGLw== 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=lm9A87k1N76AjiGjL01RxZ+v8mTLpTcbZTy2c/TQ+PQ=; b=czISQ/kqWpLAUG8z7h5xF+/E7RG9VYrku1v+KA/g6D0blS64U/FZrj6eH4Eyj9z6kLosS6pYz9Y/7wBaG/3jdSq3litH1Sk2DOoe5rixcxAHF/S2k9iHnvoVo72VehU+jgwrdX7Cv1j4KIy7l+zHDN0mtR3ZfpgbYszn9jh264b0YK+pMU4t8yewD7kONf94CFA+n79SjPgysAVqb8rGEF1Uv6j/NmyhlJmJXUgDBq5CG9stNlOeZTCfuloWQted7d6mwHuv/9yidzV0c19fEj5OlflaSpyTZ0BOPkvjwaxXLHKaP+FMvKitJZbfa4zuZf7x1NKeSUdmex1IEzekKw== 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=lm9A87k1N76AjiGjL01RxZ+v8mTLpTcbZTy2c/TQ+PQ=; b=YItq/87ljbgtW2hMZ0niYKVKB5VnFuUqs53rDoxfEHbubWhyckmcjFwiEvkAfTEgf2xzDAdBN75MGN9GdWl6C1iair7LDt8B9KXdAfFZb3gxuck3xwDxQTiS6h+yjpW4sScjKrycJ6HJL6TfdwuD1VPKi0gp0F5gdVDvC6Cw+aIdn9MF8Kl7taqJUZwZfrBJ7v8jnJVPr2CpgVtFVDZaVYVa3nZas56yJ0jVguimyLQJb+N+jetE6ON3Dli9JJnEOvOZ/hNmXeIHvaSFQ62Kjf9FdOogyRAjEEdTnNpPZVgn03DRWsOdoyEg23tGYqggbhJs30iSMH7I1SUWFc+KOw== 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 SJ2PR12MB9008.namprd12.prod.outlook.com (2603:10b6:a03:543::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 31 May 2024 19:38:45 +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:45 +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 6/7] selftests/x86: remove (or use) unused variables and functions Date: Fri, 31 May 2024 12:38:37 -0700 Message-ID: <20240531193838.108454-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0007.namprd13.prod.outlook.com (2603:10b6:a03:2c0::12) 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_|SJ2PR12MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: b4dadd16-7edd-4ddb-4c71-08dc81a9483d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|366007|376005; X-Microsoft-Antispam-Message-Info: UATSKJQ/05VgCWvjYa9X0qLABLSxmvBJ/a15BRlYXgeYo7EiWDwsWXiCIQ0rnyBKnQqgDXrNWwRGHwqTw0NeiI7CdYywYIwNRHw3txwRFb2Ysg6Wh430P1iVVDv4qXfkVPJz1S2P3/BPKYsx5N81t7jn0SsLVkrev5tcZcRo9KxrlHUntxLzDLey/mEz3hPcSwuXBPWG+PDpnCtWLtsEO9w3f/c7FepfxKNANIb/iphMOWCbV15z9PGXxqF2OZwYJy74hTgFeOY/BUvx85pOS0bjVFG9Hp0WcNYdZD6M7EjDdQdKBZ+X95MRtoFiUzmDa1ut/uYCsaYr4yJpRbiiuGRHYO7zsNUi8mkguebxph+mubFtwN0V+XJsho773cWU5wXrInid2Kkk0nX2zqUdrbDgYnjpk8MytCTLNxfM44hiCZSNizS/Rze3vMbXWUHF5ecnwaQebJaznngTWHpc/Ji+CTeS6Kweb7Efqm1WzAAQitK+o3w9gpF6JCRf46tBViKwdhEA9D7JVpKIFxcU9gaotesaJxYL7YMvxpStMLjZt0TZFJCe1YMQXW05sb7qm5DfFwT2DnXnW45vbqWwqBAoKUxgQePCv+4riFyqZ/cA1cKJfPRnrS+oxwJPEnpAvUJDMOfMY2WZSFyocH4gY4+4PnfW6tMVVE5W3PVGGzHwZDY91QUGRfBPTTR5cd4ikHE/dqsZMfVYlVUtTE5QP3c5JZNPMF8Ws/cuXXO6iV0v0ui8HYSiJaBGYCpe39VuEAn5hNj8Kl9lh0RnE9//WBEi15lP9ww5rYSNu16IfgadnxUbLbyTapJtLH1HN9fU0QXUs9kLF93RsK7f0bIPv7gdWcczImrD0g3D86+i+Nvb1YMkJ40KpIqeeYUoTOSCyhIk6OTxp5C/2npY6MiPz+qsn48Ag3ml1NitP8/MVMJZ2suf/Cz7AuOQuEhKk0V8TwByS/97NJE/LvsMw1ni1uaYlyP8y5FWrJ7JWZj7UfpvD7PU+BQzYiDLHju+lvvXflruW7pzVI9besaO7/OuwGAwl4Q3QmmKPDSt+4PlKbv4zO0y9AiHpZ/1tr/i5SmgZAAMAWGgwNzxZKBvEADLVwkN2PIKj1gPqxOCJkkxQsVfp7OVtF6sjj6Woja4QoKxqc940tJFBIPEZvtRwxHOTfubYMqPloWEcsUC7TKKh1FGJixh8LA2W3SQUCewyDgAcJy2JT5bkhvjBUiGcxi27BPDaQ+iYj6w3G3Z4otSwu6UeZPjJHe562aL+UQIA6qHzG/H1gJNEvdbbbRUPkoU4Q== 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)(7416005)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sX+CmANIn6QrDXWwE5IJ5m8xwQ4Zyy0ss+GI/q9qwCKJZf8Ux+hdP6CqwjzM/kdyDQk8Kn5flE2FcFKaTFZkGA8wFDdNaJwja9tO9+c7myLxnd7QI8jSF0pWWGtyX2s7+1Z7pIkXAP+NJ4LYxhocWD5RoMY8itNNybGuQYGiMNQfOwMkl8WbFH8vv8eYL3Zr4nfEZbEItKKtAhf6SDC4cddAFj0UCR4UssE/JtlJJKSnFU9z+is7+GoB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jxTR2Fe/FbVk7S2KC30e5v9mQ6+rFIwkYDnS90QU1e7WJWSFTLcvKSJfwG4dlBLffgn53eX15BK1KBzjUTwJTXykEPv6YzylCZ+8CH4qzw1FP+zq2tIVxMhfQGDLOIlW3i81XDDnbUBS3Cu+i7Eg+/gl6z8zLM5GCgGs1gHvcCANdE3i0oBsnPiY2rzd3evQXlSPQBB/D+pXaIMVKvSU370hulP4kNOb2Kso00vm/l4KZpJtxYI75FBnUA6j5YvLX X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4dadd16-7edd-4ddb-4c71-08dc81a9483d 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:44.1955 (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: CNEGRjnTAv/B4JHp5CB50V8Q/JUmmORUfIgqK/uEFjDon1wGedPoa2mSDZMFrKYsDDCCVqJT+DStueY5s6/nAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9008 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. 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 Fri May 31 19:38:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13682047 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) (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 10A9117DE17; Fri, 31 May 2024 19:38:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184334; cv=fail; b=RNWx7GwGjJwLdB0msFqSnKPdgBqSD1hSfmtx7fcZGXquIeYegki30UllwMnSaxt5lPSgNEJhTOZ/R4MuSC227PRLmK/a8ATw6A6ZwW+1kWNW5+aNPMem+KX2+f8RaCM9aQ3aCKbdk3GPVqPRNiGIueB76wNtVJcyPAKc6wrgO/Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184334; c=relaxed/simple; bh=LcWrjcndeq3iuhARrc/mp+c08zzUu1zFoYgBoT4w7lM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=NB5YuMSD4M1s2S8h6Ah9E7TgTk4j46fCVoXdBm5b0H3IMSx16J6c+3x6KOjJxuyc2ZCHd11a7zVOpU/4urzfUlqLL1rTaO3XvROC/szVKoQU7deC1XCmm8CoJqzwOrCuzg1xV3pJw05WdXxV6tBNJS+8dbuwAemd5xhYCw9lHM4= 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=Z54wfO3J; arc=fail smtp.client-ip=40.107.223.52 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="Z54wfO3J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YuoYVURVWGhgeZdEncNBfj1gpHM2WXh1tDueuJ8eJ3uvjq+6DCLp2KMO8vUvNsooO0Sirne/yYbbCWM1OUNftRLh9LHEhGBpO7T7b2kCOgFbrn2Mo1HuuDMhZ5Y/VQF5X5M3poAQSt4mYUefR3UmvVyfwo+La9Wvus8Wc44Tq+lfMjn0mhpeRChkMc7HJ0MvMaZCS3RJ8IqFoR29Zdr5buYQFZV0nBc1HLFoVBDaxBoYdl5y6Xxd6RnGS0jHdPTjyAncWnxO/dlgPVwc7OtdoV5HDVYwMhMiRg1Bh7T7u0X3ufDWBs9wzhNSx/uKZ5nfS4NWPES63LqUy0ClsxKpwQ== 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=M9NVry3VUsyNcWz2ZdDnrII1PJ3GUu9peaR80x/6epU=; b=BWal/cv453Fs0BZUN++AQYRfDNRP4klPOGrIvzKs9S5GczYJCH8/a1XXfcxM4weVhWZeIdEHh3qqrn5YSQXr8zAljsO03vgUsLSQe9MZhrXdq/sWpQY2oim8oJb59X93601rvTXsI+cgpsk9XFFtOiqdjNcRL6/T5KNX1QKflCWJuw5PIXmQYM+JTMno5L8tPxUehLS5+vf4PNrOvZnK25uIb1rjA+SGs+XIGLJSmH5kUZMM50PoqmoLRpc5PxFKfpz+h1DJP4C0kQQ8T8GWJW0Jt64JgyZuZrps9jLDeAt3n6xmqpEXH2dq3kdgAghZBXMRue4o79QuiOMe10Awdw== 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=M9NVry3VUsyNcWz2ZdDnrII1PJ3GUu9peaR80x/6epU=; b=Z54wfO3JyZnFJ3IIhlFyvNsoxbWTSpLzx32beLbavEpKoEMeVxPxWbJO4wok+uAvgfWmq7T4fQRCR0ggApDWAWxzxaWPH54p5FfRSCU7dXAbeiW8x0gcVJ9fiTDtlZPS50FvNt9OZNIkfXK/a+hmN0PKGrN1IfcpwccD0skw5ewCh3AgjLsW31E6S8TqXZFMBloR3TeLMlrfFVZKDCvBJQPaB3Hd28f2jXH3b9/tiyBjq+SuI0X6/lhoHH5KrX0VmWJg31R/QFS1t5Qwf+D67TOhViVbL8XiBKx1gNBjCpI/ctnxEUs7oyj8aIIU/9Qt8ejYA3F5LpguKKFL8pgGmw== 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 SJ2PR12MB9008.namprd12.prod.outlook.com (2603:10b6:a03:543::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 31 May 2024 19:38:45 +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:45 +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 7/7] selftests/x86: fix printk warnings reported by clang Date: Fri, 31 May 2024 12:38:38 -0700 Message-ID: <20240531193838.108454-8-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531193838.108454-1-jhubbard@nvidia.com> References: <20240531193838.108454-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0097.namprd05.prod.outlook.com (2603:10b6:a03:334::12) 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_|SJ2PR12MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: e43449c7-8d04-48b5-4d69-08dc81a948e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|366007|376005; X-Microsoft-Antispam-Message-Info: sXrdEkxm0kEbsA2jqP4hGdkYIa7Ljtr11xz5PIZyn5EoROBI+NwPF6gcnAjH8213L+PZQg4PrlBVrjGUVjjsbLg7oSYY92lvKKA6UO1+9ogHxAxSZox4BI66NTps3GLbPliS9vs6i4/CIvgpT0l/t8NRvCDwrMivgdkEnhGu0ICXeSfIgIX5JjsOAJ/00iU/cUaorue9k9lxYYq7ruGMMUbERULsPfoy9wuORq+DTUkQGl56HFmeiKKOVfEw9BRfAsuPKyz/+YA88cvdD73P0WlQSd1vF5aPDMFLMDgc64dBSNgPPBNGvMN4Bb31l8pdZ3mElVBjo5QUFKSdu4DjpFQ7iZg//BjjXW60snxfmlM3oi0BtJFwdjKhwIZL6xiShXzFCNYg3hugPjD+BsvjQEO+BNRPJo2lNeT/At4WjnAqUwKjySRO56ytg66/Hk9LyXb4wmDCVHHTi9eqG03IeusO8W/rpVhS8Ma0Rmuq4yaxiuuVrL5n+uaUX2WEIeMrLf51EcgpJCItf9PFfr0ZZ0WSnvjb5VgfOP3wb2L26NjeFn+fsRzvxy+j4eJ3EtP9eXGBfyTomMVqgpdx6lkLGfkxLKEMbPpaSdYC2N26meMTDaM++MVLIFKfoHYaKtBEsRwvdcFdkxl8X8hEputzrjo6tXtv9VkdxZ6Or1qnN0Np+yQdJ6i4w3A3Wgj/Qu5xrkIsnEOnWGicMLEIpiZrqbTWceBAZ3T2QL0Fj2izZxFj+21YBnPA94ApEQ4U7BrAtUoTrQbN7+EiKMMKk4iBjKcOQie8kNp3WAs0RbnLhErWLXxTvrXbgepBUDigD/W3d3WKlt5IRiLKs89Hnte2aG4hrUI8b9F6sfCP2uW8/Wb6BFg9LJY68HfLz0cNjmrSv3IMdaj7Pr+6o6Jsv72YiAYZv0558yXdrSupkWOoDYHpuHBsgMZ2Ebzz+63COcDp6Xay2j0CIH6iaTIEvP7uGkTWgpvJ/FCnlcqCt+7HkwBaErnvYmqFmceWBBnRxsTfn0JCUnpoDrNTtDIGdfPIAIXThOM8lFEidMcInJPZ0pUQEk5sUaLIbm65jK7wc5J/sFcWPMeMhFc9oY7EWfKS4OKMkThB+SZp7x1rkpNPIJTRWGlMUoyUq/Spd0dTpNSSPQaOZKvozS1Ndyv4+CI8kHlFyzn5ri7QZ0OMfO+r3UHw0icRSSa0KlRmuTTZxnzG8Vfe5mXJzwHjfbOTFJPxr15tBsGr3i4+mGaJhBiU9i4Alnp7YXgO8qatrjdIm/Pn9uRuoVyrjWRGbQBNphyJSw== 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)(7416005)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QekZLF1DdLUf1PpNcrRJlgeB2uZ6Yq2hTMD3nGZxwHLoKpm9YC1fyOAzwt07FuvgDNbl2+U1ucDnhfbBTZ9oUh0aNkdfByFO8OM2fVlC3Hoa9keHZSsMRRpVCWHPbmyQzLmuKCB1xk+Kh7Dnr4oVgyDCbOc8haqHKoqaojhWG5FATgR8GrY1zBB+R8q5CPNFMBe3Y5l973SiWP9GiSGnwmxNsvHpx7k4TYFfWXjpc6st8a1RwcoPafakKX25qLki7vC9OD2v8cDMn+gZUOAyHz+6YOqpSuFXEQm6Of/dyOC6mR6I4EMwFLOfQKixA3GgSJA+Xnij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riDXyiX3ewhmsfuEcWGz7i86rrc10zoQuUt0rjvTHuxOQqFtt8AntY38lECtASizwsNwjz4aFg72LWFtMkXjb3PQGgng++BtP0Z0eIePc3bpYyXZUUjh/u+fpIw/Q32kd+SGlg8neF+lYO+ongdxwY3XQmdCzkt+GbGGTyfC1Djfh1rbpBXpZdIBLNetzoj6dqvR73lE6bdb X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e43449c7-8d04-48b5-4d69-08dc81a948e2 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:45.2618 (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: 5E6rJkENFqPkz4LVJD/Wtz1vXbZJQ9vYm4vEpY0tpYWjgmq7yuG0dRnOq/K108aKdI70GylbLVMMSWMU7AvsdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9008 These warnings are all of the form, "the format specified a short (signed or unsigned) int, but the value is a full length int". 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 {