mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Richard Henderson <rth@twiddle.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] alpha: fix module load failures on smp (bug #10926)
Date: Mon, 23 Jun 2008 20:57:22 +0000	[thread overview]
Message-ID: <20080623205722.GA3580@ds20.borg.net> (raw)
In-Reply-To: <20080620232539.GA8061@jurassic.park.msu.ru>

On Sat, Jun 21, 2008 at 03:25:39AM +0400, Ivan Kokshaysky wrote:
> To calculate addresses of locally defined variables, GCC uses 32-bit
> displacement from the GP. Which doesn't work for per cpu variables in
> modules, as an offset to the kernel per cpu area is way above 4G.
> 
> The workaround is to force allocation of a GOT entry for per cpu variable
> using ldq instruction with a 'literal' relocation.
> I had to use custom asm/percpu.h, as a required argument magic doesn't
> work with asm-generic/percpu.h macros.
> 
> Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> ---
>  include/asm-alpha/percpu.h |   72 +++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 71 insertions(+), 1 deletions(-)


This causes a regression for my ev4 uniprocessor build:


  CC      arch/alpha/mm/init.o
/export/data/repositories/linux-2.6/arch/alpha/mm/init.c:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typeof’
make[2]: *** [arch/alpha/mm/init.o] Error 1
make[1]: *** [arch/alpha/mm] Error 2
make: *** [sub-make] Error 2


This patch fixes it for me (compile and boot tested):


diff --git a/include/asm-alpha/percpu.h b/include/asm-alpha/percpu.h
index 82e8a94..3495e8e 100644
--- a/include/asm-alpha/percpu.h
+++ b/include/asm-alpha/percpu.h
@@ -69,6 +69,8 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 #define __get_cpu_var(var)		per_cpu_var(var)
 #define __raw_get_cpu_var(var)		per_cpu_var(var)
 
+#define PER_CPU_ATTRIBUTES
+
 #endif /* SMP */
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu_var(name)


Signed-off-by: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>

Thorsten.

-- 
| Thorsten Kranzkowski        Internet: dl8bcu@dl8bcu.de                      |
| Mobile: ++49 170 1876134       Snail: Kiebitzstr. 14, 49324 Melle, Germany  |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |

  reply	other threads:[~2008-06-23 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 23:25 Ivan Kokshaysky
2008-06-23 20:57 ` Thorsten Kranzkowski [this message]
2008-06-23 23:53   ` Ivan Kokshaysky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080623205722.GA3580@ds20.borg.net \
    --to=dl8bcu@dl8bcu.de \
    --cc=akpm@linux-foundation.org \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®