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: <4B0D4941.5010904@kernel.org>
Date:	Thu, 26 Nov 2009 00:12:01 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Stephen Rothwell <sfr@...b.auug.org.au>,
	Fr??d??ric Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: linux-next: percpu tree build warning

Hello,

11/25/2009 10:40 PM, Ingo Molnar wrote:
> And look at your own 'cleanup' patch - it changes the percpu name to 
> 'cpu_dr7'. That results in nonsensical repetition:
> 
>         dr7 = &__get_cpu_var(cpu_dr7);

My whole argument can be compressed into "don't name a global symbol
dr7, no matter what it is".

The key problem is the artificial difference between static and
dynamic percpu variable accessors.  The old way of prefixing from
accessors only works for symbol literals, so either we need another
identical set for dynamic ones without auto-prefixing or we end up
doing the repetition you mentioned above in much uglier way.

Option 1:

	this_cpu_static_OP(dr7, ARG);
	this_cpu_dynamic_OP(*allocated_ptr, ARG);
	this_cpu_dynamic_OP(per_cpu_var(dr7), ARG);

Options 2:

	this_cpu_OP(per_cpu_var(dr7), ARG);

BTW, option 2 is what we've been doing before the change.  It's just
ugly and the prefix no longer provides much protection because users
outside of percpu code have to use per_cpu_var() which never was
supposed to go outside of percpu internal code.  All it ends up doing
is providing false sense of address space isolation when there is
none.

DEFINE_*(NAME) defines a global symbol NAME in all other definition
macros.  DEFINE_PER_CPU() does so too.

Thanks.

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