Zachary Amsden wrote:
I believe 9,10,11 are reserved for future users like yourself or
expanded TLS segments. I think a bank of 3 TLS segments in the
GDT is working fine now (does NPTL even use more than one?).
Nope. And there's a comment that wine uses one more. I think
the third is completely unused.
Otherwise line 1 would be ideal for putting 3 TLS, kernel+user
code+data and PDA into, thereby making 99.999% of GDT descriptor
uses come from one cache line.
That change is visible to userspace, unfortunately.
Don't think it matters much. 32-bit processes on x86-64 seem
perfectly happy with the TLS being in a different place.
I think the ABI is defined in terms of "use the selector for
the entry that set_thread_area/clone returns", and so is not
a constant. But I agree it would be better not to.
Hm, moving user cs/ds would be pretty visible too... Hm, and
it would have a greater chance of breaking stuff if they changed,
compared to moving the TLS...