lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 2/2] x86, cpu, amd: Add a per-vendor BSP function
On Mon, Aug 08, 2011 at 03:56:08PM -0500, H. Peter Anvin wrote:
> On 08/08/2011 01:57 PM, Borislav Petkov wrote:
> > From: Borislav Petkov <borislav.petkov@amd.com>
> >
> > Add a per-vendor function which runs everything that needs to run once
> > on the BSP during boot. Concentrate AMD-specific functionality there.
> >
> > Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
> >
> > +static void __init vendor_run_on_bsp(struct cpuinfo_x86 *c)
> > +{
> > + switch (c->x86_vendor) {
> > + case X86_VENDOR_AMD:
> > + amd_run_on_bsp(c);
> > + break;
> > +
> > + default:
> > + break;
> > + }
> > +}
> > +
>
> This is totally going backwards. We *should* be using struct cpu_dev
> rather than switch statements for this.

Right, but all the cpu_dev things are annotated with __cpuinitconst
because they're used in CONFIG_HOTPLUG_CPU. __init, OTOH, will be
discarded once we're done booting. So, we can't convert cpu_dev
to __initdata because we need it for cpu hotplug and we want the
run_on_bsp() functionality to be __init since it runs once on boot.

Maybe leave cpu_dev in __cpuinit let it have an __init member which is
the ->run_on_bsp()? Does that even work?

Hmm..

--
Regards/Gruss,
Boris.


\
 
 \ /
  Last update: 2011-08-08 23:59    [from the cache]
©2003-2011 Jasper Spaans