Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10945367imu; Thu, 6 Dec 2018 09:06:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/WfXqg6Xr5XRpGcOHVHuVsz7G2YOF1WXtmz6PYtzEcKnJmUtL1P+usSyipN7gbs5miT5Cj4 X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr28978870plb.185.1544116018372; Thu, 06 Dec 2018 09:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544116018; cv=none; d=google.com; s=arc-20160816; b=aYf0xRtldMEut3qM0xkQX4sQHfegSUweSSCQR9g4uUMxafLEvWHsA3+ycfx3JTWbGz ZCby7LYk7nVyoEe1IECauNkN9Rq4XlF4KHfYZOswpc/mS8Sy2qykzwbVsYJCe8KlISik R47MPKHp+cSO9Sn3/KjInkYy9Pxv1yn3+abutP7E/kQNCKgmmOxAhQQIZdEdeX4gwLFy UTtLlBg9mJ6p7IQJ0czy/3SvUX9sezMY/XIILfY3oQeACjGxXtcQ1LN+Ww7ruFy/WuQz LtDEkUkVqxGQzsrkMgb2ucI4rlxGJu46w9vvi6lMgEshCLHMvuxfIlsfywPr5Vtjb4cF E0dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=2FQODlx/+za2IJ+ANYDZzpAr4YJCtUpRaUeAJ5ficmE=; b=EthlQ7RShMlgElaPpHuEpDm6n2sm71MHJAsl1sLrhOuurxTuQuYGy252kvt7p9nfIf uoGvQ3bAZ8827ksEbeqsW9fAhM5DSEmE/Kgvs1BOf0uuhEbWvvb9M+qp3FUmUmDQ0jho 7f9SShhfi4707Hz316KirKzXAySfKmRlhPicl6Rz3D0GGSDdjcZ6c6imKooIO6fWqU4C wh+eWgpvVU7FdQMl7wDcoAfmUP5d/7RaqA5pfBvWtgMrfhoCUwR1W1AnKfK2QNAoj2D4 puswo5Sqeu7u5IK34ocoHNXLvuieDfWhInJnQuo8rBf35LLXP09IPRubom+9WwiZGEbx rDBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=I8zayfC6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4si669038pli.432.2018.12.06.09.06.27; Thu, 06 Dec 2018 09:06:58 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=I8zayfC6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbeLFRFO (ORCPT + 99 others); Thu, 6 Dec 2018 12:05:14 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39175 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725898AbeLFRFO (ORCPT ); Thu, 6 Dec 2018 12:05:14 -0500 Received: by mail-pg1-f196.google.com with SMTP id w6so411877pgl.6 for ; Thu, 06 Dec 2018 09:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2FQODlx/+za2IJ+ANYDZzpAr4YJCtUpRaUeAJ5ficmE=; b=I8zayfC6xQhvnZ83zkFbRvIHiolnniDro62ldWZ7OsJSejXCCN6vVRbfgSK6jokR/K 3HA5h4HuYSgn4VZT3AmQpa+Nl3XyXzGwlXEASylbFD3zyzSAT2yAbnqsjxzWyG4KiT50 BJicPJHjumIJNoY7KjQdEq1nsolOAtMJ3/n7usdS47Et6JalHw14kjEI2fJUoBjjBrE+ oWpYkjfwoX4wNgoa501IgoKYEeDUe3uOuFk+o3fSBZIQwvkDBm2oetvyBha7TxGEm9GG fbFns6KvXnhvt/XyrqbyiV6EvHNh9IJTs0GSUOfX6WQTtjT/fro1iiJGFsRWBoerGRn1 M+4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2FQODlx/+za2IJ+ANYDZzpAr4YJCtUpRaUeAJ5ficmE=; b=RmsMD7ywqZzUDPgXohfwdpPK+V4eI3nBwI0j9jM93pshvTJj7fXGhANXSRQZrlseKa CAW9zLumBb1ZSMXgstgIs8dR0jYTDuXdMOiLx/5jc6c6v/5b67XLmKMMBxIFqTjHnSuV PbcOmFB13EOw43i3Tpf9GnZZ/igksFytvr9C/LLfjFcFJ/4CPxHcVEUm5cliW2kKtNll P1DGhYPy5MXH7u3/mfFTk0ovrOpWSezGloXMTWW3SUBRqYsm1av+iTanqFNrcoQSxQPe MqqJHi03Bgf3p9cK7GdgTVbIAO8V4iNppwPyXLBcJJHEvtY79bo/BphtZNRuck/TtSiN UyPA== X-Gm-Message-State: AA+aEWYiNWFF3EbaUo7DOkKkWoIlgx6olG5HRsr62XzGq8peCfM1cOuO OjBJeHUtObNVoI+Mos2g16rgkg== X-Received: by 2002:a63:20e:: with SMTP id 14mr24682467pgc.161.1544115913545; Thu, 06 Dec 2018 09:05:13 -0800 (PST) Received: from ?IPv6:2600:1010:b02e:9276:9150:d817:51ad:68a1? ([2600:1010:b02e:9276:9150:d817:51ad:68a1]) by smtp.gmail.com with ESMTPSA id r76sm1330074pfb.69.2018.12.06.09.05.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 09:05:12 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder some more From: Andy Lutomirski X-Mailer: iPhone Mail (16B92) In-Reply-To: <20181206164710.GA119529@gmail.com> Date: Thu, 6 Dec 2018 09:05:11 -0800 Cc: Sean Christopherson , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Linus Torvalds , Rik van Riel , Yu-cheng Yu Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181205163624.1842-1-sean.j.christopherson@intel.com> <20181206073409.GA64887@gmail.com> <20181206155336.GC31263@linux.intel.com> <20181206164710.GA119529@gmail.com> To: Ingo Molnar Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 6, 2018, at 8:47 AM, Ingo Molnar wrote: >=20 >=20 > * Andy Lutomirski wrote: >=20 >>> vs. (with SGX added as 'G' for testing purposes) >>>=20 >>> [ 0.158849] #PF error code(0001): +P !W !U !S !I !K !G >>> [ 0.159292] #PF error code(0003): +P +W !U !S !I !K !G >>> [ 0.159742] #PF error code(0007): +P +W +U !S !I !K !G >>> [ 0.160190] #PF error code(0025): +P !W +U !S !I +K !G >>> [ 0.160638] #PF error code(0002): !P +W !U !S !I !K !G >>> [ 0.161087] #PF error code(0004): !P !W +U !S !I !K !G >>> [ 0.161538] #PF error code(0006): !P +W +U !S !I !K !G >>> [ 0.161992] #PF error code(0014): !P !W +U !S +I !K !G >>> [ 0.162450] #PF error code(0011): +P !W !U !S +I !K !G >>> [ 0.162667] #PF error code(8001): +P !W !U !S !I !K +G >>> [ 0.162667] #PF error code(8003): +P +W !U !S !I !K +G >>> [ 0.162667] #PF error code(8007): +P +W +U !S !I !K +G >>> [ 0.162667] #PF error code(8025): +P !W +U !S !I +K +G >>> [ 0.162667] #PF error code(8002): !P +W !U !S !I !K +G >>> [ 0.162667] #PF error code(8004): !P !W +U !S !I !K +G >>> [ 0.162667] #PF error code(8006): !P +W +U !S !I !K +G >>> [ 0.162667] #PF error code(8014): !P !W +U !S +I !K +G >>> [ 0.162667] #PF error code(8011): +P !W !U !S +I !K +G >>> [ 0.162667] #PF error code(0000): !P !W !U !S !I !K !G >>>=20 >>=20 >> Please don=E2=80=99t. The whole reason I added the decoding was to make i= t easy=20 >> to read without a cheat sheet. This is incomprehensible without=20 >> reference to the code, and I=E2=80=99m familiar with it to begin with. >=20 > Dunno, I can deduct the meaning from the above abbreviations without a=20 > cheat sheet and I'm sure you'll be able to too from now on. All the=20 > letters are very obvious references - to me at least, and brevity and=20 > predictable, fixed-length output matters. >=20 >> How about: >>=20 >> #PF error code: 0001 [PROT read kernel] >>=20 >> #PF error code: 0001 [PROT WRITE kernel] >>=20 >> #PF error code: 0001 [PROT read kernel] >>=20 >> #PF error code: 8011 [PROT INSTR kernel SGX] >>=20 >> This has no noise from unset bits except that we add lowercase =E2=80=9Cr= ead=E2=80=9D=20 >> or =E2=80=9Ckernel=E2=80=9D as appropriate. Even =E2=80=9Ckernel=E2=80=9D= seems barely necessary. >=20 > The thing is, the 'noise' from unset bits is actually important=20 > information as well - at least for the major bits: it was a mostly random=20= > choice that Intel defined '1' for write access and not for read access.=20= >=20 >=20 That=E2=80=99s why I suggested =E2=80=9Cread,=E2=80=9D in lowercase, for rea= ds. Other than that, most of the unset bits are uninteresting. An OOPS is s= o likely to be a kernel fault that it=E2=80=99s barely worth mentioning, and= I even added a whole separate diagnostic for user oopses. Similarly, I don= =E2=80=99t think we need to remind the reader that an oops wasn=E2=80=99t an= SGX error or that it wasn=E2=80=99t a PK error. So I think my idea highlig= hts the interesting bits and avoids distraction from the uninteresting bits.=