mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maciej Wieczor-Retman <m.wieczorretman@pm.me>
To: chang.seok.bae@intel.com, bp@alien8.de, nik.borisov@suse.com,
	brgerst@gmail.com, hpa@zytor.com, jarkko@kernel.org,
	darwi@linutronix.de, jackmanb@google.com, mingo@redhat.com,
	pawan.kumar.gupta@linux.intel.com, ak@linux.intel.com,
	elena.reshetova@intel.com, xin@zytor.com, peterz@infradead.org,
	tglx@kernel.org, dave.hansen@linux.intel.com,
	sohil.mehta@intel.com, maciej.wieczor-retman@intel.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org, m.wieczorretman@pm.me
Subject: [PATCH v8 0/3] x86: Capability bits fix and required bits sanity check
Date: Mon, 02 Mar 2026 15:24:29 +0000	[thread overview]
Message-ID: <cover.1772453012.git.m.wieczorretman@pm.me> (raw)

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. The cleanup patch fixes that and simplifies the other two
instances.

Patches are based on v7.0-rc2

Previous patchset versions:
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 (3):
  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

 arch/x86/include/asm/cpu.h         |  2 +
 arch/x86/kernel/cpu/common.c       | 62 +++++++++++++++++++++++++++---
 arch/x86/kernel/cpu/cpuid-deps.c   | 20 ++--------
 arch/x86/tools/cpufeaturemasks.awk |  6 +++
 4 files changed, 67 insertions(+), 23 deletions(-)

-- 
2.53.0



             reply	other threads:[~2026-03-02 15:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 15:24 Maciej Wieczor-Retman [this message]
2026-03-02 15:25 ` [PATCH v8 1/3] x86/cpu: Clear feature bits disabled at compile-time Maciej Wieczor-Retman
2026-03-02 19:31   ` Borislav Petkov
2026-03-02 19:48     ` Maciej Wieczor-Retman
2026-03-02 20:25       ` Borislav Petkov
2026-03-02 20:38         ` Maciej Wieczor-Retman
2026-03-02 20:59           ` Borislav Petkov
2026-03-02 21:22             ` Maciej Wieczor-Retman
2026-03-03  5:59               ` Borislav Petkov
2026-03-09 23:47   ` Sohil Mehta
2026-03-10 10:49     ` Maciej Wieczor-Retman
2026-03-02 15:25 ` [PATCH v8 2/3] x86/cpu: Check if feature string is non-zero Maciej Wieczor-Retman
2026-03-10  6:23   ` Sohil Mehta
2026-03-10 12:29     ` Maciej Wieczor-Retman
2026-03-02 15:25 ` [PATCH v8 3/3] x86/cpu: Do a sanity check on required feature bits Maciej Wieczor-Retman
2026-03-10  7:05   ` Sohil Mehta
2026-03-10 13:06     ` Maciej Wieczor-Retman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1772453012.git.m.wieczorretman@pm.me \
    --to=m.wieczorretman@pm.me \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=chang.seok.bae@intel.com \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=hpa@zytor.com \
    --cc=jackmanb@google.com \
    --cc=jarkko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®