Messages in this thread | | | From | Brian Gerst <> | Date | Mon, 5 Feb 2018 13:47:28 -0500 | Subject | Re: [PATCH 1/3] x86/entry: Clear extra registers beyond syscall arguments for 64bit kernels |
| |
On Mon, Feb 5, 2018 at 1:29 PM, Ingo Molnar <mingo@kernel.org> wrote: > > * Andy Lutomirski <luto@kernel.org> wrote: > >> [...] Clearing R10 is mostly useless in the syscall path because we'll just >> unconditionally reload it in do_syscall_64(). > > AFAICS do_syscall_64() doesn't touch R10 at all. So how does it reload R10? > > In fact do_syscall_64() as a C function does not touch R10, R11, R12, R13, R14, > R15 - it passes their values through. > > What am I missing?
The syscall ABI uses R10 for the 4th argument instead of RCX, because RCX gets clobbered by the SYSCALL instruction for RIP.
-- Brian Gerst
| |