[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABRcYmLcXosu62EbTMQNGCEa+mmNtRKCQX8oL=WDrgP-UH6B_g@mail.gmail.com>
Date: Fri, 7 Mar 2025 16:58:16 +0100
From: Florent Revest <revest@...omium.org>
To: Dave Hansen <dave.hansen@...el.com>
Cc: bp@...en8.de, linux-kernel@...r.kernel.org, tglx@...utronix.de,
mingo@...hat.com, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
stable@...r.kernel.org
Subject: Re: [PATCH] x86/microcode/AMD: Fix out-of-bounds on systems with
CPU-less NUMA nodes
On Fri, Mar 7, 2025 at 3:55 PM Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 3/7/25 05:12, Florent Revest wrote:
> > for_each_node(nid) {
> > - cpu = cpumask_first(cpumask_of_node(nid));
> > + mask = cpumask_of_node(nid);
> > + if (cpumask_empty(mask))
> > + continue;
> > +
> > + cpu = cpumask_first(mask);
>
> Would for_each_node_with_cpus() trim this down a bit?
Oh nice, I didn't notice this macro, thanks for pointing it out! :)
I'm happy to respin a v2 using for_each_node_with_cpus(), I'll just
leave a bit more time in case there are other comments.
One thing I'm not entirely sure about is that
for_each_node_with_cpus() is implemented on top of
for_each_online_node(). This differs from the current code which uses
for_each_node(). I can't tell if iterating over offline nodes is a bug
or a feature of load_microcode_amd() so this would be an extra change
to the business logic which I can't really explain/justify.
Powered by blists - more mailing lists