From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA25A2857F0 for ; Tue, 10 Mar 2026 18:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773165719; cv=none; b=Q5j/ltIJwBD85W4+v+BQ77/2nJJACtLrcfe5aJ045S//Ez3FI0MKZxDnWKb0/CSXopCgouZF+sL1ods6e49eDrmHNtlIVu9VpC17Fu+RIgRLQN34mhsHNryC2CBzuv9TVg4iHDVRQv6A6VZIeFcila0b/YKQcuJKMit0KKiOlug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773165719; c=relaxed/simple; bh=Re/PICnh5YFSIWav+RY33mmQXWRxBqjT0OlHzoaYjBs=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=U9ALM06m4fc5DyICTcZflx4At/jGCSjJRVbz/1XFVi48oSmkDd9KwcwnvH+zo/vhRljZHEF1z0+m9LdOOzd1ohc4ccj9SnhcTkhHqACza65mdnMIA41YtJI+A5/7yl33XNkttxP0fM9D4b2ZK6ErmYxh7fHzlp/T1WBCTo+x3Qc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=rY9naj8t; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="rY9naj8t" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1773165715; x=1773424915; bh=ZSj5wW7lWwxET8wq2W3WC31TPAixXRbhdK4iJ+Hps0A=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=rY9naj8tYxIN7IVqY5HIm/h2pNTvqo4MAtH4ytdwimlx2YkwR4JD4B/8nbnFpU0Yd 7NvnsKYM37d57gCfADphYf2Bdonsw4rwOmgB+kZcjzex30BMJAWNXnYgStguP5dJgR yBtrP7rPGXujs1aTiIyF3Y3yL8Zpxr5+i2sWlMLRwamb/HavElEt1V6reXPIjMOQrT 6i4eY+TCj6w0E5/TROlLuIc8TMocO5q/Ab+V/Ci+PoM63/59761pF6Pyvkrk7SQtzK 18VpVK0CHydSS7d6u58OYH0SfZXyfsVWec/iNyFbnDIX+lpVMm0bnkpRe149pCJy/J pd7IpfdbyGmrw== Date: Tue, 10 Mar 2026 18:01:50 +0000 To: tglx@kernel.org, sohil.mehta@intel.com, babu.moger@amd.com, pawan.kumar.gupta@linux.intel.com, elena.reshetova@intel.com, xin@zytor.com, maciej.wieczor-retman@intel.com, darwi@linutronix.de, nik.borisov@suse.com, ak@linux.intel.com, hpa@zytor.com, dave.hansen@linux.intel.com, mingo@redhat.com, peterz@infradead.org, chang.seok.bae@intel.com, bp@alien8.de From: Maciej Wieczor-Retman Cc: linux-kernel@vger.kernel.org, x86@kernel.org, m.wieczorretman@pm.me Subject: [PATCH v9 0/3] x86: Capability bits fix and required bits sanity check Message-ID: Feedback-ID: 164464600:user:proton X-Pm-Message-ID: 6d783c7d9a5e6f3cea5fb5f56111d767ed35368b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-rc3 Previous patchset versions: 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-ret= man@intel.com/ v3: https://lore.kernel.org/all/20250724094554.2153919-1-maciej.wieczor-ret= man@intel.com/ v2: https://lore.kernel.org/all/20250723092250.3411923-1-maciej.wieczor-ret= man@intel.com/ v1: https://lore.kernel.org/all/20250722074439.4069992-1-maciej.wieczor-ret= man@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 | 4 ++ arch/x86/kernel/cpu/common.c | 63 +++++++++++++++++++++++++++--- arch/x86/kernel/cpu/cpuid-deps.c | 23 +++-------- arch/x86/tools/cpufeaturemasks.awk | 6 +++ 4 files changed, 72 insertions(+), 24 deletions(-) --=20 2.53.0