From: Andi Kleen <andi@firstfloor.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>,
peterz@infradead.org, x86@kernel.org,
linux-kernel@vger.kernel.org, eranian@google.com,
kan.liang@intel.com, isaku.yamahata@intel.com,
kvm@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH v1 1/2] x86/cpufeature: Add facility to match microcode revisions
Date: Sat, 6 Oct 2018 11:15:07 -0700 [thread overview]
Message-ID: <20181006181506.7cycnsg5gtoavtmx@two.firstfloor.org> (raw)
In-Reply-To: <alpine.DEB.2.21.1810061555270.5454@nanos.tec.linutronix.de>
On Sat, Oct 06, 2018 at 04:14:54PM +0200, Thomas Gleixner wrote:
> On Fri, 5 Oct 2018, Andi Kleen wrote:
> > +/*
> > + * Match specific microcodes or steppings.
>
> What means microcodes or steppings? If you mean microcode revisions then
> please spell it out and use it all over the place. steppings is confusing
> at best as its associated to the CPU stepping.
The matcher can be used to match specific hardware steppings by setting
the min/max_ucode to 0 or specific microcode revisions
(which are associated with steppings)
> > +const struct x86_ucode_id *x86_match_ucode_all(const struct x86_ucode_id *match)
>
> Can you please name that so it's obvious that this checks all cpus, but
> aside of that, why would a system ever end up with different microcode
> revisions at all? The changelog is not mentioning any reason for this
> function and "/* Check all CPUs */" is not helpful either.
We still support the old microcode interface that allows updates
per CPU, and also it could happen during CPU hotplug.
>
> > + int cpu;
> > + const struct x86_ucode_id *all_m = NULL;
> > + bool first = true;
> > +
> > + for_each_online_cpu(cpu) {
>
> What guarantees that CPUs cannot be plugged? You either need to have
> cpus_read_lock() in this function or a lockdep_assert_cpus_held().
In my case the caller, but yes should be documented.
-Andi
next prev parent reply other threads:[~2018-10-06 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-06 0:19 [PATCH v1 1/2] x86/cpufeature: Add facility to match microcode revisions Andi Kleen
2018-10-06 14:14 ` Thomas Gleixner
2018-10-06 16:10 ` Thomas Gleixner
2018-10-06 18:15 ` Andi Kleen [this message]
2018-10-06 18:39 ` Borislav Petkov
2018-10-07 5:32 ` Thomas Gleixner
[not found] ` <20181006001928.28097-2-andi@firstfloor.org>
2018-10-06 14:40 ` [PATCH v1 2/2] perf/x86/kvm: Avoid unnecessary work in guest filtering Thomas Gleixner
2018-10-06 16:13 ` Thomas Gleixner
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=20181006181506.7cycnsg5gtoavtmx@two.firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=isaku.yamahata@intel.com \
--cc=kan.liang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).