From patchwork Mon Dec 19 15:32:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 34615 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2460958wrn; Mon, 19 Dec 2022 07:42:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtpnBytObS4xor/nmdkvnD7dEXooVRxhz6sOLSXGsURdGYs/wiZkrjgoB112pSDomdJP9rU X-Received: by 2002:a05:6a00:2488:b0:577:adb7:20dc with SMTP id c8-20020a056a00248800b00577adb720dcmr12842764pfv.5.1671464558519; Mon, 19 Dec 2022 07:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671464558; cv=none; d=google.com; s=arc-20160816; b=OMOngItrSwgeGkxwsjo+nEhhAgxlIHcpL7sxtp5nzt5i3fWrVQAaVWV+t5jprEpRiW PTYGUTm62Xzpekn5/3kuD4u33ppwELmYY9qTtRGgqbkDlMMwhzqbIodRP6wL1XBCTPLs 1FJPCuW1AHOGNTUz9iFKu1c75dcNi2gsx5fnOHTzzDkwXmSPfmumdYBBA0iKG1SYPmh8 z/TsSmL8K3xY6QO7M8rTkzsXbGcA+oGLMfWT2WWheT3bWQ42F7TJfnd3z/U0p8OjybbF iG551+v7zUuvS/ywHEWQR1uwIBQdeD0iM8K6YlMiki7JErFzVZE2uZmo0776z58DOtGw ZsXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=u2xz3JpzRHXbmYnYEnQUNQma74wYq4Ec2nZa/X0o9JU=; b=n9aWbsW/DjYfQ+SrfnNy76zllvkpe/j1khVn/uzLpL/Sla4tV1OdjoclAZ2YlEqCJ7 wXR/6mOZ1sxpw67b57bBvQ2rqwLE+NJui7nWJrCWYxcjNqCPjSiIXlNHvAWChItp2RRa bYCBWLvpoFJiTmCo8wamLuookDej1CZrPi/mPH6pJS5vscFWjaUNuej3Yo08It6Gs2hz NQsgUjCSRj/Jw83uYumxdxo25m3hd2KAB2+2W0V7eaXsb5260dGKfc6m2gTYimWma8DU KKHJB/54zcT+DAzB5XJK9iiUEXMhaHFyD0uliTkDXtb/UFMvgX/pobroUgV+26RQeV29 6IKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cdGGHyNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020aa7800c000000b00576fca27d92si9900673pfi.206.2022.12.19.07.42.25; Mon, 19 Dec 2022 07:42:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cdGGHyNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231860AbiLSPcX (ORCPT + 99 others); Mon, 19 Dec 2022 10:32:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbiLSPcS (ORCPT ); Mon, 19 Dec 2022 10:32:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04907636D for ; Mon, 19 Dec 2022 07:32:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9552961010 for ; Mon, 19 Dec 2022 15:32:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEAA1C433D2; Mon, 19 Dec 2022 15:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671463936; bh=Z9yC3cbOuNgUzFVTmcOIPxxP3Tj5cBtUiG+jINwBNww=; h=Date:From:To:Cc:Subject:From; b=cdGGHyNKLvKTRq1w9BeEbVaF1I9kffOASmhvJ4juF6J6OOLrxdf5xkH0wlGhVR1m9 lUsJBD/9teKZDiy0eZwn6pP9THX3mX/JoOOIchPQKOc0MdG3wFTXN+zJfhmm3Zf+E3 eJgbk96jPiRiSzeWLSwfHLSsaKMVo1PcRmDEUxnBlFxFT1UMN6TnpsN3mQ0HY7sE/z oSIYlXHBPf3LTsaWHnqK7hkFuvnx7jzl+DrhLSqdHkz1156HR9ktXYzl2WgiOw4vrp 10zLp9ST+MxhxxOodZ4O2VSQSYLQxHnSiQ82HsEbRpRAOvGjHJy86V3KlGh7PpkpZr KonvxBcDi1Fzg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 52D5D40367; Mon, 19 Dec 2022 12:32:12 -0300 (-03) Date: Mon, 19 Dec 2022 12:32:12 -0300 From: Arnaldo Carvalho de Melo To: linux-kernel@vger.kernel.org Cc: Adrian Hunter , Borislav Petkov , "Chang S. Bae" , Dave Hansen , Ian Rogers , Ingo Molnar , Jiaxi Chen , Jiri Olsa , Kai Huang , Namhyung Kim , Pawan Gupta , Peter Zijlstra , Thomas Gleixner Subject: [PATCH 1/1 fyi] tools headers cpufeatures: Sync with the kernel sources Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752653512945868801?= X-GMAIL-MSGID: =?utf-8?q?1752657620673303994?= tldr; Just FYI, I'm carrying this on the perf tools tree. - Arnaldo Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. --- To pick the changes from: 5e85c4ebf206e50c ("x86: KVM: Advertise AVX-IFMA CPUID to user space") af2872f622547656 ("x86: KVM: Advertise AMX-FP16 CPUID to user space") 6a19d7aa5821522e ("x86: KVM: Advertise CMPccXADD CPUID to user space") aaa65d17eec372c6 ("x86/tsx: Add a feature bit for TSX control MSR support") b1599915f09157e9 ("x86/cpufeatures: Move X86_FEATURE_CALL_DEPTH from bit 18 to bit 19 of word 11, to leave space for WIP X86_FEATURE_SGX_EDECCSSA bit") 16a7fe3728a8b832 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest") 80e4c1cd42fff110 ("x86/retbleed: Add X86_FEATURE_CALL_DEPTH") 7df548840c496b01 ("x86/bugs: Add "unknown" reporting for MMIO Stale Data") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Adrian Hunter Cc: Borislav Petkov Cc: Chang S. Bae Cc: Dave Hansen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiaxi Chen Cc: Jiri Olsa Cc: Kai Huang Cc: Namhyung Kim Cc: Pawan Gupta Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/arch/x86/include/asm/cpufeatures.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index b71f4f2ecdd571a4..61012476d66e0e13 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -304,10 +304,16 @@ #define X86_FEATURE_UNRET (11*32+15) /* "" AMD BTB untrain return */ #define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */ #define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM exit when EIBRS is enabled */ +#define X86_FEATURE_SGX_EDECCSSA (11*32+18) /* "" SGX EDECCSSA user leaf function */ +#define X86_FEATURE_CALL_DEPTH (11*32+19) /* "" Call depth tracking for RSB stuffing */ +#define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */ +#define X86_FEATURE_CMPCCXADD (12*32+ 7) /* "" CMPccXADD instructions */ +#define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */ +#define X86_FEATURE_AVX_IFMA (12*32+23) /* "" Support for VPMADD52[H,L]UQ */ /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */ #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */