lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Nov 2010 14:39:40 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Andi Kleen <andi@...stfloor.org>, a.p.zijlstra@...llo.nl,
	eranian@...gle.com, linux-kernel@...r.kernel.org, x86@...nel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/4] x86: set cpu masks before calling CPU_STARTING
 notifiers

On Thu, Nov 18, 2010 at 12:52:33PM +0100, Thomas Gleixner wrote:
> On Thu, 18 Nov 2010, Andi Kleen wrote:
> 
> > From: Andi Kleen <ak@...ux.intel.com>
> > 
> > When booting up a CPU set the various topology masks before
> > calling the CPU_STARTING notifier. This way the notifier
> > can actually use the masks.
> > 
> > This is needed for a perf change.
> > 
> > Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> > ---
> >  arch/x86/kernel/smpboot.c |    8 ++++----
> >  1 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> > index 083e99d..9d2980e 100644
> > --- a/arch/x86/kernel/smpboot.c
> > +++ b/arch/x86/kernel/smpboot.c
> > @@ -281,6 +281,10 @@ static void __cpuinit smp_callin(void)
> >  	 */
> >  	smp_store_cpu_info(cpuid);
> >  
> > +	/* This must be done before setting cpu_online_mask */
> 
> Can we please fix up that comment to match that change ?

Here's an updated patch.

x86: set cpu masks before calling CPU_STARTING notifiers
    
When booting up a CPU set the various topology masks before
calling the CPU_STARTING notifier. This way the notifier
can actually use the masks.
    
This is needed for a perf change.
    
Signed-off-by: Andi Kleen <ak@...ux.intel.com>

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 083e99d..c019c03 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -281,6 +281,13 @@ static void __cpuinit smp_callin(void)
 	 */
 	smp_store_cpu_info(cpuid);
 
+	/* 
+	 * This must be done before setting cpu_online_mask
+	 * or calling notify_cpu_starting.
+	 */
+	set_cpu_sibling_map(raw_smp_processor_id());
+	wmb();
+
 	notify_cpu_starting(cpuid);
 
 	/*
@@ -322,10 +329,6 @@ notrace static void __cpuinit start_secondary(void *unused)
 		legacy_pic->unmask(0);
 	}
 
-	/* This must be done before setting cpu_online_mask */
-	set_cpu_sibling_map(raw_smp_processor_id());
-	wmb();
-
 	/*
 	 * We need to hold call_lock, so there is no inconsistency
 	 * between the time smp_call_function() determines number of
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ