Re: s390(64) per_cpu in modules (ipv6)

From: Rusty Russell
Date: Thu Oct 14 2004 - 20:42:42 EST


On Wed, 2004-06-30 at 16:35, Pete Zaitcev wrote:
> Hi, Martin,
>
> I tried to build ipv6 as a module in 2.6.7, and it bombs, producing a
> module which wants per_cpu____icmpv6_socket (obviously, undefined).
>
> The problem appears to be caused by this:
>
> #define __get_got_cpu_var(var,offset) \
> (*({ unsigned long *__ptr; \
> asm ( "larl %0,per_cpu__"#var"@GOTENT" : "=a" (__ptr) ); \
> ((typeof(&per_cpu__##var))((*__ptr) + offset)); \
> }))


Heh, I ran into the same problem trying to do this trick for PPC64. You
really need to use __thread and make GCC do the work, AFAICT.

The worse problem is that a (static) per-cpu var declared *inside* a
function gets renamed by gcc; IIRC some generic code used to do this.

Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/