public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v12 0/4] x86: Capability bits fix and required bits sanity check
@ 2026-03-27 15:10 Maciej Wieczor-Retman
  2026-03-27 15:10 ` [PATCH v12 1/4] x86/cpu: Clear feature bits disabled at compile-time Maciej Wieczor-Retman
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Maciej Wieczor-Retman @ 2026-03-27 15:10 UTC (permalink / raw)
  To: bp, dave.hansen, hpa, xin, chang.seok.bae, mingo, elena.reshetova,
	maciej.wieczor-retman, babu.moger, sohil.mehta, pawan.kumar.gupta,
	pmladek, nik.borisov, ptesarik, darwi, tglx, peterz, jpoimboe, ak
  Cc: linux-kernel, x86, m.wieczorretman

Series aims to fix the inconsistency between the cpuinfo behavior and
the documentation. Specifically the features that are not compiled are
still present in the cpuinfo bitmasks as enabled. This is not in line
with the documentation which specifies that not-compiled features are
not present in /proc/cpuinfo.

Along adding the disabled feature bitmask initializer array, the
complementary required bitmask initializer is also added. It can be used
to provide a sanity check, after the cpu identification is finished, to
make sure every required bit is set in the final bitmask. A warning with
the cpu number and all required bits that were not set is emitted in
case of the sanity check failure.

Before adding the sanity check a small cleanup can be done. Three places
open code an operation that retrieves either a feature string or, if the
string is not present, the feature number in word:bit format. One of
these places also doesn't check whether the string is actually there or
not. While currently not a problem (all the features in the checked list
have corresponding strings) it may cause a failure if more entries are
added. The cleanup patch fixes that and simplifies the other two
instances.

Patches are based on v7.0-rc5

Previous patchset versions:
v11: https://lore.kernel.org/all/cover.1774008873.git.m.wieczorretman@pm.me/
v10: https://lore.kernel.org/all/cover.1773771353.git.m.wieczorretman@pm.me/
v9:  https://lore.kernel.org/all/cover.1773165421.git.m.wieczorretman@pm.me/
v8:  https://lore.kernel.org/all/cover.1772453012.git.m.wieczorretman@pm.me/
v7:  https://lore.kernel.org/all/cover.1771936214.git.m.wieczorretman@pm.me/
v6:  https://lore.kernel.org/all/cover.1771590895.git.m.wieczorretman@pm.me/
v5:  https://lore.kernel.org/all/cover.1770908783.git.m.wieczorretman@pm.me/
v4:  https://lore.kernel.org/all/20250724125346.2792543-1-maciej.wieczor-retman@intel.com/
v3:  https://lore.kernel.org/all/20250724094554.2153919-1-maciej.wieczor-retman@intel.com/
v2:  https://lore.kernel.org/all/20250723092250.3411923-1-maciej.wieczor-retman@intel.com/
v1:  https://lore.kernel.org/all/20250722074439.4069992-1-maciej.wieczor-retman@intel.com/

Maciej Wieczor-Retman (4):
  x86/cpu: Clear feature bits disabled at compile-time
  x86/cpu: Check if feature string is non-zero
  x86/cpu: Do a sanity check on required feature bits
  x86/cpu: Clear feature bits whose dependencies were cleared

 arch/x86/include/asm/cpufeature.h  |  1 +
 arch/x86/kernel/cpu/common.c       | 63 +++++++++++++++++++++++++++---
 arch/x86/kernel/cpu/cpu.h          |  4 ++
 arch/x86/kernel/cpu/cpuid-deps.c   | 21 +++++-----
 arch/x86/tools/cpufeaturemasks.awk |  6 +++
 5 files changed, 79 insertions(+), 16 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-30 10:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 15:10 [PATCH v12 0/4] x86: Capability bits fix and required bits sanity check Maciej Wieczor-Retman
2026-03-27 15:10 ` [PATCH v12 1/4] x86/cpu: Clear feature bits disabled at compile-time Maciej Wieczor-Retman
2026-03-27 15:10 ` [PATCH v12 2/4] x86/cpu: Check if feature string is non-zero Maciej Wieczor-Retman
2026-03-27 17:50   ` Sohil Mehta
2026-03-27 21:28     ` Maciej Wieczor-Retman
2026-03-27 15:10 ` [PATCH v12 3/4] x86/cpu: Do a sanity check on required feature bits Maciej Wieczor-Retman
2026-03-27 17:10   ` Pawan Gupta
2026-03-27 17:22     ` Maciej Wieczor-Retman
2026-03-27 15:11 ` [PATCH v12 4/4] x86/cpu: Clear feature bits whose dependencies were cleared Maciej Wieczor-Retman
2026-03-28  2:22   ` H. Peter Anvin
2026-03-30 10:40     ` Maciej Wieczor-Retman
2026-03-30  6:11 ` [PATCH v12 0/4] x86: Capability bits fix and required bits sanity check Andi Kleen
2026-03-30  8:52   ` Maciej Wieczor-Retman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox