Re: [RFC 1/2] x86/entry/64: Use the TSS sp2 slot for rsp_scratch

2018-07-23 Thread Andy Lutomirski
On Mon, Jul 23, 2018 at 5:38 AM, Dave Hansen wrote: > On 07/22/2018 10:45 AM, Andy Lutomirski wrote: >> + /* >> + * sp2 is scratch space used by the SYSCALL64 handler. Linux does >> + * not use rung 2, so sp2 is not otherwise needed. >> + */ >> u64 sp2

Re: [RFC 1/2] x86/entry/64: Use the TSS sp2 slot for rsp_scratch

2018-07-23 Thread Dave Hansen
On 07/22/2018 10:45 AM, Andy Lutomirski wrote: > + /* > + * sp2 is scratch space used by the SYSCALL64 handler. Linux does > + * not use rung 2, so sp2 is not otherwise needed. > + */ > u64 sp2; Could we call out the actual thing that we use this slot

Re: [RFC 1/2] x86/entry/64: Use the TSS sp2 slot for rsp_scratch

2018-07-22 Thread Ingo Molnar
* Andy Lutomirski wrote: > In the non-trampoline SYSCALL64 path, we use a percpu variable to > temporarily store the user RSP value. Instead of a separate > variable, use the otherwise unused sp2 slot in the TSS. This will > improve cache locality, as the sp1 slot is already used in the same

[RFC 1/2] x86/entry/64: Use the TSS sp2 slot for rsp_scratch

2018-07-22 Thread Andy Lutomirski
In the non-trampoline SYSCALL64 path, we use a percpu variable to temporarily store the user RSP value. Instead of a separate variable, use the otherwise unused sp2 slot in the TSS. This will improve cache locality, as the sp1 slot is already used in the same code to find the kernel stack. It wi