Re: [PATCH] 2.5.1-pre5: per-cpu areas

Andi Kleen (ak@suse.de)
14 Mar 2002 09:39:57 +0100


Rusty Russell <rusty@rustcorp.com.au> writes:

> In message <15504.7958.677592.908691@napali.hpl.hp.com> you write:
> > OK, I see this. Unfortunately, HIDE_RELOC() causes me problems
> > because it prevents me from taking the address of a per-CPU variable.
> > This is useful when you have a per-CPU structure (e.g., cpu_info).
> > Perhaps there should/could be a version of HIDE_RELOC() that doesn't
> > dereference the resulting address?
>
> Yep, valid point. Patch below: please play.

Please don't do that. I cannot easily take the address of a per CPU
variable on x86-64, or rather only with additional overhead. If you need the
address of one please use a different macro for that.

[on x86-64 per cpu data is referenced using a segment register, but
leaq %segreg:offset,%reg does not do the expected thing, it just loads
offset but doesn't add in the segment register base address. To get the
address I always need to fetch a pointer from the the per cpu data
that points to itself and work with that]

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