Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-25 Thread Andi Kleen
>So on user space to kernel space transitions swapping in kernel GS should >simply do: > userGS = RDGSBASE() > WRGSBASE(kernelGS) This would also need to find kernelGS first, by doing RDPID and then reading it from memory in the right index (which might be a full cache miss if y

Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-25 Thread Thomas Gleixner
On Mon, 25 Mar 2019, Thomas Gleixner wrote: > On Mon, 25 Mar 2019, Thomas Gleixner wrote: > > The whole point of FSGSBASE support is performance, right? > > > > So can please someone explain why having the following in the context > > switch path when it can be completely avoided is enhancing per

Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-25 Thread Thomas Gleixner
On Mon, 25 Mar 2019, Thomas Gleixner wrote: > The whole point of FSGSBASE support is performance, right? > > So can please someone explain why having the following in the context > switch path when it can be completely avoided is enhancing performance: > > - 4 x SWAPGS > - 1 x RDMSR > - 1 x

Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-25 Thread Thomas Gleixner
On Fri, 15 Mar 2019, Chang S. Bae wrote: > The helper functions will switch on faster accesses to FSBASE and GSBASE > when the FSGSBASE feature is enabled. > > Accessing user GSBASE needs a couple of SWAPGS operations. It is avoidable > if the user GSBASE is saved at kernel entry, being updated a

[RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-15 Thread Chang S. Bae
The helper functions will switch on faster accesses to FSBASE and GSBASE when the FSGSBASE feature is enabled. Accessing user GSBASE needs a couple of SWAPGS operations. It is avoidable if the user GSBASE is saved at kernel entry, being updated as changes, and restored back at kernel exit. However