Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8638283imu; Tue, 4 Dec 2018 11:34:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpNlzVUEiOiuLetd4YBKM2eCjzKwxUxo9qcyJE0TKE0EcIhia1R4vN/Yr3OozC12SwBsLY X-Received: by 2002:a17:902:7683:: with SMTP id m3mr2596028pll.187.1543952095602; Tue, 04 Dec 2018 11:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543952095; cv=none; d=google.com; s=arc-20160816; b=h1O2YpWbfqjFQImAfFtXVLSmBRkscgeMtz0pNGvGGglvldQusZ+m1B0PR28+tIM6GS IEMtWfXIGhhLBHLAshj+a0UqYnjTDFORo8Lw8qWmMWzEJ1GG/MT3BlIdDv0qMDCtZAeX UdpZLjuGMDoO8T/PmBZL41Bl+ZL/vy362qzTuQRu9o4LCV39OPUedTKNy19oMuJ9JPfu 4kOCPBOnH0+9OTusYAhjL0QUzMdvjLlPhVS5i2/dWmUENBmoPAUZt5Stmif1VOwxsXG6 Vk6c+AVKoN9/zdFqSl/kOPB+FGqtTmBKtiXPU4BcYuDCvjphuRUqSeI67U+ChiyvYUBH sU8A== 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=aHQrrS7rG6fI83UeEVYhEgbYA91dLZ6iuDpGG8h62Xg=; b=syZE25YlRhTMmt3LF2BiAeIsB0ngOHVRLNTqNsyUle66WHcSgKy8KTblbpHvcu8sgi sCrrxBWFx46s64FJBV0iHuIqixtYMY9I52pz/9noJ/qoR7Zvc9hcdVc/UhWCt3u0sM53 lZ2y4TpZhsS7YunnOZaE3rq5T+ptNvycZhQj+LD/n3pUexZVZcjtRgqt0tn+B7hS+JpA rNcnWKxi75L0oHRqz0EzjOuv5h2s8+iJYEdP61EiG/AeLW4Z6aevwJybwaEySIG0xXqg UGeVMvTLe45VqS4rzApeO1my4YnaUxH8J8UfSXkQTGUGVNdXIaAjkVcQE2TD8FE506Yz FmDw== 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 o85si18101151pfa.162.2018.12.04.11.34.40; Tue, 04 Dec 2018 11:34:55 -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 S1726096AbeLDTds (ORCPT + 99 others); Tue, 4 Dec 2018 14:33:48 -0500 Received: from mga03.intel.com ([134.134.136.65]:29578 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbeLDTdr (ORCPT ); Tue, 4 Dec 2018 14:33:47 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2018 11:33:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,315,1539673200"; d="scan'208";a="107276999" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by orsmga003.jf.intel.com with ESMTP; 04 Dec 2018 11:33:46 -0800 Date: Tue, 4 Dec 2018 11:33:46 -0800 From: Sean Christopherson To: Andy Lutomirski Cc: Ingo Molnar , X86 ML , LKML , Yu-cheng Yu , Dave Hansen , Peter Zijlstra , Borislav Petkov Subject: Re: [PATCH 6/5] x86/fault: Clean up the page fault oops decoder a bit Message-ID: <20181204193346.GD17374@linux.intel.com> References: <11212acb25980cd1b3030875cd9502414fbb214d.1542841400.git.luto@kernel.org> <20181122084119.GA44720@gmail.com> <20181127153202.GA27075@linux.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 Tue, Dec 04, 2018 at 11:22:25AM -0800, Andy Lutomirski wrote: > On Tue, Nov 27, 2018 at 7:32 AM Sean Christopherson > wrote: > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > > index 2ff25ad33233..510e263c256b 100644 > > --- a/arch/x86/mm/fault.c > > +++ b/arch/x86/mm/fault.c > > @@ -660,8 +660,10 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, unsigned long ad > > err_str_append(error_code, err_txt, X86_PF_RSVD, "[RSVD]" ); > > err_str_append(error_code, err_txt, X86_PF_INSTR, "[INSTR]"); > > err_str_append(error_code, err_txt, X86_PF_PK, "[PK]" ); > > - > > - pr_alert("#PF error: %s\n", error_code ? err_txt : "[normal kernel read fault]"); > > + err_str_append(~error_code, err_txt, X86_PF_USER, "[KERNEL]"); > > + err_str_append(~error_code, err_txt, X86_PF_WRITE | X86_PF_INSTR, > > + "[READ]"); > > + pr_alert("#PF error code: %s\n", err_txt); > > > > Seems generally nice, but I would suggest making the bit-not-set name > be another parameter to err_str_append(). I'm also slightly uneasy > about making "KERNEL" look like a bit, but I guess it doesn't bother > me too much. What about "SUPERVISOR" instead of "KERNEL"? It'd be consistent with the SDM and hopefully less likely to be misconstrued as something else. > Want to send a real patch? Will do.