Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965028AbeAKRDS (ORCPT + 1 other); Thu, 11 Jan 2018 12:03:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:42232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932773AbeAKRDQ (ORCPT ); Thu, 11 Jan 2018 12:03:16 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AF412175A 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: ACJfBovcZtDl3zae+53aFE3PmiAiNixsKeBPQBFLB0SNNfccDjYRJRBk4nPqRGum31r1k0ytlsJu2NIOJUch0xqvpAw= MIME-Version: 1.0 In-Reply-To: References: <1515502580-12261-1-git-send-email-w@1wt.eu> <1515502580-12261-7-git-send-email-w@1wt.eu> <20180110082207.GX29822@worktop.programming.kicks-ass.net> <20180110091102.GH14066@1wt.eu> <20180111064259.GC14920@1wt.eu> <0f08d89e-61e1-20e3-5c59-0b2f7b32bf0c@linux.intel.com> <20180111154412.GA15296@1wt.eu> From: Andy Lutomirski Date: Thu, 11 Jan 2018 09:02:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set To: Dave Hansen Cc: Willy Tarreau , Linus Torvalds , Andy Lutomirski , Peter Zijlstra , LKML , X86 ML , Borislav Petkov , Brian Gerst , Ingo Molnar , Thomas Gleixner , Josh Poimboeuf , "H. Peter Anvin" , Greg Kroah-Hartman , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 7:51 AM, Dave Hansen wrote: > On 01/11/2018 07:44 AM, Willy Tarreau wrote: >>> I think we also need to be able to dump the actual >>> CR3 value that we entered the kernel with before we start doing too much >>> other funky stuff with the entry code. >> When you say dump, you mean save it somewhere in a per_cpu variable ? > > Yeah, I think a per-cpu variable is fine for now. But, that only gives > you a dump from a single entry to the kernel. Ideally, it would be nice > to have a stack of them so you could do things like debug > syscall->fault->oops. Was it the syscall entry or the fault entry that > lead to the oops? > > But, the stack gets really fun because of NMIs. > > I'm sure Andy Lutomirski has some ideas too. I was thinking that maybe we should add a new field or two to pt_regs. They could store CR2 and maybe CR3 as well. I'd also like to expose the error code of exceptions in stack traces. We should get this integrated right into the unwinder.