From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-10631.protonmail.ch (mail-10631.protonmail.ch [79.135.106.31]) (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 562B5341ADD for ; Tue, 17 Mar 2026 20:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.31 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773777621; cv=none; b=TItJs5PSiFE+p12IiYgQuR6CRV/A7ytIXVFhZEATWHKk7i2Satk4rtviec/5CDTn7VNknxZjZtCbs2yNVhN02HQiNpBlKopXi5l1eimKW7rV7TWBBd68neuMeJBuZo+Ffy/UBekogQ7Sz7icQOr3apfM0MaAfWBKNswrjE7ZYY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773777621; c=relaxed/simple; bh=tWDObhwon6WpNwSWFcqzESB8MljDrPJxRAKSXiwzQlo=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=jHNJCUCq1Dwwd9aGy+hVM3Mpr+jT4H79IgQC/hngby0fgkOL3sbgqmMV4qvyVinQ3U9nvGrQdtX3IoKL1lJ4Djn9l1vGQFoyYaYm5lb4HK4S5roX4DoNBCTHzyqXHDpokSOeBQODLbeYUooWqiVYy+6E2iDmgLHvGtRi1Zt7DKo= 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=aCJFYBER; arc=none smtp.client-ip=79.135.106.31 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="aCJFYBER" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1773777610; x=1774036810; bh=xxHXYSvhEANIoTp8WdRj5wogkPEnV0Zs/PSTrclxCpU=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=aCJFYBER2dzMBs0b8ytcQcywpDB1dttX3Nqjdc8CHUx9cuSmtGLLHeZ+HHOhmWQxe 5U8jsoRcGxbmiGFQYO3U6axweOzdjqNmsC2oGsdIVpDLYZMKOxNAheUHSzDTsLdYju tMkhRGZSeaDUgcNV/F7BvLe0AWqVZZG7P+j2fuyOR4jSXEaiF41qjeR9xa9Srx928A s5C5mgWPQYo/2Bbz77D344ug/5P4Spnj6lelBlKs4fg+3S00rOiV/nmnxzHQPGzr/j iUwuD/43S3pKeBM3YcMgIUgMJTj9Dt3wd3ZQ7Zd/ETbFQX249BJ91yixfxBpU8Xfef LrB4vC8049Peg== Date: Tue, 17 Mar 2026 20:00:03 +0000 To: tglx@kernel.org, bp@alien8.de, mingo@redhat.com, darwi@linutronix.de, thuth@redhat.com, dave.hansen@linux.intel.com, ak@linux.intel.com, babu.moger@amd.com, chang.seok.bae@intel.com, peterz@infradead.org, nik.borisov@suse.com, jpoimboe@kernel.org, pawan.kumar.gupta@linux.intel.com, hpa@zytor.com, xin@zytor.com, maciej.wieczor-retman@intel.com, sohil.mehta@intel.com From: Maciej Wieczor-Retman Cc: x86@kernel.org, linux-kernel@vger.kernel.org, m.wieczorretman@pm.me Subject: [PATCH v10 0/3] x86: Capability bits fix and required bits sanity check Message-ID: Feedback-ID: 164464600:user:proton X-Pm-Message-ID: aa9ed240d14686ebe4bd825fc6c11b97e46b1699 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-rc4 Previous patchset versions: 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-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/cpufeature.h | 4 ++ arch/x86/kernel/cpu/common.c | 64 +++++++++++++++++++++++++++--- arch/x86/kernel/cpu/cpuid-deps.c | 21 ++-------- arch/x86/tools/cpufeaturemasks.awk | 6 +++ 4 files changed, 71 insertions(+), 24 deletions(-) --=20 2.53.0