From patchwork Mon Mar 6 17:39:23 2023 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: 65021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1992057wrd; Mon, 6 Mar 2023 10:07:02 -0800 (PST) X-Google-Smtp-Source: AK7set+hMdLq8A8x48ASfqMpJtxXnaG/FoNhimP38h/T/hU9WbHfXpWDoc6b9CsOVC4v9+XRKkqD X-Received: by 2002:a17:907:20aa:b0:878:814d:bc99 with SMTP id pw10-20020a17090720aa00b00878814dbc99mr11524288ejb.66.1678126021842; Mon, 06 Mar 2023 10:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678126021; cv=none; d=google.com; s=arc-20160816; b=FN/Hz2DzPGTmowOFaCjRukMALHbC7GK6yWEauXTrKgqgYvSkpAjWUwpcBg9OAhrBbN 9dnKNmoZYVnXjBSxB60nSPwGNgS39g4ZusxWDevGD7/iYCTucWla4f5CuR2FvxK0Uam4 WmDUiMrC72QnSGyL8gFD/4/xbiP9sCLotHT5D8O2ezz26KJItunten0Ekc9RQSSuS1Cv keGsBIhXSCYR4BgbEtREQpl7PNSPRSlaadqsPaFuI7BFUyf94mzdg9v40+k0Qt0+3mwf hJcDdu5q/m+yW5CCM9BO7L/kBmgS/7eFZA4KERCUd1Pm+BmMnvp264XgWncKTF5QOODi tXvg== 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=rnxWdqwCNa7TZcBDG14YyXw3iGVgr/QFMtqibkNQjmg=; b=E3FJvOmwWX3pAP/jtIEO06JzVc6ZYPWDz0p5Ild4ZDp9+qEGeraOwdgisp8i7ozZ9E X+RewZGvXUtycDOrGhMtqHeP4V9D/fK49fp/AI/h/5XuO2DHTuhM7D94gM24Z7aYIUrK 1I4AqmKSonSuLdy8eEPeTAwQEC05t9Kr/4CZDVeXuVZZnMQOXQT6Or/VxcWwRympu7DJ JRjRw4bIc9U8MmLCFZVzRpkq9jKXYhrji66F4IiRcLDjIGzrIL1Y2bI11SS6EOG7re9K JqYPihtzDNbp3PDOcLb1Sx0sFgGJoH4VRHi4xJx0owBV/clmAWtZH2Yu5FdxbPyTe0AT guqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvVove+O; 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 v7-20020a170906b00700b008be6648db89si9806934ejy.502.2023.03.06.10.06.38; Mon, 06 Mar 2023 10:07:01 -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=gvVove+O; 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 S229571AbjCFRlB (ORCPT + 99 others); Mon, 6 Mar 2023 12:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjCFRk6 (ORCPT ); Mon, 6 Mar 2023 12:40:58 -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 9930E64A9B for ; Mon, 6 Mar 2023 09:40:25 -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 566F66102A for ; Mon, 6 Mar 2023 17:39:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E27C433D2; Mon, 6 Mar 2023 17:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678124365; bh=Cs+9LC2U1EEYPynhuDqpnwySD6SzHFMH8hSCEGSFCdQ=; h=Date:From:To:Cc:Subject:From; b=gvVove+ORNNdnVGgpi5kAO5gGX/zZEj5tNCsRDRGdWwuKYpsYp0eA2tQbEyRlWWgY 3mIbHZ+UcLvSCz1NZ6T0wAhAid4eRPgCvdCiFkMVuxK9Wy6LYAJjMz0IEXykF5wG+O vK1pJ9GQHo5abdkMpmp82s/hlQTHpSQSjGfb79PPVsTYa9wWPjZTahYWQTcYSBfjnQ MGvkwSQavcfUR4rGilXTi9XfTit96/Bu/2L02rz/1eHJUikOU6MRkxbcnWWOraMF5K bcWm7SOqRKEV7gVxaOtZhR8/6nwP8OCmuYj66EBjejEtrP36BRHKQvcX+TAPoIX7EU wbXrv2i5KCS3Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 100CF4049F; Mon, 6 Mar 2023 14:39:23 -0300 (-03) Date: Mon, 6 Mar 2023 14:39:23 -0300 From: Arnaldo Carvalho de Melo To: linux-kernel@vger.kernel.org Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim , Borislav Petkov , Kim Phillips Subject: [PATCH 1/1 fyi] tools headers x86 cpufeatures: Sync with the kernel sources Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1759642671592300961?= X-GMAIL-MSGID: =?utf-8?q?1759642671592300961?= 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: 8415a74852d7c247 ("x86/cpu, kvm: Add support for CPUID_80000021_EAX") 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 these perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h' diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/required-features.h' differs from latest version at 'arch/x86/include/asm/required-features.h' diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Borislav Petkov (AMD) Cc: Kim Phillips Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/arch/x86/include/asm/cpufeatures.h | 2 +- tools/arch/x86/include/asm/disabled-features.h | 3 ++- tools/arch/x86/include/asm/required-features.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index 61012476d66e0e13..d53e13048d2ec844 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -13,7 +13,7 @@ /* * Defines x86 CPU feature bits */ -#define NCAPINTS 20 /* N 32-bit words worth of info */ +#define NCAPINTS 21 /* N 32-bit words worth of info */ #define NBUGINTS 1 /* N 32-bit bug flags */ /* diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h index c44b56f7ffba0d0e..5dfa4fb76f4b2ba0 100644 --- a/tools/arch/x86/include/asm/disabled-features.h +++ b/tools/arch/x86/include/asm/disabled-features.h @@ -124,6 +124,7 @@ #define DISABLED_MASK17 0 #define DISABLED_MASK18 0 #define DISABLED_MASK19 0 -#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20) +#define DISABLED_MASK20 0 +#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) #endif /* _ASM_X86_DISABLED_FEATURES_H */ diff --git a/tools/arch/x86/include/asm/required-features.h b/tools/arch/x86/include/asm/required-features.h index aff774775c678434..7ba1726b71c7b8bf 100644 --- a/tools/arch/x86/include/asm/required-features.h +++ b/tools/arch/x86/include/asm/required-features.h @@ -98,6 +98,7 @@ #define REQUIRED_MASK17 0 #define REQUIRED_MASK18 0 #define REQUIRED_MASK19 0 -#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20) +#define REQUIRED_MASK20 0 +#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) #endif /* _ASM_X86_REQUIRED_FEATURES_H */