Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10923808imu; Thu, 6 Dec 2018 08:48:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ua/Ung75EKl0UjR8ga72rcZ9pIPOoJDjtUgNTb8EDsCQYM7B4+iP1EbTVuFRBU1SMeekTr X-Received: by 2002:a63:741:: with SMTP id 62mr24028994pgh.352.1544114925856; Thu, 06 Dec 2018 08:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544114925; cv=none; d=google.com; s=arc-20160816; b=RCADg3zBMCdvz/Ad0kwYFWe15l/m/CDyKqay4Rsx9bJfqJNtI8auYGKSsvrjkwo2nU Jjr7QQkzcSL/MofaSHrg1DNJXeCXRa6VcOsKZUfi/Vxx9sL0OSiL5DAxHV24nP4jaEaw 4NMC2ZNCc6hfAVEL/DnjqEmngVDKVWIENRjDl3D1CuT19Skq7bViO0zwvEb2F44H5mYx d1UIu3eBQ3RFYoSB7QyC8KxodCwrIG44XgHUfr2K3rYZG4kUVB9v3fMqXNEOuK9c9TZl IjPSsopYsv1AusTKk3SloRj1fG44slY+h5baBbsgCYJgXmSOwbpVEVs/MakJonNI1nCG 0VWg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TI0j2WCpwAux5LcS7gM5nNLJyE/Nr3N9kuNnTxgN00M=; b=IWTkuShLE0vxRUID0ZFkciY/RA8A88u9AdyP3EoeIXnMu/wc6PJnQQrpAbvX3RVzbq 4hj6nG3BW7CSBrrlEeikxFnuG568x+EBAloi37ZFFDURMFKiMKNtEV/jM3IGV/5NyB8O 6QbaDHoUuThe2sBTEghCAI5ZdPP+fZ48sUqq0p9/ibWM92zzXBt0IgljBtwWqZFWf5zZ YzPgHVFlctUIXcS/SdmOCtwm3GftnchV7Ajo58wFWA+y5bO9CCI22PueJRvGDJCN6N3/ D21ZFpY04pp3TShUols8Y151tZzeEwGz9HiiiqtzfSoi5zNV4yIistPIfckbC8N9niJT wVrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="ug49/ug3"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si593202plz.220.2018.12.06.08.48.25; Thu, 06 Dec 2018 08:48:45 -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=fail header.i=@gmail.com header.s=20161025 header.b="ug49/ug3"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726006AbeLFQrQ (ORCPT + 99 others); Thu, 6 Dec 2018 11:47:16 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39629 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbeLFQrP (ORCPT ); Thu, 6 Dec 2018 11:47:15 -0500 Received: by mail-wm1-f68.google.com with SMTP id f81so1743223wmd.4 for ; Thu, 06 Dec 2018 08:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=TI0j2WCpwAux5LcS7gM5nNLJyE/Nr3N9kuNnTxgN00M=; b=ug49/ug3hch7KSB9JoR/c67rJPCrESoY2H/qtreISd5buqlsavpRBxBh4J+foFFig9 bMm9hOJA7Rvl3boBz4DQ/vg7sdFdfc9OGrgEtNzom21W/r8Q3FUVMEM2QDuQyKkMKE6M P/P5fzxEc9Jzn7r8cUbgOTDQrAI97DFGDQWW+3nnky1AE5AuqgwmFAJqaOgldfUuBP1y /Q3h8QopMuXfvkRYoASnSuXld6s+vSL12MzjrHmey9nioc9dgIF6zUezQk5kVSi6i2uL ujpWHwwshGeRbI5PG25vV2kkR7ZsWSZTQ+bTdKaxHgayzmoP/ngliZ6OALPtTdrlKplo gCnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=TI0j2WCpwAux5LcS7gM5nNLJyE/Nr3N9kuNnTxgN00M=; b=GYzuD4edMWhIe58Omz/Zap3qcmpiUnQ2CklKAtjZcp3scRVWB4MqavgZ3i4d3PlmpK U/u/cc1w341X1DDny0HFwd6xyjefAJKLFvYlUGTmPRNtTP0luXIwPbcieMdhtqzIE4Gk QeS8MI16RGpnhQLXA117bEQW86i7FlsVO9Mjp4eCO+KQbsBbFV0RBnMd2u8JvOwD+t2Q IU6ZgW5ECWhib0xLgneXxshhZUDKMG0Nxg9Q68BZ2m+jIlsf0HkqRj7DZjEpqhCCJb86 Z0unOdjaQ1v2qYatKnmSGr1eZfVaaouJKIYAyEL8KyESZVwtV/KnPqzPzczufdHfBJWJ WSCQ== X-Gm-Message-State: AA+aEWbcYWwUrmsQ3l0nyRhlm0HitWXIJvqUmZPDVj6dK/2DsfecPHSL bPaSb/HLqeJ2kr4jsv4rv7g= X-Received: by 2002:a1c:2d4b:: with SMTP id t72mr6434539wmt.99.1544114833853; Thu, 06 Dec 2018 08:47:13 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id h2sm461934wrv.87.2018.12.06.08.47.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 08:47:13 -0800 (PST) Date: Thu, 6 Dec 2018 17:47:10 +0100 From: Ingo Molnar To: Andy Lutomirski 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 Subject: Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder some more Message-ID: <20181206164710.GA119529@gmail.com> References: <20181205163624.1842-1-sean.j.christopherson@intel.com> <20181206073409.GA64887@gmail.com> <20181206155336.GC31263@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > > vs. (with SGX added as 'G' for testing purposes) > > > > [ 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 > > > > Please don’t. The whole reason I added the decoding was to make it easy > to read without a cheat sheet. This is incomprehensible without > reference to the code, and I’m familiar with it to begin with. Dunno, I can deduct the meaning from the above abbreviations without a cheat sheet and I'm sure you'll be able to too from now on. All the letters are very obvious references - to me at least, and brevity and predictable, fixed-length output matters. > How about: > > #PF error code: 0001 [PROT read kernel] > > #PF error code: 0001 [PROT WRITE kernel] > > #PF error code: 0001 [PROT read kernel] > > #PF error code: 8011 [PROT INSTR kernel SGX] > > This has no noise from unset bits except that we add lowercase “read” > or “kernel” as appropriate. Even “kernel” seems barely necessary. The thing is, the 'noise' from unset bits is actually important information as well - at least for the major bits: it was a mostly random choice that Intel defined '1' for write access and not for read access. Thanks, Ingo