Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11168527imu; Thu, 6 Dec 2018 12:42:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wv69iKA/Jzigy54KU4aSC1ld33QxqfC9SgRuElSOnzLNNlIBqzzXyw4B4wjsUcHBM2nVk2 X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr20007712plm.249.1544128933025; Thu, 06 Dec 2018 12:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544128932; cv=none; d=google.com; s=arc-20160816; b=TXFfrS4m/FLZ/hTk7yKn16B3Be4Ww2e54ZuYBmgjUcJ1cfla5Ftbm2WL+ICTASvBVA hXZKMW2L+oFFohjCiq/DSTYl6IA9He1QhYigl9E1MbZxyRL5coN02RjzL6+DJQrY4odn k8XqckQ4zpQ/l0GaE6USxxwol+aABqqJCa+oaVSpoDC0dHnaHJ5POBASsq1Sgvf/CyHj 1YM7NRtYIJ8jzBRNSoxoiJJdev2RA5cS1bfcLl0oWjb4Gp9VhNuNN3neQMN/JTekKt2f ERyqahIyeJso3YPdeu4hZ8iWMQK6alHu51hxVsCDwz/xondM6f05WnCotE5/Wofi1ySW yUmg== 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=MZAEYycWiumWKRAabgzjtBtryLX0wOeag1iCDMOhaII=; b=WwrFNvMZUbLWanpZkryQYl/B0BPdM/qjLw8g103jO7eBipDnZhtbtykGSc0g1J4PZ7 LZJvEzQbRG5MzXtR3d8cT9ZyV87qwefA06qoPgZwzg8vnMpIlUw10L+2BUr75tGUVPNu dS3xDPTfLILR8YAwPj0n+Fe99WEpyeZ8iIIv9R2L+Q32avWGTR0YxUsyMOxKFyPVD6OW Gkyp0EaNgcU4Kus/9YE/txawBEnFPE8p4Grco/MxPQ65vprJe1hRPwwJI/gOAgjEcNuk uUrObHq143ZAacmRzMUcu8wroveR/+IDAuMnv9YQS6nSL/bJ4zoSzyX+nGEMvqAtW5un PByw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AoRnD3pC; 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 a8si922492pgw.380.2018.12.06.12.41.54; Thu, 06 Dec 2018 12:42:12 -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=@linux-foundation.org header.s=google header.b=AoRnD3pC; 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 S1725967AbeLFUkF (ORCPT + 99 others); Thu, 6 Dec 2018 15:40:05 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34288 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbeLFUkF (ORCPT ); Thu, 6 Dec 2018 15:40:05 -0500 Received: by mail-lf1-f68.google.com with SMTP id p6so1406800lfc.1 for ; Thu, 06 Dec 2018 12:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MZAEYycWiumWKRAabgzjtBtryLX0wOeag1iCDMOhaII=; b=AoRnD3pCwbSngf8j1zH0Bxu2g2s+V3hPzVjaXBx41VOxXkHwZKudsgnVTZuiP2/6vg ZYydAkPAgIp/+Pf9Y8RuBkAa1uHDkCpcdo1cYCZI6PWYiJOGbFVTRhUyHGbUcuC/2y5b eLLNc0yBgq2koEJ32D4C8ch6XDTTKgCTkzjEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MZAEYycWiumWKRAabgzjtBtryLX0wOeag1iCDMOhaII=; b=gAyqn5AAciIwIYOzEWzb1fklpB1QhHp6EE2NehJkQ1DICxLSLzr2dIS6aOCj/arJg7 TMKGwvgdQ780ATwhg0QZG9wKgank8RRC/w7JXdyNoVTIhIiQHr7RcSr6oXECP5Xr0Wpe Sgj7zak3JR+ApfkBs+v2FlTh1dQLjxPjGBYxeDq/YxqPOmiPP1g39BHmQRGUU+P2bRin oU0UNj9tqTcewu/6is+icYMj1U4hWpF98RXCLB24cyxUex61/C+IPPCEMwu8DMrZ0uOR l+ZSEAx4w+4W63JOzLMAqkrUW09LNXkmA+B9+T5cnHqxGXA8JfhdnEIDikxeBHO3S2On Uj3Q== X-Gm-Message-State: AA+aEWa5mkhdvrgQ5YHFXJTsGq4PpPKV3ASFqAhuKZ/XFO2ntaDRIUI5 N9q1gtlQaCb4juSSxTqumNH+RlpjuOI= X-Received: by 2002:a19:914b:: with SMTP id y11mr16776111lfj.98.1544128802936; Thu, 06 Dec 2018 12:40:02 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id b25-v6sm241731lji.94.2018.12.06.12.39.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 12:40:00 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id u18so1361260lff.10 for ; Thu, 06 Dec 2018 12:39:59 -0800 (PST) X-Received: by 2002:a19:cb94:: with SMTP id b142mr18592223lfg.117.1544128799426; Thu, 06 Dec 2018 12:39:59 -0800 (PST) MIME-Version: 1.0 References: <20181205163624.1842-1-sean.j.christopherson@intel.com> <20181206073409.GA64887@gmail.com> In-Reply-To: From: Linus Torvalds Date: Thu, 6 Dec 2018 12:39:43 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder some more To: Andrew Lutomirski Cc: Ingo Molnar , sean.j.christopherson@intel.com, dave.hansen@linux.intel.com, 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 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:28 PM Andy Lutomirski wrote: > > "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. If you care about the bits in the error code, then just look at the number. And if you care about what the numbers mean, it doesn't matter how it's encoded. I don't think you should mix up the two concepts. > 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. Yeah, the "from user mode" case is generally really something horribly bad (reserved bits being set or us screwing up LDT's etc), so yeah, maybe a better model is indeed to point that out explicitly, the same way the "user/kernel doesn't match U/S bit" is pointed out. Linus