From nobody Mon Nov 25 04:47:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1715380833; cv=none; d=zohomail.com; s=zohoarc; b=O5y5QiPGyN+DIT4WNu3HA4X7Z9C0cdeN/Ybz1CKV+/pJdSqoBTqZz6mFHi7T0iBbzU9wu5QHOgmAMTVFlBx48q87gJ2ewLrC/neAeykiDUXmGJ1ZqAzS13JTWmc9bM5InMBxLH3Mcz+zPyfJXBHaP/aGjZLraAFudgQWDizkgDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715380833; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+3wFptMesC7scMbASW9uUHmAUxFS1IgS9Pg8ty+kfrw=; b=XjHrnoNTVKWXZQvb2/Vwis7+ZaOMTnfKl73qPJtlWR9yE3WlgEmeOuBQqHrX3IjEiZ7vnOB9wkArf2l614H9Y2yus5Ue58RiIqYNGk2u719ORIX5IwBiIl2clKhCpX46sSbxNnSGrXQZqX1ahY41rXAFhncommHNkdQzANlfpJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715380833901851.1715713290915; Fri, 10 May 2024 15:40:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.720094.1123091 (Exim 4.92) (envelope-from ) id 1s5YuO-0008A2-22; Fri, 10 May 2024 22:40:08 +0000 Received: by outflank-mailman (output) from mailman id 720094.1123091; Fri, 10 May 2024 22:40:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuN-00089K-UU; Fri, 10 May 2024 22:40:07 +0000 Received: by outflank-mailman (input) for mailman id 720094; Fri, 10 May 2024 22:40:07 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuN-000872-BN for xen-devel@lists.xenproject.org; Fri, 10 May 2024 22:40:07 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3f3a152e-0f1e-11ef-909d-e314d9c70b13; Sat, 11 May 2024 00:40:05 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a59a8f0d941so604152466b.2 for ; Fri, 10 May 2024 15:40:05 -0700 (PDT) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781cf60sm233915866b.14.2024.05.10.15.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 15:40:04 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3f3a152e-0f1e-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1715380805; x=1715985605; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+3wFptMesC7scMbASW9uUHmAUxFS1IgS9Pg8ty+kfrw=; b=EpTAo49FsvSsODgxrPqrr9TrNKTloxjagvc3oiBngOaPPcakoQaQ9eM15/aGp3XLvI lURNMpM/bg0eElR/1juMUb8M+nvwc7+ecRglNqaWy6pwaaL2cSvY0z3IYTOTameYCRk1 Kst9OBeIcYid6LPIi9Kez30+hupCgQBxPqx0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715380805; x=1715985605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+3wFptMesC7scMbASW9uUHmAUxFS1IgS9Pg8ty+kfrw=; b=od3iLsbvYRnPepxP5HMVC1wTer8cJND7pHsL/3/n25FWl5i0mRpmZou2oa9kdJQRTa ZXztr9XU1w1N8zQ8GBtQFIaE+gWbVufy2LoZryg27sHxFHs3t/VqVnkxOxKrkw1LuIsw LQEk3gQFlpx7FAX64tsnmEcL5oyoCu1NYQKGSbqJolJoZXgWzxVJG8UyYu0WAfV+L/mz lFuSr1jlMVRwPnn2YttkavI8OoeNYZKYN3FgOWQPoJLhSoMWUfYyBFfF0rk8m2M02Jli H2UFvchyyDakBWNnjrnWk0INCVYEoVtyCa6binhfhF5COKMOuDvUuZmQLujD0nugR8fx h5Zw== X-Gm-Message-State: AOJu0Yw6cLT3lcJapXexiLc8qfEzGY42oX86xx2O0PgZVlPfrU42E8T+ vtcVYP8O194xiaGMeyvMVbQPLCi93i1SieAOgdFzpIytw0n7M0tr08PZEuTsNDuWLtXhZlJaPRa u X-Google-Smtp-Source: AGHT+IH0oLMFKMzpEMCVInvb1E6s+F94kooOglSc0Ol6TYVo3iWnR3bdBI+xVyJPk4/L2nL4aRjWeA== X-Received: by 2002:a17:906:22cc:b0:a59:c319:f1e3 with SMTP id a640c23a62f3a-a5a2d53ae7emr246124866b.12.1715380805100; Fri, 10 May 2024 15:40:05 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 1/4] x86/gen-cpuid: Minor cleanup Date: Fri, 10 May 2024 23:39:59 +0100 Message-Id: <20240510224002.2324578-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240510224002.2324578-1-andrew.cooper3@citrix.com> References: <20240510224002.2324578-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1715380834700100001 Rename INIT_FEATURE_NAMES to INIT_FEATURE_NAME_TO_VAL as we're about to gai= n a inverse mapping of the same thing. Use dict.items() unconditionally. iteritems() is a marginal perf optimsiat= ion for Python2 only, and simply not worth the effort on a script this small. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 v3: * New --- tools/libs/light/libxl_cpuid.c | 2 +- xen/arch/x86/cpu-policy.c | 2 +- xen/tools/gen-cpuid.py | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index ce4f3c7095ba..063fe86eb72f 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -296,7 +296,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *p= olicy, const char* str) =20 {NULL, 0, NA, CPUID_REG_INV, 0, 0} }; - static const struct feature_name features[] =3D INIT_FEATURE_NAMES; + static const struct feature_name features[] =3D INIT_FEATURE_NAME_TO_V= AL; /* * NB: if we switch to using a cpu_policy derived object instead of a * libxl_cpuid_policy_list we could get rid of the featureset -> cpuid= leaf diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c index 99871b8e0e05..b96f4ee55cc4 100644 --- a/xen/arch/x86/cpu-policy.c +++ b/xen/arch/x86/cpu-policy.c @@ -43,7 +43,7 @@ static const uint32_t deep_features[] =3D INIT_DEEP_FEATU= RES; static const struct feature_name { const char *name; unsigned int bit; -} feature_names[] __initconstrel =3D INIT_FEATURE_NAMES; +} feature_names[] __initconstrel =3D INIT_FEATURE_NAME_TO_VAL; =20 /* * Parse a list of cpuid feature names -> bool, calling the callback for a= ny diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py index 380b9d973a67..79d7f5c8e1c9 100755 --- a/xen/tools/gen-cpuid.py +++ b/xen/tools/gen-cpuid.py @@ -459,15 +459,10 @@ def write_results(state): state.output.write( """} =20 -#define INIT_FEATURE_NAMES { \\ +#define INIT_FEATURE_NAME_TO_VAL { \\ """) =20 - try: - _tmp =3D state.values.iteritems() - except AttributeError: - _tmp =3D state.values.items() - - for name, bit in sorted(_tmp): + for name, bit in sorted(state.values.items()): state.output.write( ' { "%s", %sU },\\\n' % (name, bit) ) --=20 2.30.2 From nobody Mon Nov 25 04:47:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1715380828; cv=none; d=zohomail.com; s=zohoarc; b=YN/TBE3hSRPIkx6pRf/WkIv9lYMh27p55pY+ripJ0yl2wVyjsc5S/X80lJ9rUB0FUPye2qtiVSjTtQbwf5rbA7+rPYgBOFNKzspD4O3JjdycJivmDTxyrTR+3Ow4Q+U9JYFfAd1OH7kepn+2Vitas/5qufS6SZShxw4Q+44MLw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715380828; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r/L62oz/vhjY7sgRvmqLoVnO9fQ3LM/iOAHiRUewZCg=; b=ReTLjdSXVvhm4UUqqN5YLhHoc8BvbwrePAguPBto2RzrraBT1f+l3fJ+Smf+KFzxclRnBc95jBpq7DVFd9pDjj1Dw0Sazd94m6e51Y7T1rjq4g4C8cvRugrX1AuYxCY05FJOug36DIIuMnoDBMLgL1pgoVUadbwBqukHF9r0o3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715380828168431.49221056281647; Fri, 10 May 2024 15:40:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.720095.1123106 (Exim 4.92) (envelope-from ) id 1s5YuP-00008Q-6Y; Fri, 10 May 2024 22:40:09 +0000 Received: by outflank-mailman (output) from mailman id 720095.1123106; Fri, 10 May 2024 22:40:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuP-00008J-40; Fri, 10 May 2024 22:40:09 +0000 Received: by outflank-mailman (input) for mailman id 720095; Fri, 10 May 2024 22:40:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuO-000872-BY for xen-devel@lists.xenproject.org; Fri, 10 May 2024 22:40:08 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3fad9b8d-0f1e-11ef-909d-e314d9c70b13; Sat, 11 May 2024 00:40:06 +0200 (CEST) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-572baf393ddso5879082a12.1 for ; Fri, 10 May 2024 15:40:06 -0700 (PDT) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781cf60sm233915866b.14.2024.05.10.15.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 15:40:05 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3fad9b8d-0f1e-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1715380806; x=1715985606; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r/L62oz/vhjY7sgRvmqLoVnO9fQ3LM/iOAHiRUewZCg=; b=ERuTKkERbxwCLDKkYxFCkSm8wi6CGoMth3NP6SDedM3m8QOLyDGg8Osm8+a2YWwIon 67FJ/F/kpVlvA2lhJSmpeKPecfsvhFfuu9soISFCUVzWmgTlbRpEG0c0f1Bct94ivBbD FbgNyB8WloExS0PvzPN4M/fyQvzpmhG0XK0aM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715380806; x=1715985606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r/L62oz/vhjY7sgRvmqLoVnO9fQ3LM/iOAHiRUewZCg=; b=AIBgRj+GqloqEhR6LdbrjucPTJD15/d7wfMVY6633BmqgaqLsJOEy+89ZTjKsT5Afg fuihdT/w01D74r/A+xEBK0FB8f7S4jrfwE2FbqeTnV1OSdkn4uHHJqcdPSUYfIRxxDBy bWsBDwwQLEVZs5bT7DrAdZLJbdmTn5+Iw4ULD4xFSyECNI5AnbU9R8itxZ43GSGYqBYw rpfZ3B/QjKuCYR0IoakaV2dfDhNsC2YDda0/c/eg1ZcCAkHivnZzGcmfZUC+SlH9/tYO 6yZcTWicSVvndLOZFLaiO6ZgyC1VuqK+AB4Kgvw2pS30hONKFGt612xUuHvS8v/w4tDA 07Ag== X-Gm-Message-State: AOJu0YwxQx3gNODqR3fRjituKynuoJEOBRMdsz0Pc1eG3as4aWXJ8HK+ I1agSNJC6iDxEHfejf0XlW8HARxiQQFekIoWdRgCcjhBHoUMpYIXqplBi6mG42kT3J8pQKtC5iM q X-Google-Smtp-Source: AGHT+IG8gv5M6eQdPRaW5RagjFQLPIwyOi6pGwQ/53qXmVlAW9nj+CYDAo9G7aWsdcVk84ybzUMJUQ== X-Received: by 2002:a17:906:2bc4:b0:a59:ac10:9be5 with SMTP id a640c23a62f3a-a5a2d292b1dmr351577666b.27.1715380805809; Fri, 10 May 2024 15:40:05 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Andrew Cooper , Jan Beulich Subject: [PATCH 2/4] tools/xen-cpuid: Rename decodes[] to leaf_info[] Date: Fri, 10 May 2024 23:40:00 +0100 Message-Id: <20240510224002.2324578-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240510224002.2324578-1-andrew.cooper3@citrix.com> References: <20240510224002.2324578-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1715380828687100001 From: Roger Pau Monn=C3=A9 Split out of subsequent patch to aid legibility. Signed-off-by: Roger Pau Monn=C3=A9 Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 v3: * New (split out) --- tools/misc/xen-cpuid.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 8893547bebce..6ee835b22949 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -268,8 +268,7 @@ static const struct { const char *name; const char *abbr; const char *const *strs; -} decodes[] =3D -{ +} leaf_info[] =3D { { "CPUID 0x00000001.edx", "1d", str_1d }, { "CPUID 0x00000001.ecx", "1c", str_1c }, { "CPUID 0x80000001.edx", "e1d", str_e1d }, @@ -336,11 +335,11 @@ static void decode_featureset(const uint32_t *feature= s, if ( !detail ) return; =20 - for ( i =3D 0; i < length && i < ARRAY_SIZE(decodes); ++i ) + for ( i =3D 0; i < length && i < ARRAY_SIZE(leaf_info); ++i ) { - printf(" [%02u] %-"COL_ALIGN"s", i, decodes[i].name ?: "= "); - if ( decodes[i].name ) - dump_leaf(features[i], decodes[i].strs); + printf(" [%02u] %-"COL_ALIGN"s", i, leaf_info[i].name ?: ""); + if ( leaf_info[i].name ) + dump_leaf(features[i], leaf_info[i].strs); printf("\n"); } } @@ -355,8 +354,8 @@ static void dump_info(xc_interface *xch, bool detail) if ( !detail ) { printf(" %"COL_ALIGN"s ", "KEY"); - for ( i =3D 0; i < ARRAY_SIZE(decodes); ++i ) - printf("%-8s ", decodes[i].abbr ?: "???"); + for ( i =3D 0; i < ARRAY_SIZE(leaf_info); ++i ) + printf("%-8s ", leaf_info[i].abbr ?: "???"); printf("\n"); } =20 --=20 2.30.2 From nobody Mon Nov 25 04:47:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1715380833; cv=none; d=zohomail.com; s=zohoarc; b=YjfjZ9PuwfDEPMwr+BCgWESlGA9HLeMmO7H+53NsjbrAPYU1CaD62qey3QUv43DcRdingsCzhgZIxPNNjqXmerAVPQjMxMNjXrMiM8N84N7lVxfs7efM3EXIAdG7r+U4D96X7HtaveBQ9jEgjqIB94suvKqU7cNx5dSZUJDDGVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715380833; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Phw85PeYT8ClsRvMd2JBZsNjZhs23kHM7gjroo/IJSY=; b=GBgQu8zfhBm/nwUJ80vLWS5Lr4+TDlFySOgDvoe35EpDVHK+g4TP5PlzerTjdZbeIvvhZJV/4jD0l8m+Z6ToJ5Nujo8Wl+RzI4iXF6OkRC3LJjWPwRT6A/N7seYrzdkAZurTsxqsfUJWAmABfm5EDwQLR/9tN5OwWOWk6dsh3T4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715380833921567.2677039311873; Fri, 10 May 2024 15:40:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.720096.1123116 (Exim 4.92) (envelope-from ) id 1s5YuQ-0000OP-Em; Fri, 10 May 2024 22:40:10 +0000 Received: by outflank-mailman (output) from mailman id 720096.1123116; Fri, 10 May 2024 22:40:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuQ-0000OI-Bw; Fri, 10 May 2024 22:40:10 +0000 Received: by outflank-mailman (input) for mailman id 720096; Fri, 10 May 2024 22:40:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuP-000872-Bd for xen-devel@lists.xenproject.org; Fri, 10 May 2024 22:40:09 +0000 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [2a00:1450:4864:20::62f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 40260fd6-0f1e-11ef-909d-e314d9c70b13; Sat, 11 May 2024 00:40:07 +0200 (CEST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a59cc765c29so559624066b.3 for ; Fri, 10 May 2024 15:40:07 -0700 (PDT) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781cf60sm233915866b.14.2024.05.10.15.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 15:40:06 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 40260fd6-0f1e-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1715380806; x=1715985606; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Phw85PeYT8ClsRvMd2JBZsNjZhs23kHM7gjroo/IJSY=; b=eKxt9k9HpPpDkLmGwthZfYlmFQzLunWL9YafRWJ+NEwTtUXDdYkMg7S86W80ZQKm/r 1ZSfFQMDZzPw7X6u+wQ0AcdRSguAXAsq33oQugU6zSYvZTHtVvDXSe1tFjLWyAh03fyg 6L5KdP0T2rY+0QnmYWzXI9QO5A34nLSv+/iR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715380806; x=1715985606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Phw85PeYT8ClsRvMd2JBZsNjZhs23kHM7gjroo/IJSY=; b=utwtBdbmsfHhqI7ES8U5hzn0ERN0d/ISdjDv+ikcLwKG7T4NWd4JoyABk9yl5oGcNh tWohC3IE2itRUgKfBDPdS6Uq/lLT9clwgwjgwGtj15cJR0kX7pvBSCK8qLWo27k9a0mc Z6LbA9UzSBURBSzSmlPL/nTVNLxklrKM/LXjeyXaOhkTsMhaht1dfiMb2xU8b1e8QiAT 4t8na+IysUga5NCKRhPaUlSeS/KsiZvk8g1+WN1UC0yya/FmCQjAyEfM9sCihxX7el9s bxi2fxbSRqqwLSYqawOn3FzvG5A21mrvwPQnEtpDudfFnIfsobnrS6sP8fpkYHAKymKx otvA== X-Gm-Message-State: AOJu0YykJ1zS3nijXdp/UwsLH7Ks+6VUB+ANQ5K3N7M976MQTMnbUFvS Jc/IB5kVby7eOYMknVhYf0xONeVWcf6l07JfLXJuKzrSMAJd3EQtgXmSG6yznDf2+vLot9xQxWZ i X-Google-Smtp-Source: AGHT+IHf4xSJp8NCGGmvT9XjSTZCP+6zYExEd3Ow9Gm2SOkX5JRmY26CWDUdpoU0non11Cvmx80fkQ== X-Received: by 2002:a17:907:77c3:b0:a59:9db6:535d with SMTP id a640c23a62f3a-a5a2d67862amr251200766b.65.1715380806572; Fri, 10 May 2024 15:40:06 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Andrew Cooper , Jan Beulich Subject: [PATCH 3/4] tools/xen-cpuid: Use automatically generated feature names Date: Fri, 10 May 2024 23:40:01 +0100 Message-Id: <20240510224002.2324578-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240510224002.2324578-1-andrew.cooper3@citrix.com> References: <20240510224002.2324578-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1715380834720100002 From: Roger Pau Monn=C3=A9 Have gen-cpuid.py write out INIT_FEATURE_VAL_TO_NAME, derived from the same data source as INIT_FEATURE_NAME_TO_VAL, although both aliases of common_1d are needed. In xen-cpuid.c, have the compiler pad both leaf_info[] and feature_names[] = if necessary. This avoids needing complicated cross-checks. As dump_leaf() rendered missing names as numbers, always dump leaves even if we don't have the leaf name. This conversion was argumably missed in commit 59afdb8a81d6 ("tools/misc: Tweak reserved bit handling for xen-cpuid"). Signed-off-by: Roger Pau Monn=C3=A9 Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 Differences in names are: sysenter -> sep tm -> tm1 ds-cpl -> dscpl est -> eist sse41 -> sse4-1 sse42 -> sse4-2 movebe -> movbe tsc-dl -> tsc-deadline rdrnd -> rdrand hyper -> hypervisor mmx+ -> mmext fxsr+ -> ffxsr pg1g -> page1gb 3dnow+ -> 3dnowext cmp -> cmp-legacy cr8d -> cr8-legacy lzcnt -> abm msse -> misalignsse 3dnowpf -> 3dnowprefetch nodeid -> nodeid-msr dbx -> dbext tsc-adj -> tsc-adjust fdp-exn -> fdp-excp-only deffp -> no-fpu-sel <24> -> bld ppin -> amd-ppin lfence+ -> lfence-dispatch ppin -> intel-ppin energy-ctrl -> energy-filtering Apparently BLD missed the update to xen-cpuid.c. It appears to be the only one. Several of the + names would be nice to keep as were, but doing so is= n't nice in gen-cpuid. Any changes would alter the {dom0-}cpuid=3D cmdline opt= ions, but we intentionally don't list them, so I'm not worried. Thoughts? v3: * Rework somewhat. * Insert aliases of common_1d. --- tools/misc/xen-cpuid.c | 15 ++++++--------- xen/tools/gen-cpuid.py | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 6ee835b22949..2f34694e9c57 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -11,6 +11,7 @@ #include =20 #include +#include =20 static uint32_t nr_features; =20 @@ -268,7 +269,7 @@ static const struct { const char *name; const char *abbr; const char *const *strs; -} leaf_info[] =3D { +} leaf_info[FEATURESET_NR_ENTRIES] =3D { { "CPUID 0x00000001.edx", "1d", str_1d }, { "CPUID 0x00000001.ecx", "1c", str_1c }, { "CPUID 0x80000001.edx", "e1d", str_e1d }, @@ -291,6 +292,9 @@ static const struct { =20 #define COL_ALIGN "24" =20 +static const char *const feature_names[(FEATURESET_NR_ENTRIES + 1) << 5] = =3D + INIT_FEATURE_VAL_TO_NAME; + static const char *const fs_names[] =3D { [XEN_SYSCTL_cpu_featureset_raw] =3D "Raw", [XEN_SYSCTL_cpu_featureset_host] =3D "Host", @@ -304,12 +308,6 @@ static void dump_leaf(uint32_t leaf, const char *const= *strs) { unsigned i; =20 - if ( !strs ) - { - printf(" ???"); - return; - } - for ( i =3D 0; i < 32; ++i ) if ( leaf & (1u << i) ) { @@ -338,8 +336,7 @@ static void decode_featureset(const uint32_t *features, for ( i =3D 0; i < length && i < ARRAY_SIZE(leaf_info); ++i ) { printf(" [%02u] %-"COL_ALIGN"s", i, leaf_info[i].name ?: ""); - if ( leaf_info[i].name ) - dump_leaf(features[i], leaf_info[i].strs); + dump_leaf(features[i], &feature_names[i * 32]); printf("\n"); } } diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py index 79d7f5c8e1c9..d0bb2e4a229f 100755 --- a/xen/tools/gen-cpuid.py +++ b/xen/tools/gen-cpuid.py @@ -470,6 +470,27 @@ def write_results(state): state.output.write( """} =20 +""") + + state.output.write( +""" +#define INIT_FEATURE_VAL_TO_NAME { \\ +""") + + for name, bit in sorted(state.values.items()): + state.output.write( + ' [%s] =3D "%s",\\\n' % (bit, name) + ) + + # Add the other alias for 1d/e1d common bits + if bit in state.common_1d: + state.output.write( + ' [%s] =3D "%s",\\\n' % (64 + bit, name) + ) + + state.output.write( +"""} + """) =20 for idx, text in enumerate(state.bitfields): --=20 2.30.2 From nobody Mon Nov 25 04:47:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1715380834; cv=none; d=zohomail.com; s=zohoarc; b=Q1ID/aWZEFgG3DoHpzZsg8oUq53K+ykJ8E4QTGTYFqZN2OCsfh8yZG/q9iPMdHOVWocusQ5dCi7+8aaB91sROMMyHFQsHJrM4PGc4LSGotMAXBLF85xe/LNLQ3Bsyd3oA4Z1oK31GV+ack/tBgCvqGhmgHp+QkcW9AvRbBHdhmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715380834; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NZZNtujjN9pYr6HT0e0A2/j3Mym7RChiLwN22jfYFXQ=; b=Lg0xV+Sdj+GZ51pV5kNtStFEvmolCyFQAqZQtTEeer0UrRxVQMU56cZ/krK3afKrMwNd5So/AI1yedx1LuMSv9ezjOt6eBH83ZAJw4UxE8xWRAGT3/gfhLqMSKEKw//PVLBYkVju+u6xQKk1vsVNUrD6dqffizbLSQP7N930E+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17153808342701000.1737795285544; Fri, 10 May 2024 15:40:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.720097.1123127 (Exim 4.92) (envelope-from ) id 1s5YuS-0000fd-Nh; Fri, 10 May 2024 22:40:12 +0000 Received: by outflank-mailman (output) from mailman id 720097.1123127; Fri, 10 May 2024 22:40:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuS-0000fY-Js; Fri, 10 May 2024 22:40:12 +0000 Received: by outflank-mailman (input) for mailman id 720097; Fri, 10 May 2024 22:40:11 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5YuQ-0000RL-UH for xen-devel@lists.xenproject.org; Fri, 10 May 2024 22:40:10 +0000 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [2a00:1450:4864:20::62b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 40e7ea54-0f1e-11ef-b4bb-af5377834399; Sat, 11 May 2024 00:40:08 +0200 (CEST) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a59a64db066so661797066b.3 for ; Fri, 10 May 2024 15:40:08 -0700 (PDT) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781cf60sm233915866b.14.2024.05.10.15.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 15:40:06 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 40e7ea54-0f1e-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1715380807; x=1715985607; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NZZNtujjN9pYr6HT0e0A2/j3Mym7RChiLwN22jfYFXQ=; b=dMcczuGdoQatw4rz5HetC7jd1Ll80NHUcG8fkCjdn2wstbs3XH4089I61pI+j1yc+x 9byQh0qXw3hHgrwZaJq9ChMZ7nkNmYZD/FIits5YxxClNmWb+dfmewkP3Ar8Ts3q6FBW CmVJ/pAyDNoLlipGv4auyRxSRz5svuz9779Tg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715380807; x=1715985607; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NZZNtujjN9pYr6HT0e0A2/j3Mym7RChiLwN22jfYFXQ=; b=q/rBjAmNnQf+6nmPw0mH8EBedFvannOaxG9OwL68IJXTQCuxoDXpV4eunR4q4bIcvh CAE9fz4K9Knb4w1adgbaJxXFOZRpNZYE3VhhPQhUkpE32C6zAcaCkrc74SWM9+vyWxpA v/WYMKWrNrW9kuUCuG5oIwnOx+QYcti1+Uvu8WetWiYR+LPPcbfW5NRN1Ugl+oLSheRd cyGpXFaWCkd/tq3PCNfJUSWXmqSsx/7AoHa/6Wnt30dp9Maba6uOHAOHOP4fVoGPpmcT MJ3oqnSyx9gBoAT0xinOiLGO+HXVudOqVVNe6M6dqyZOVjVWy4EJlzyAy4YXRaqzqv6t +xgA== X-Gm-Message-State: AOJu0YywnCw8MX1NLb0HfgZAyMXE4TAb9gyFbKA6zw0FgHUOveAbw7+k kZWQBDRFhl9eSGD+DYURm7TYtD+L8tS4PkbtrlxsZal6hvGNbu1jRHABwXaDrm1xBa9rom+F5+Q M X-Google-Smtp-Source: AGHT+IFXXDmaCK9fx4msP1oV+MH9H9mEiBmmVYHwccM8SXOciaaLj3tBQWdnSEKuMH8C/e8C2XT1iw== X-Received: by 2002:a17:906:1d16:b0:a59:dd91:3417 with SMTP id a640c23a62f3a-a5a2d53b132mr250376266b.5.1715380807400; Fri, 10 May 2024 15:40:07 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Andrew Cooper , Jan Beulich Subject: [PATCH 4/4] tools/xen-cpuid: Drop old names Date: Fri, 10 May 2024 23:40:02 +0100 Message-Id: <20240510224002.2324578-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240510224002.2324578-1-andrew.cooper3@citrix.com> References: <20240510224002.2324578-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1715380834731100003 From: Roger Pau Monn=C3=A9 Not used any more. Split out of previous patch to aid legibility. Signed-off-by: Roger Pau Monn=C3=A9 Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 v3: * New (split out) --- tools/misc/xen-cpuid.c | 287 +++-------------------------------------- 1 file changed, 18 insertions(+), 269 deletions(-) diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 2f34694e9c57..2cb5322ed9aa 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -15,279 +15,28 @@ =20 static uint32_t nr_features; =20 -static const char *const str_1d[32] =3D -{ - [ 0] =3D "fpu", [ 1] =3D "vme", - [ 2] =3D "de", [ 3] =3D "pse", - [ 4] =3D "tsc", [ 5] =3D "msr", - [ 6] =3D "pae", [ 7] =3D "mce", - [ 8] =3D "cx8", [ 9] =3D "apic", - /* [10] */ [11] =3D "sysenter", - [12] =3D "mtrr", [13] =3D "pge", - [14] =3D "mca", [15] =3D "cmov", - [16] =3D "pat", [17] =3D "pse36", - [18] =3D "psn", [19] =3D "clflush", - /* [20] */ [21] =3D "ds", - [22] =3D "acpi", [23] =3D "mmx", - [24] =3D "fxsr", [25] =3D "sse", - [26] =3D "sse2", [27] =3D "ss", - [28] =3D "htt", [29] =3D "tm", - [30] =3D "ia64", [31] =3D "pbe", -}; - -static const char *const str_1c[32] =3D -{ - [ 0] =3D "sse3", [ 1] =3D "pclmulqdq", - [ 2] =3D "dtes64", [ 3] =3D "monitor", - [ 4] =3D "ds-cpl", [ 5] =3D "vmx", - [ 6] =3D "smx", [ 7] =3D "est", - [ 8] =3D "tm2", [ 9] =3D "ssse3", - [10] =3D "cntx-id", [11] =3D "sdgb", - [12] =3D "fma", [13] =3D "cx16", - [14] =3D "xtpr", [15] =3D "pdcm", - /* [16] */ [17] =3D "pcid", - [18] =3D "dca", [19] =3D "sse41", - [20] =3D "sse42", [21] =3D "x2apic", - [22] =3D "movebe", [23] =3D "popcnt", - [24] =3D "tsc-dl", [25] =3D "aesni", - [26] =3D "xsave", [27] =3D "osxsave", - [28] =3D "avx", [29] =3D "f16c", - [30] =3D "rdrnd", [31] =3D "hyper", -}; - -static const char *const str_e1d[32] =3D -{ - [ 0] =3D "fpu", [ 1] =3D "vme", - [ 2] =3D "de", [ 3] =3D "pse", - [ 4] =3D "tsc", [ 5] =3D "msr", - [ 6] =3D "pae", [ 7] =3D "mce", - [ 8] =3D "cx8", [ 9] =3D "apic", - /* [10] */ [11] =3D "syscall", - [12] =3D "mtrr", [13] =3D "pge", - [14] =3D "mca", [15] =3D "cmov", - [16] =3D "fcmov", [17] =3D "pse36", - /* [18] */ [19] =3D "mp", - [20] =3D "nx", /* [21] */ - [22] =3D "mmx+", [23] =3D "mmx", - [24] =3D "fxsr", [25] =3D "fxsr+", - [26] =3D "pg1g", [27] =3D "rdtscp", - /* [28] */ [29] =3D "lm", - [30] =3D "3dnow+", [31] =3D "3dnow", -}; - -static const char *const str_e1c[32] =3D -{ - [ 0] =3D "lahf-lm", [ 1] =3D "cmp", - [ 2] =3D "svm", [ 3] =3D "extapic", - [ 4] =3D "cr8d", [ 5] =3D "lzcnt", - [ 6] =3D "sse4a", [ 7] =3D "msse", - [ 8] =3D "3dnowpf", [ 9] =3D "osvw", - [10] =3D "ibs", [11] =3D "xop", - [12] =3D "skinit", [13] =3D "wdt", - /* [14] */ [15] =3D "lwp", - [16] =3D "fma4", [17] =3D "tce", - /* [18] */ [19] =3D "nodeid", - /* [20] */ [21] =3D "tbm", - [22] =3D "topoext", [23] =3D "perfctr-core", - [24] =3D "perfctr-nb", /* [25] */ - [26] =3D "dbx", [27] =3D "perftsc", - [28] =3D "pcx-l2i", [29] =3D "monitorx", - [30] =3D "addr-msk-ext", -}; - -static const char *const str_7b0[32] =3D -{ - [ 0] =3D "fsgsbase", [ 1] =3D "tsc-adj", - [ 2] =3D "sgx", [ 3] =3D "bmi1", - [ 4] =3D "hle", [ 5] =3D "avx2", - [ 6] =3D "fdp-exn", [ 7] =3D "smep", - [ 8] =3D "bmi2", [ 9] =3D "erms", - [10] =3D "invpcid", [11] =3D "rtm", - [12] =3D "pqm", [13] =3D "depfpp", - [14] =3D "mpx", [15] =3D "pqe", - [16] =3D "avx512f", [17] =3D "avx512dq", - [18] =3D "rdseed", [19] =3D "adx", - [20] =3D "smap", [21] =3D "avx512-ifma", - [22] =3D "pcommit", [23] =3D "clflushopt", - [24] =3D "clwb", [25] =3D "proc-trace", - [26] =3D "avx512pf", [27] =3D "avx512er", - [28] =3D "avx512cd", [29] =3D "sha", - [30] =3D "avx512bw", [31] =3D "avx512vl", -}; - -static const char *const str_Da1[32] =3D -{ - [ 0] =3D "xsaveopt", [ 1] =3D "xsavec", - [ 2] =3D "xgetbv1", [ 3] =3D "xsaves", -}; - -static const char *const str_7c0[32] =3D -{ - [ 0] =3D "prefetchwt1", [ 1] =3D "avx512-vbmi", - [ 2] =3D "umip", [ 3] =3D "pku", - [ 4] =3D "ospke", [ 5] =3D "waitpkg", - [ 6] =3D "avx512-vbmi2", [ 7] =3D "cet-ss", - [ 8] =3D "gfni", [ 9] =3D "vaes", - [10] =3D "vpclmulqdq", [11] =3D "avx512-vnni", - [12] =3D "avx512-bitalg", - [14] =3D "avx512-vpopcntdq", - - [22] =3D "rdpid", - /* 24 */ [25] =3D "cldemote", - /* 26 */ [27] =3D "movdiri", - [28] =3D "movdir64b", [29] =3D "enqcmd", - [30] =3D "sgx-lc", [31] =3D "pks", -}; - -static const char *const str_e7d[32] =3D -{ - /* 6 */ [ 7] =3D "hw-pstate", - [ 8] =3D "itsc", [ 9] =3D "cpb", - [10] =3D "efro", -}; - -static const char *const str_e8b[32] =3D -{ - [ 0] =3D "clzero", - [ 2] =3D "rstr-fp-err-ptrs", - - /* [ 8] */ [ 9] =3D "wbnoinvd", - - [12] =3D "ibpb", - [14] =3D "ibrs", [15] =3D "amd-stibp", - [16] =3D "ibrs-always", [17] =3D "stibp-always", - [18] =3D "ibrs-fast", [19] =3D "ibrs-same-mode", - - [20] =3D "no-lmsl", - /* [22] */ [23] =3D "ppin", - [24] =3D "amd-ssbd", [25] =3D "virt-ssbd", - [26] =3D "ssb-no", - [28] =3D "psfd", [29] =3D "btc-no", - [30] =3D "ibpb-ret", -}; - -static const char *const str_7d0[32] =3D -{ - [ 2] =3D "avx512-4vnniw", [ 3] =3D "avx512-4fmaps", - [ 4] =3D "fsrm", - - [ 8] =3D "avx512-vp2intersect", [ 9] =3D "srbds-ctrl", - [10] =3D "md-clear", [11] =3D "rtm-always-abort", - /* 12 */ [13] =3D "tsx-force-abort", - [14] =3D "serialize", [15] =3D "hybrid", - [16] =3D "tsxldtrk", - [18] =3D "pconfig", - [20] =3D "cet-ibt", - /* 22 */ [23] =3D "avx512-fp16", - - [26] =3D "ibrsb", [27] =3D "stibp", - [28] =3D "l1d-flush", [29] =3D "arch-caps", - [30] =3D "core-caps", [31] =3D "ssbd", -}; - -static const char *const str_7a1[32] =3D -{ - [ 0] =3D "sha512", [ 1] =3D "sm3", - [ 2] =3D "sm4", - [ 4] =3D "avx-vnni", [ 5] =3D "avx512-bf16", - - [10] =3D "fzrm", [11] =3D "fsrs", - [12] =3D "fsrcs", - - /* 18 */ [19] =3D "wrmsrns", - - /* 22 */ [23] =3D "avx-ifma", -}; - -static const char *const str_e21a[32] =3D -{ - [ 0] =3D "no-nest-bp", [ 1] =3D "fs-gs-ns", - [ 2] =3D "lfence+", - [ 6] =3D "nscb", - [ 8] =3D "auto-ibrs", - [10] =3D "amd-fsrs", [11] =3D "amd-fsrc", - - /* 16 */ [17] =3D "cpuid-user-dis", - [18] =3D "epsf", [19] =3D "fsrsc", - [20] =3D "amd-prefetchi", - - /* 26 */ [27] =3D "sbpb", - [28] =3D "ibpb-brtype", [29] =3D "srso-no", -}; - -static const char *const str_7b1[32] =3D -{ - [ 0] =3D "ppin", -}; - -static const char *const str_7c1[32] =3D -{ -}; - -static const char *const str_7d1[32] =3D -{ - [ 4] =3D "avx-vnni-int8", [ 5] =3D "avx-ne-convert", - - [10] =3D "avx-vnni-int16", - - [14] =3D "prefetchi", - - [18] =3D "cet-sss", -}; - -static const char *const str_7d2[32] =3D -{ - [ 0] =3D "intel-psfd", [ 1] =3D "ipred-ctrl", - [ 2] =3D "rrsba-ctrl", [ 3] =3D "ddp-ctrl", - [ 4] =3D "bhi-ctrl", [ 5] =3D "mcdt-no", -}; - -static const char *const str_m10Al[32] =3D -{ - [ 0] =3D "rdcl-no", [ 1] =3D "eibrs", - [ 2] =3D "rsba", [ 3] =3D "skip-l1dfl", - [ 4] =3D "intel-ssb-no", [ 5] =3D "mds-no", - [ 6] =3D "if-pschange-mc-no", [ 7] =3D "tsx-ctrl", - [ 8] =3D "taa-no", [ 9] =3D "mcu-ctrl", - [10] =3D "misc-pkg-ctrl", [11] =3D "energy-ctrl", - [12] =3D "doitm", [13] =3D "sbdr-ssdp-no", - [14] =3D "fbsdp-no", [15] =3D "psdp-no", - /* 16 */ [17] =3D "fb-clear", - [18] =3D "fb-clear-ctrl", [19] =3D "rrsba", - [20] =3D "bhi-no", [21] =3D "xapic-status", - /* 22 */ [23] =3D "ovrclk-status", - [24] =3D "pbrsb-no", [25] =3D "gds-ctrl", - [26] =3D "gds-no", [27] =3D "rfds-no", - [28] =3D "rfds-clear", -}; - -static const char *const str_m10Ah[32] =3D -{ -}; - static const struct { const char *name; const char *abbr; - const char *const *strs; } leaf_info[FEATURESET_NR_ENTRIES] =3D { - { "CPUID 0x00000001.edx", "1d", str_1d }, - { "CPUID 0x00000001.ecx", "1c", str_1c }, - { "CPUID 0x80000001.edx", "e1d", str_e1d }, - { "CPUID 0x80000001.ecx", "e1c", str_e1c }, - { "CPUID 0x0000000d:1.eax", "Da1", str_Da1 }, - { "CPUID 0x00000007:0.ebx", "7b0", str_7b0 }, - { "CPUID 0x00000007:0.ecx", "7c0", str_7c0 }, - { "CPUID 0x80000007.edx", "e7d", str_e7d }, - { "CPUID 0x80000008.ebx", "e8b", str_e8b }, - { "CPUID 0x00000007:0.edx", "7d0", str_7d0 }, - { "CPUID 0x00000007:1.eax", "7a1", str_7a1 }, - { "CPUID 0x80000021.eax", "e21a", str_e21a }, - { "CPUID 0x00000007:1.ebx", "7b1", str_7b1 }, - { "CPUID 0x00000007:2.edx", "7d2", str_7d2 }, - { "CPUID 0x00000007:1.ecx", "7c1", str_7c1 }, - { "CPUID 0x00000007:1.edx", "7d1", str_7d1 }, - { "MSR_ARCH_CAPS.lo", "m10Al", str_m10Al }, - { "MSR_ARCH_CAPS.hi", "m10Ah", str_m10Ah }, + { "CPUID 0x00000001.edx", "1d" }, + { "CPUID 0x00000001.ecx", "1c" }, + { "CPUID 0x80000001.edx", "e1d" }, + { "CPUID 0x80000001.ecx", "e1c" }, + { "CPUID 0x0000000d:1.eax", "Da1" }, + { "CPUID 0x00000007:0.ebx", "7b0" }, + { "CPUID 0x00000007:0.ecx", "7c0" }, + { "CPUID 0x80000007.edx", "e7d" }, + { "CPUID 0x80000008.ebx", "e8b" }, + { "CPUID 0x00000007:0.edx", "7d0" }, + { "CPUID 0x00000007:1.eax", "7a1" }, + { "CPUID 0x80000021.eax", "e21a" }, + { "CPUID 0x00000007:1.ebx", "7b1" }, + { "CPUID 0x00000007:2.edx", "7d2" }, + { "CPUID 0x00000007:1.ecx", "7c1" }, + { "CPUID 0x00000007:1.edx", "7d1" }, + { "MSR_ARCH_CAPS.lo", "m10Al" }, + { "MSR_ARCH_CAPS.hi", "m10Ah" }, }; =20 #define COL_ALIGN "24" --=20 2.30.2