Re: [PATCH 11/43] x86/entry/64: Separate cpu_current_top_of_stack from TSS.sp0

From: Borislav Petkov
Date: Fri Nov 24 2017 - 09:19:15 EST


On Fri, Nov 24, 2017 at 10:14:16AM +0100, Ingo Molnar wrote:
> From: Andy Lutomirski <luto@xxxxxxxxxx>
>
> On 64-bit kernels, we used to assume that TSS.sp0 was the current
> top of stack. With the addition of an entry trampoline, this will
> no longer be the case. Store the current top of stack in TSS.sp1,
> which is otherwise unused but shares the same cacheline.
>
> Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx>
> Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Borislav Petkov <bpetkov@xxxxxxx>
> Cc: Brian Gerst <brgerst@xxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxx>
> Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
> Cc: H. Peter Anvin <hpa@xxxxxxxxx>
> Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Link: http://lkml.kernel.org/r/f56634c746a2926eb7bae61e7b80ed51a1940769.1511497875.git.luto@xxxxxxxxxx
> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
> ---
> arch/x86/include/asm/processor.h | 18 +++++++++++++-----
> arch/x86/include/asm/thread_info.h | 2 +-
> arch/x86/kernel/asm-offsets_64.c | 1 +
> arch/x86/kernel/process.c | 10 ++++++++++
> arch/x86/kernel/process_64.c | 1 +
> 5 files changed, 26 insertions(+), 6 deletions(-)

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.