Re: Named address spaces on x86 GNU/Linux

2021-08-02 Thread Richard Biener via Gcc
On Sat, Jul 31, 2021 at 9:34 PM Segher Boessenkool wrote: > > On Thu, Jul 29, 2021 at 04:08:36PM +, Joseph Myers wrote: > > On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote: > > > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid > > > dedicating a general-purpose register

Re: Named address spaces on x86 GNU/Linux

2021-07-31 Thread Segher Boessenkool
On Thu, Jul 29, 2021 at 04:08:36PM +, Joseph Myers wrote: > On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote: > > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid > > dedicating a general-purpose register to it. At address zero with the > > SEGFS prefix, the offset itself

Re: Named address spaces on x86 GNU/Linux

2021-07-30 Thread Richard Biener via Gcc
On Thu, Jul 29, 2021 at 6:09 PM Joseph Myers wrote: > > On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote: > > > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid > > dedicating a general-purpose register to it. At address zero with the > > SEGFS prefix, the offset itself is s

Re: Named address spaces on x86 GNU/Linux

2021-07-29 Thread Joseph Myers
On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote: > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid > dedicating a general-purpose register to it. At address zero with the > SEGFS prefix, the offset itself is stored so that userspace can read it > without having to call int

Named address spaces on x86 GNU/Linux

2021-07-29 Thread Florian Weimer via Gcc
The x86-64 architecture supports two instruction prefixes, SEGFS and SEGGS that apply an additional offset to memory operands. The offset lives in a special register that is accessible to the kernel only (historically). On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid dedicat