Received: by 2002:a4a:3008:0:0:0:0:0 with SMTP id q8-v6csp3408248oof; Mon, 10 Sep 2018 14:20:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbBJCELH+nyHnpt1VhsbiCp9ps6WZcNNFHz/9kXh6nMxipjIn3T68g4dP20BgEYNxYaM2aM X-Received: by 2002:a63:7a45:: with SMTP id j5-v6mr23941832pgn.363.1536614428080; Mon, 10 Sep 2018 14:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536614428; cv=none; d=google.com; s=arc-20160816; b=rm2epi7XqPrOIXXoE4zJm4LALrb3gYGarvnKZtoK7hJ3byMAR+R1J0fJ2fYSuTWTwm SQJ3hYYGMmaMRPQwIeRYWoNAY5YmkMoUrRXRmBVDkEcSsay7A9bgF2ieB1nfgZtWuZ0j VW74SfLSl6aqUXt0gCj9VpSxWA8wPBAkWYGYuXuC8YoPzxm1rNfL+Hv1/H+0ykG36muC 7y0vCVYmCEqR33nqvHeKqdCmHwVIdlvrZuOw6XnggXz4lP2LVUJ0ddrw//W5CwFvzQ1N RUFQEFg84CU7zTLgA0BKwNOk8AGY2+i45/knR5b6TVxP9hzXwio8X3iLuuF+1wRY66f5 Z8jw== 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=IwcdkSm81djM6XMMmQzGULl1ECGmI+7A3l600DGR7Y8=; b=IH9YSdufca3itWvs3jqwMD3DJOg/fB8GmLyPlsb+BTtSK+6MC1EOH1/EfRAGvNfC3y j86R/W25rxCOk4hGEuiR9HoF9z8Pjo2uvCg4BNZ/1IMItG9YzojDyJuTc1lgCGC29AWa S+XeNPjdObQeBVvmovr13lpIVrsjNTR7dfK+OTExugFx3w5365YqnJWMWc72JexP/TuJ Npf1DxTWlQ2YoEcm4WbMaQmV0cq5i5iR24lx2d6VJbvtpyp7e2wXBsbUaGIWK0c8wPCa PvIOsSh8qDhHnc2DgVQYwqwVypN3teNtMoEiViwDOureeU+Cge5a7WUJJnOLXJsC015j rjNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=a+aWukWU; 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 g12-v6si17614193pgk.636.2018.09.10.14.20.10; Mon, 10 Sep 2018 14:20:28 -0700 (PDT) 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=a+aWukWU; 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 S1726866AbeIKCOE (ORCPT + 99 others); Mon, 10 Sep 2018 22:14:04 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:32927 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbeIKCOD (ORCPT ); Mon, 10 Sep 2018 22:14:03 -0400 Received: by mail-pg1-f195.google.com with SMTP id s7-v6so11115464pgc.0 for ; Mon, 10 Sep 2018 14:18:06 -0700 (PDT) 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=IwcdkSm81djM6XMMmQzGULl1ECGmI+7A3l600DGR7Y8=; b=a+aWukWUcxC4JEe0NofXl+frtPD2OggPIQkHWyQEIm0ZViqS8s5l8+NzYaoPaQvE3J ilixjlPioMftJbBK76T/foaMkcB6Pu4+wYOefRjUU869iqG0LNdN13jdYjfrckEz3mMb SUNDo6aRpEhBC5BnvhLA6zvOcJbw/MaUeeb3jDFzkU/+Jp3vn6rdB+nIGfjSfaXRan22 vUNpsO/bXICiJRkFYaUdhfX+MvLzoKmoxl72vAcBtxv3As9wXwl9uKvsdWU2EOk3psjL pTDDF8zt8iXwKtMi3l5eGO9XqhhCegDJrhuqM1kfohlJB7UAa0z+Uvqc54Ba1MjQ0cLO Zdlg== 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=IwcdkSm81djM6XMMmQzGULl1ECGmI+7A3l600DGR7Y8=; b=IVJF/l+M88EsHO5hYaZCTdZjA7/siNYUPPyrFh0hVzp94XsFBCrh44rG+BzrpVJT7B 06yoze3ooh6GiHgzhBfX49ESBVVcs30Qe24LjBTFloFQkVBEYbyGeewL2eeQOYQ8nkKE ESU0LR+zqzviz58ozI98Lp8BWlbGNnP8JbTDJOZOa4M8InyvOIOcIyI8udRwjSP8wBBJ MnbHyLdqbwze1optOg/MPNroPXnaOWLMSkhycwL9KahmI3nwR1xbvA7ONws4PLI/Hhlk hh/d2dnMPYig9RhA2KeNf7RgS+ZD39wpN1hVErZiF2SM/tB5k49o9Y/qbPKKZ2FJq4Qt Swsw== X-Gm-Message-State: APzg51BQS2kjADB/SIc8MMiJrNmyOP50sihmgNWHZ0/w3tOGamv4jMeu TwIpBZsjoKHryDb1AINZ8cqSiQ== X-Received: by 2002:a62:cc41:: with SMTP id a62-v6mr25767789pfg.131.1536614285812; Mon, 10 Sep 2018 14:18:05 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:a1db:83d1:3cfc:8736? ([2601:646:c200:7429:a1db:83d1:3cfc:8736]) by smtp.gmail.com with ESMTPSA id i65-v6sm38420755pfk.43.2018.09.10.14.18.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 14:18:04 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC][PATCH 1/8] x86/mm: clarify hardware vs. software "error_code" From: Andy Lutomirski X-Mailer: iPhone Mail (15G77) In-Reply-To: <6f75823d-ce8b-d483-6046-4efbe20d0410@linux.intel.com> Date: Mon, 10 Sep 2018 14:17:56 -0700 Cc: linux-kernel@vger.kernel.org, sean.j.christopherson@intel.com, peterz@infradead.org, tglx@linutronix.de, x86@kernel.org, luto@kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180907194852.3C351B82@viggo.jf.intel.com> <20180907194854.74729D71@viggo.jf.intel.com> <561334F6-9C13-424A-95ED-D377CE48DA46@amacapital.net> <6f75823d-ce8b-d483-6046-4efbe20d0410@linux.intel.com> To: Dave Hansen Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 10, 2018, at 1:07 PM, Dave Hansen wro= te: >=20 > On 09/07/2018 03:48 PM, Andy Lutomirski wrote: >>>=20 >>> For part of the page fault handler, "error_code" does exactly >>> match PFEC. But, during later parts, it diverges and starts to >>> mean something a bit different. >>>=20 >>> Give it two names for its two jobs. >> How hard would it be to just remove sw_error_code instead? It seems >> like it adds little value and much confusion. >=20 > I think it would be really nice to have hw_error_code stand by itself > and be limited in scope to just __do_page_fault() and then have > FAULT_FLAG_* for everything else. >=20 > But, I was a little scared off of that. For one, I think we fill in > signal info with error_code, which makes it nominally part of the ABI. > So, I wanted to muck with it as little as possible in this set. >=20 > But, if we just said that > 1. hw_error_code goes out to userspace, always, and Nope, it=E2=80=99s an info leak. If the address is in kernel land (and not v= syscall), we must (and do, I believe) fake it. > 2. We drive all kernel behavior off of FAULT_FLAG_*, not error_code, > I think we can get away with it. >=20 >> I=E2=80=99m also unconvinced that the warning is terribly useful. We=E2=80= =99re going >> to oops when this happens anyway. >=20 > One thing I wanted to get out of the warning was the contents of > hw_error_code before we go screwing with it. I also don't mind a nice, > clarifying warning showing up just before an oops. Maybe it could be a > pr_warn/err() instead of a full warning? Sure.=