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]
Message-ID: <00000140c6a99df3-87c7c3c3-944c-4559-a8de-b7b220f1bc37-000000@email.amazonses.com>
Date:	Wed, 28 Aug 2013 20:42:19 +0000
From:	Christoph Lameter <cl@...ux.com>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
cc:	Tejun Heo <tj@...nel.org>, akpm@...uxfoundation.org,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>, linux-arch@...r.kernel.org,
	Steven Rostedt <srostedt@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [gcv v3 27/35] arm: Replace __get_cpu_var uses

On Wed, 28 Aug 2013, Russell King - ARM Linux wrote:

> On Wed, Aug 28, 2013 at 07:48:23PM +0000, Christoph Lameter wrote:
> > 3. Retrieve the content of the current processors instance of a per cpu variable.
> >
> > 	DEFINE_PER_CPU(int, u);
>
> Shouldn't this be 'y' ?

Right.

> > 	memcpy(this_cpu_ptr(&x), y, sizeof(x));
>
> Are you sure this one's correct?  Isn't 'y' the per-cpu variable?

Also true. Already fixed this once. Sigh.

Description patch:


--- this_x86	2013-08-28 15:35:48.933416126 -0500
+++ patches/this_x86	2013-08-28 15:41:14.386260894 -0500
@@ -26,12 +26,12 @@


 This patch converts __get_cpu_var into either an explicit address calculation using this_cpu_ptr()
-or into a use of this_cpu operations that use the offset. Thereby address calcualtions are avoided
+or into a use of this_cpu operations that use the offset. Thereby address calculations are avoided
 and less registers are used when code is generated.

-At the end of the patchset all uses of __get_cpu_var have been removed so the macro is removed too.
+At the end of the patch set all uses of __get_cpu_var have been removed so the macro is removed too.

-The patchset includes passes over all arches as well. Once these operations are used throughout then
+The patch set includes passes over all arches as well. Once these operations are used throughout then
 specialized macros can be defined in non -x86 arches as well in order to optimize per cpu access by
 f.e. using a global register that may be set to the per cpu base.

@@ -63,7 +63,7 @@

 3. Retrieve the content of the current processors instance of a per cpu variable.

-	DEFINE_PER_CPU(int, u);
+	DEFINE_PER_CPU(int, y);
 	int x = __get_cpu_var(y)

    Converts to
@@ -78,7 +78,7 @@

    Converts to

-	memcpy(this_cpu_ptr(&x), y, sizeof(x));
+	memcpy(&x, this_cpu_ptr(&y), sizeof(x));


 5. Assignment to a per cpu variable
--
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