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] [day] [month] [year] [list]
Date:	Sun, 05 Sep 2010 11:20:45 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Brian Gerst <brgerst@...il.com>
CC:	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86, percpu: Optimize this_cpu_ptr

Hello,

On 09/04/2010 07:21 PM, Brian Gerst wrote:
> diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
> index cd28f9a..d854438 100644
> --- a/arch/x86/include/asm/percpu.h
> +++ b/arch/x86/include/asm/percpu.h
> @@ -47,6 +47,15 @@
>  #ifdef CONFIG_SMP
>  #define __percpu_arg(x)		"%%"__stringify(__percpu_seg)":%P" #x
>  #define __my_cpu_offset		percpu_read(this_cpu_off)
> +#define __this_cpu_ptr(ptr)				\
> +({							\
> +	typeof(ptr) __ptr = (ptr);			\
> +	__verify_pcpu_ptr(ptr);				\
> +	asm volatile("add " __percpu_arg(1) ", %0"	\
> +		     : "+r" (__ptr)			\
> +		     : "m" (this_cpu_off));		\
> +	__ptr;						\
> +}) 

Great, thanks for doing this, but can you please comment on what
__this_cpu_ptr() optimizes above?  Something similar to the patch
description but shorter.

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