Re: [RFC 00/15] x86_64: Optimize percpu accesses

From: H. Peter Anvin
Date: Wed Jul 09 2008 - 16:49:36 EST


Jeremy Fitzhardinge wrote:

No, you do it the same as i386. You set the segment base to be percpu_area-__per_cpu_start, and then just refer to %gs:per_cpu__foo directly. You can use rip-relative addressing to make it a smaller addressing mode too:

0: 65 89 05 00 00 00 00 mov %eax,%gs:0(%rip) # 0x7


Thinking about this some more, I don't know if it would make sense to put the x86-64 stack canary at the *end* of the percpu area, and otherwise use negative offsets. That would make sure they were readily reachable from %rip-based references from within the kernel text area.

-hpa
--
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/