From: Ingo Molnar <mingo@kernel.org>
To: Sohil Mehta <sohil.mehta@intel.com>
Cc: x86@kernel.org, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>,
Uros Bizjak <ubizjak@gmail.com>,
Sandipan Das <sandipan.das@amd.com>,
Sean Christopherson <seanjc@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Vegard Nossum <vegard.nossum@oracle.com>,
Tony Luck <tony.luck@intel.com>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Nikolay Borisov <nik.borisov@suse.com>,
Eric Biggers <ebiggers@google.com>, Xin Li <xin3.li@intel.com>,
Alexander Shishkin <alexander.shishkin@intel.com>,
Kirill Shutemov <kirill.shutemov@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] x86/cpufeature: Add feature dependency checks
Date: Thu, 27 Feb 2025 21:17:48 +0100 [thread overview]
Message-ID: <Z8DIbMcUWEQYlL5w@gmail.com> (raw)
In-Reply-To: <8b174f56-191b-45bd-93ec-4c6444c770a5@intel.com>
* Sohil Mehta <sohil.mehta@intel.com> wrote:
> On 2/27/2025 10:46 AM, Ingo Molnar wrote:
>
> >> +void filter_feature_dependencies(struct cpuinfo_x86 *c)
> >> +{
> >> + char feature_buf[16], depends_buf[16];
> >> + const struct cpuid_dep *d;
> >> +
> >> + for (d = cpuid_deps; d->feature; d++) {
> >> + if (cpu_has(c, d->feature) && !cpu_has(c, d->depends)) {
> >> + pr_info("CPU%d: Disabling feature %s due to missing feature %s\n",
> >> + smp_processor_id(),
> >> + x86_feature_name(d->feature, feature_buf),
> >> + x86_feature_name(d->depends, depends_buf));
> >> + do_clear_cpu_cap(c, d->feature);
> >> + }
> >> + }
> >
> > So let's not disable any CPU features actively for the time being, how
> > about issuing a pr_warn() only about the dependency violation?
> >
> > I think the main problem is when these problems slip through 100%
> > unnoticed.
> >
>
> I guess you are right. Highlighting the issue is the main part. Beyond
> that we can leave the system behavior as-is for now.
>
> Most of the listed dependencies seem to be spec-driven, though the
> kernel might create arbitrary dependencies for security reasons such as
> making LAM depend on LASS[1]. I think those can probably be handled on a
> case by case basis during specific feature enabling.
>
> For the new pr_warn(), I am considering printing it only once per
> feature instead of printing it on every CPU (which could be 100s).
Yeah.
> But that would mean tracking it in a global feature_warn bitmap.
>
> DECLARE_BITMAP(feature_warn, MAX_FEATURE_BITS);
>
> Another option would be run the scan only on the BSP. But that could
> cause some issues to be missed[2].
Just use pr_warn_once().
Yes, this might cause subsequent CPU feature dependency problems to
stay unreported, but the hope here is that these are rare and get
fixed, right?
Thanks,
Ingo
prev parent reply other threads:[~2025-02-27 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 22:40 [PATCH v4] x86/cpufeature: Add feature dependency checks Sohil Mehta
2025-02-27 18:46 ` Ingo Molnar
2025-02-27 20:14 ` Sohil Mehta
2025-02-27 20:17 ` Ingo Molnar [this message]
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=Z8DIbMcUWEQYlL5w@gmail.com \
--to=mingo@kernel.org \
--cc=alexander.shishkin@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=ebiggers@google.com \
--cc=hpa@zytor.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=sandipan.das@amd.com \
--cc=seanjc@google.com \
--cc=sohil.mehta@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=ubizjak@gmail.com \
--cc=vegard.nossum@oracle.com \
--cc=x86@kernel.org \
--cc=xin3.li@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.