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 Mar 2010 00:47:11 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	eranian@...gle.com
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, paulus@...ba.org,
	davem@...emloft.net, fweisbec@...il.com, robert.richter@....com,
	perfmon2-devel@...ts.sf.net, eranian@...il.com
Subject: Re: [PATCH] perf_events: fix bug in AMD per-cpu initialization

On Wed, 2010-03-17 at 10:40 +0200, Stephane Eranian wrote:
> 	On AMD processors, we need to allocate a data structure per Northbridge
> 	to handle certain events.
> 
> 	On CPU initialization, we need to query the Northbridge id and check
> 	whether the structure is already allocated or not. We use the
> 	amd_get_nb_id() function to request the Northbridge identification.
> 
> 	The recent cleanup of the CPU online/offline initialization introduced
> 	a bug. AMD cpu initialization is invoked on CPU_UP_PREPARE callback.
> 	This is before the CPU Northbridge id is calculated. Therefore no
> 	processor had a Northbridge structure allocated except the boot
> 	processor. That was causing bogus NB event scheduling.
> 
> 	This patch uses the CPU_ONLINE callback to initialize the AMD
> 	Northbridge structure. This way amd_get_nb_id() returns valid
> 	information.
> 
> 	The x86_cpu_up() callback was added. Could not call it cpu_online
> 	because of existing macro.
> 
> 	Signed-off-by: Stephane Eranian <eranian@...gle.com>


No, ONLINE is not exposed for a good reason, its always wrong.

Use prepare to allocate data, and starting to initialize stuff on the
cpu proper once its up. Online is after the cpu is up and running and we
are already scheduling stuff on it so its too late to initialize things.

--
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