From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 8B83537754E for ; Fri, 27 Mar 2026 17:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774631442; cv=none; b=KhAr2Hcuyuk8VirTw0SB/qcHWt808ptJ0bjHAIjexrtjDlU9M4UJiJEHy5nFlkBYTRNflwfoiRIFaBiUAjjnT796s4oxvOEqy85SJWVuJOCxooVaN6b+tfTsEaA7lJfFXTy6zvS2Q14FnH95bK0FCIj3UkLYPkKxcxzA13PHTJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774631442; c=relaxed/simple; bh=6vpruvS1Vkj0AozT8E9vPovf2/RPRpEAU7L/YohDf7Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mHActMBpI4CQsvvmO4Po/O25LEwOobNe2jLMv45jIXUOIGJILa6vA2pOKDwF0sSaLA7o2wb7PZLYfSS2YCefSVijGZKnne0UWLJXCU5JI4lokgjTl/xFpWCUlJqFe0MmakX9ys9unkrsU1B55eOlATKDVXWyPYtKQwGNQ+xtbnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nuFVA2cE; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nuFVA2cE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774631440; x=1806167440; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6vpruvS1Vkj0AozT8E9vPovf2/RPRpEAU7L/YohDf7Y=; b=nuFVA2cEMbsQkrRAlDReHqYyQiTNrhavCdx/VBj1c9P8ILx4KiYiC3/8 AAl30bnOrCTF/qamaQSihnpNIdzGDxgrEfSJ2KN0o7NSey5TDxV1NBbjc SuYqF1cb0U6KZkvH31oKvCehpqh0paLZ6okNRBOvDPRMS+WR6241Br4kg 0A2t3mgvvaqT6tEaOGn8sVAytZiZiTTqUeOmwm3gGOCbXGL0nsd2rNMGX BGLyI7RUoYDsOq9+uoxJcFsCiEhRpCEC3cpWFZes+khgkIJwmrBT/FLR6 08YlrlQzfwPD15+D8jik3LeNAUyF0fjo2qRYPvPqiuml4kfr62I8wn63z g==; X-CSE-ConnectionGUID: TtnSgkCeQKKhmceZ3yYEdA== X-CSE-MsgGUID: L1/TwIPpS1+Q4oDnCMjwIw== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="79315937" X-IronPort-AV: E=Sophos;i="6.23,144,1770624000"; d="scan'208";a="79315937" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 10:10:40 -0700 X-CSE-ConnectionGUID: U7Wou/whSumQDCK/V7opRA== X-CSE-MsgGUID: FfD3BoBzTGyeaewHLlxxEA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,144,1770624000"; d="scan'208";a="225627064" Received: from guptapa-desk.jf.intel.com (HELO desk) ([10.165.239.46]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 10:10:40 -0700 Date: Fri, 27 Mar 2026 10:10:33 -0700 From: Pawan Gupta To: Maciej Wieczor-Retman Cc: bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, xin@zytor.com, chang.seok.bae@intel.com, mingo@redhat.com, elena.reshetova@intel.com, maciej.wieczor-retman@intel.com, babu.moger@amd.com, sohil.mehta@intel.com, pmladek@suse.com, nik.borisov@suse.com, ptesarik@suse.com, darwi@linutronix.de, tglx@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v12 3/4] x86/cpu: Do a sanity check on required feature bits Message-ID: <20260327171033.dklme72frkemb7bf@desk> References: <76b7b70ef4b900b968b632e295ebb84fcbc986a5.1774623092.git.m.wieczorretman@pm.me> 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=us-ascii Content-Disposition: inline In-Reply-To: <76b7b70ef4b900b968b632e295ebb84fcbc986a5.1774623092.git.m.wieczorretman@pm.me> On Fri, Mar 27, 2026 at 03:10:58PM +0000, Maciej Wieczor-Retman wrote: > +static void verify_required_features(const struct cpuinfo_x86 *c) > +{ > + u32 required_features[NCAPINTS + 1] = REQUIRED_MASK_INIT; > + char cap_buf[X86_NAMELESS_FEAT_BUFLEN]; > + int i, error = 0; > + > + for_each_set_bit(i, (unsigned long *)required_features, NCAPINTS * 32) { > + if (test_bit(i, (unsigned long *)c->x86_capability)) This can be simplified to: if (test_cpu_cap(c, i)) > + continue; > + if (!error) > + pr_warn("CPU %d: missing required feature(s):", c->cpu_index); > + pr_cont(" %s", x86_feature_name(i, cap_buf)); > + error = 1; > + } > + > + if (!error) > + return; > + > + pr_cont("\n"); > + add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); > +}