Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752172AbdLARpE (ORCPT ); Fri, 1 Dec 2017 12:45:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:40646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbdLARpD (ORCPT ); Fri, 1 Dec 2017 12:45:03 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3D72219A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: AGs4zMZwxGwCaIw4yXvruqUwFKhFZ15NOQPaV6xBiPoSLeSsJ/H6kKsTJPVMFFwhtXRUhnIkcfAP9M+D5mxX6rubwfM= MIME-Version: 1.0 In-Reply-To: <305ed448-6f8e-eecd-d120-546efc185443@linux.intel.com> References: <20171127104529.12435-1-mingo@kernel.org> <20171127104529.12435-17-mingo@kernel.org> <305ed448-6f8e-eecd-d120-546efc185443@linux.intel.com> From: Andy Lutomirski Date: Fri, 1 Dec 2017 09:44:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 16/21] x86/entry/64: Use a per-CPU trampoline stack for IDT entries To: Dave Hansen Cc: Ingo Molnar , "linux-kernel@vger.kernel.org" , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , Borislav Petkov , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1461 Lines: 38 > On Dec 1, 2017, at 9:06 AM, Dave Hansen wrote: > >> On 11/27/2017 02:45 AM, Ingo Molnar wrote: >> --- a/arch/x86/kernel/cpu/common.c >> +++ b/arch/x86/kernel/cpu/common.c >> @@ -1645,11 +1645,13 @@ void cpu_init(void) >> setup_cpu_entry_area(cpu); >> >> /* >> - * Initialize the TSS. Don't bother initializing sp0, as the initial >> - * task never enters user mode. >> + * Initialize the TSS. sp0 points to the entry trampoline stack >> + * regardless of what task is running. >> */ >> set_tss_desc(cpu, &get_cpu_entry_area(cpu)->tss.x86_tss); >> load_TR_desc(); >> + load_sp0((unsigned long)&get_cpu_entry_area(cpu)->tss + >> + offsetofend(struct tss_struct, SYSENTER_stack)); >> >> load_mm_ldt(&init_mm); > > Does this also mean that our stack dumps will say "" in oopses? Only if we oops while we're on the trampoline stack. If the oops is due to a bug that isn't in the entry code, then we won't see it. > >> [ 30.811750] CR2: fffffffffdeb2f98 CR3: 0000000423fae001 CR4: 00000000001607e0 >> [ 30.819712] Call Trace: >> [ 30.822442] >> [ 30.825170] trace_hardirqs_on_thunk+0x1c/0x1c > ... >> [ 31.000571] R13: 0000000000000050 R14: 0000000000000076 R15: 00007f59f76f2d60 >> [ 31.008533] > > Should we change that string to something more descriptive? I suppose we could rename it to "ENTRY_TRAMPOLINE" or something like that.