Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp941883imu; Fri, 7 Dec 2018 11:19:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/Va/KIOBZdHBrX2Drf/ABlkw8VQj9oRBVuJKEzSg9bc8XKDt88QWZIA42TV+dkFnG7YHvL3 X-Received: by 2002:a17:902:bd4a:: with SMTP id b10mr3303277plx.232.1544210394644; Fri, 07 Dec 2018 11:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544210394; cv=none; d=google.com; s=arc-20160816; b=eBI+J1rmDbcaht+M1VxnzAAsxx+6uhagiB4cy5HDuSy0lbRv1xzr8o2lb1FNMOSWc2 7Xks1ZEJb6FM3xJiwoEMNgyZIGguEkc9I3mtwTkt1uqf1locAoG4ws5oocr9+pSw/WVe RspQvD9H20fE+5d1LA5cFqwCJrhYlNukxphLqLr7CASkgrVU2RWrA8BKDoTv4tiHWqXT CVldIMPfundPalJhhSGYWL3qr6wbLKAyPUZeSmDRTUE1p3tgf4RcA+9uK4L/++lF3mKB 0JHM12eQz4Rn7/TC91J4MtBnYbbw5jbIdcD/B4bgYADj5o3FAgIIZq3gkP5b9/5zkxxB njEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=k+LQD8EQYHdZurNTX1vVPZCwmWKHL01XD0MyvCGbMQ0=; b=LGD0Q4qe7lWAYPw74NDZIagcvLWQgtR00XK9VnuA7kE2kXU6LpaaVpn5gsnsCw7zcb 0JGTHtViq7lU/yKEVxhOi2Oe7tqdn0B0iVA17IbDlfzaGnlTj1+3/Z27w1IUPmrTO0om Vz2BkSmo9T4pS8bUsKLKV+prCoC9GpR8yCerEU92H/jjZa9sief1xsJuAEmE+qlFag3b ksyM1+0WoYd5Rr8LlE1gQAOb0i9G0wVJtA/oeNQvfG1oPbP1KfyRrC6EBFCcqGbkmEBC tblkLL4LGLYmni9ECCKwKqpMpFKrYwwZ4xbFlaLJJ2lttFzz8uo98U4kEHt+rgp+9v0L WukA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90si3592959plb.17.2018.12.07.11.19.33; Fri, 07 Dec 2018 11:19:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726084AbeLGTSt (ORCPT + 99 others); Fri, 7 Dec 2018 14:18:49 -0500 Received: from mga18.intel.com ([134.134.136.126]:8254 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbeLGTSt (ORCPT ); Fri, 7 Dec 2018 14:18:49 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2018 11:18:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,327,1539673200"; d="scan'208";a="107845816" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by fmsmga008.fm.intel.com with ESMTP; 07 Dec 2018 11:18:48 -0800 Date: Fri, 7 Dec 2018 11:18:48 -0800 From: Sean Christopherson To: Linus Torvalds Cc: dave.hansen@linux.intel.com, Andrew Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , bp@alien8.de, the arch/x86 maintainers , Peter Anvin , Linux List Kernel Mailing , Rik van Riel , yu-cheng.yu@intel.com, Ingo Molnar Subject: Re: [PATCH] x86/fault: Decode and print #PF oops in human readable form Message-ID: <20181207191848.GD10404@linux.intel.com> References: <20181207184423.1962-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 07, 2018 at 10:52:49AM -0800, Linus Torvalds wrote: > On Fri, Dec 7, 2018 at 10:44 AM Sean Christopherson > wrote: > > > > Remove the per-bit decoding of the error code and instead print the raw > > error code followed by a brief description of what caused the fault, the > > effective privilege level of the faulting access, and whether the fault > > originated in user code or kernel code. > > This doesn't quite work as-is, though. > > For example, at least the PK bit is independent of the other bits and > would be interesting in the human-legible version, but doesn't show up > there at all. Heh, I actually intentionally omitted protection keys thinking it'd be superfluous, i.e. "go look at the error code bits if you care that much". > That said, I think the end result might be more legible than the > previous version, so this approach may well be good, it just needs at > least that "permissions violation" part to be extended with whether > it was PK or not. > > Also, shouldn't we show the SGX bit too as some kind of "during SGX" > extension on the "in user/kernel space" part? The SGX bit isn't defined in mainline yet. But yeah, I can see how printing e.g. "SGX EPCM violation" would be a lot more helpful than a vanilla "permissions violation". I'll send a v2 with the PK bit added and a slightly reworded changelog.