From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755396Ab0C3DgU (ORCPT ); Mon, 29 Mar 2010 23:36:20 -0400 Received: from mail.openrapids.net ([64.15.138.104]:52115 "EHLO blackscsi.openrapids.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751666Ab0C3DgS (ORCPT ); Mon, 29 Mar 2010 23:36:18 -0400 Date: Mon, 29 Mar 2010 23:36:17 -0400 From: Mathieu Desnoyers To: linux-kernel@vger.kernel.org, stable Cc: Randy Dunlap , Eric Dumazet , Rusty Russell , Peter Zijlstra , Tejun Heo , Ingo Molnar , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Steven Rostedt Subject: Re: [PATCH] modules fix incorrect percpu usage Message-ID: <20100330033617.GE7683@Krystal> References: <20100330033211.GC7683@Krystal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100330033211.GC7683@Krystal> X-Editor: vi X-Info: http://www.efficios.com X-Operating-System: Linux/2.6.26-2-686 (i686) X-Uptime: 23:34:33 up 66 days, 6:11, 4 users, load average: 0.09, 0.12, 0.04 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers (mathieu.desnoyers@efficios.com) wrote: > Should use per_cpu_ptr() to obfuscate the per cpu pointers (RELOC_HIDE is needed > for per cpu pointers). > > Introduced by commit: > > module.c: commit 6b588c18f8dacfa6d7957c33c5ff832096e752d3 > > This patch should be queued for the stable branch, for kernels 2.6.29.x to > 2.6.33.x. > (tested on 2.6.33.1 x86_64) It's actually needed for mainline too (2.6.34-rc2). Thanks, Mathieu > > Signed-off-by: Mathieu Desnoyers > CC: Randy Dunlap > CC: Eric Dumazet > CC: Rusty Russell > CC: Peter Zijlstra > CC: Tejun Heo > CC: Ingo Molnar > CC: Andrew Morton > CC: Linus Torvalds > CC: Greg Kroah-Hartman > CC: Steven Rostedt > CC: stable > --- > kernel/module.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-2.6-lttng/kernel/module.c > =================================================================== > --- linux-2.6-lttng.orig/kernel/module.c 2010-03-29 23:47:05.000000000 -0400 > +++ linux-2.6-lttng/kernel/module.c 2010-03-29 23:47:27.000000000 -0400 > @@ -412,7 +412,7 @@ static void percpu_modcopy(void *pcpudes > int cpu; > > for_each_possible_cpu(cpu) > - memcpy(pcpudest + per_cpu_offset(cpu), from, size); > + memcpy(per_cpu_ptr(pcpudest, cpu), from, size); > } > > #else /* ... !CONFIG_SMP */ > > -- > Mathieu Desnoyers > Operating System Efficiency R&D Consultant > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com