Messages in this thread | | | Date | Fri, 10 Apr 2015 13:46:07 -0700 | From | Andi Kleen <> | Subject | Re: [PATCH 7/8] x86: Add documentation for rd/wr fs/gs base |
| |
> If user code programs fs != 0 and fsbase != whatever is implied by fs > and the GDT/LDT, what happens?
We load the value from the LDT/GDT.
> There's already a minor buglet in that > area without wrfsbase, but fixing it would be a big performance hit > because we don't have rdfsbase and rdgsbase to read the state > efficiently. (Specifically, if we have gs == 0, gsbase == 0, but > *saved* gsbase != 0, then we corrupt gsbase on context switch.) > > But, with the new instructions, we can do it simply, efficiently, and > correctly in all cases. Let's do so.
We would need an instruction to write the index without changing the base. That's not what the new instructions do.
-Andi
-- ak@linux.intel.com -- Speaking for myself only
| |