Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11158108imu; Thu, 6 Dec 2018 12:30:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/WbZHVriPORJ7OOYcArqlEaksDznSIAeDPlKQnWH2kihiOq1LGZZX1KOhpw/qov5/BV1RBJ X-Received: by 2002:a63:6cc8:: with SMTP id h191mr24328898pgc.366.1544128250310; Thu, 06 Dec 2018 12:30:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544128250; cv=none; d=google.com; s=arc-20160816; b=Zxf1LVSoutwkxxsm0F5ezr/333L5U541EUvYBBlKDV+nf/hG5rZ9Po/XD8bUYwDuFB TTXmqTkKsEypeEjFEwbEJQWnA1rsss9D5bv6uHSbwbXbNuQHgdbkHR2DR+hfeN/XvJVl B6xlsWmKmNAjEgr+3MuzwsgrXu7mK+QJ0ewunpWPqvQxT2Tbp/5EFtuKb92KD+UHp8AN Vxsa7lYabtmO2tc89YbQ2jcb1iEI1BLdv2sO+Vni6UYydzXBFTldfdbPfx6CfmLHPNBD VENvFbB32Squ1ePMKtdo1Yl1XPycqqIfy52juT5nFMwLZLkD9I+t+65Dhlc153iUR1I7 Vo2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jr/Avpjv9MxkJ0aoYuDGW4h1ZtNgLWGJfyhkGk0IMsE=; b=UT8q1os9tzdkE3aUVf+pGkXaJc6rKZqINR7papauIPVDDIwWCmWYj1/wLBOvPsLb0P iNqa5/R2N/hD8V/Nwo381UCfd6Sx4a84S0Y22X/YQk8kBh138ncYT7yqvls4wWy1Rgw6 M67znZieroUNF3Pn4wnWtgLRATpYLbWXhRvxxWIx+JGqtAPx308+YQLqJlovMp+KOD0y S0xai1KWXT48Mh9MNJrTpRnYTFJA4xXZR5MpeELXddfHf7QrGALOhzc4O2Z9LRuHhEXS FI85xUIj+bb5FscOnuk5OwfiUj2SGWpwuA8gLacgFQj0CyFywy82KrNsWKBhG+O2rZ2q 4pKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M6m45aiJ; 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=pass (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 h33si1046535plh.119.2018.12.06.12.30.32; Thu, 06 Dec 2018 12:30:50 -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=@kernel.org header.s=default header.b=M6m45aiJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726035AbeLFU2a (ORCPT + 99 others); Thu, 6 Dec 2018 15:28:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:44476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbeLFU2a (ORCPT ); Thu, 6 Dec 2018 15:28:30 -0500 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18ABC21479 for ; Thu, 6 Dec 2018 20:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544128109; bh=IoUKOy1q34wAiXtGh1607hggiBb3BUSj7Oefzabqh2o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=M6m45aiJMEOFlWzQdciOkfeuzp/ukrQEK7qaymQNFroJov7+LSLlKq4tdqRUpj3T9 9GIALbCK0MDHzhJ4vxTz9MEc7+ClGdRdEx2p+Bx8c1M52iChrYqAAyl+jwwVaZKl1u TDvsmujrsJTvWE0XTCw560a1Q1eZcJpZg5S1H+fY= Received: by mail-wm1-f47.google.com with SMTP id y185so14905550wmd.1 for ; Thu, 06 Dec 2018 12:28:29 -0800 (PST) X-Gm-Message-State: AA+aEWaEKepo2aNd4nWRybpipcjQifv/DayKiKOzFJ6nDxN6hLklkaSc sJv1o8nAqzTkgeAErpWqpAQb7VEZmWuBeaWFATsvKA== X-Received: by 2002:a1c:aa0f:: with SMTP id t15mr10027437wme.108.1544128107541; Thu, 06 Dec 2018 12:28:27 -0800 (PST) MIME-Version: 1.0 References: <20181205163624.1842-1-sean.j.christopherson@intel.com> <20181206073409.GA64887@gmail.com> In-Reply-To: From: Andy Lutomirski Date: Thu, 6 Dec 2018 12:28:16 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder some more To: Linus Torvalds Cc: Andrew Lutomirski , Ingo Molnar , "Christopherson, Sean J" , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , "H. Peter Anvin" , LKML , Rik van Riel , Yu-cheng Yu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 6, 2018 at 12:24 PM Linus Torvalds wrote: > > On Thu, Dec 6, 2018 at 11:07 AM Andy Lutomirski wrote: > > > > How do you like the attached patch? > > I agree with whoever thought it's odd that "read" is in lower case > when everything else is in upper case. "read" isn't an actual bit in the error code, so I thought it would be polite to make it look a little bit different. That's not a big deal, though. > > And honestly, I'd just siggest making the err_text simply have the > real user/kernel difference in it too, using something like > > pr_alert("#PF error: 0x%04lx%s from %s mode\n", error_code, err_txt, > user_mode(regs) ? "user" : "kernel" ); > > The "oh, PF_USER and user_mode differs, so let's point that out > explicitly" thing is a good thing regardless. Sure. Although it's extremely odd for us to OOPS from user mode, so maybe the OOPS code in general should print a big fat warning, and we'll just otherwise assume it was from kernel mode. (In your tree right now, we print the wrong value for CS for OOPSes from user mode, which is extra confusing. That's fixed in -tip.) --Andy