Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp545745imu; Thu, 22 Nov 2018 01:31:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/WczjTpf3mrDvXh7hx/PCtQKtItr5q5ujYZ8EOiLtaZ2g1OCwgHfe5tLBeACBb/2sOSKEPt X-Received: by 2002:a17:902:a516:: with SMTP id s22-v6mr10488369plq.255.1542879095593; Thu, 22 Nov 2018 01:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542879095; cv=none; d=google.com; s=arc-20160816; b=kF7u9BfZiwJhOjb+BHn/jAkSe5J6Z/Q1zBn2pdIGZSbMC/eupsA89HlolgjBy38cAp /k11s/0airL1ltzimmVW1wZV/5MoF0/XInhzq+XPv8k09gW78e2JiLDzYqSvTH2nkLBR b6WLln2HwbSK2kEBTUQFCZOSi8l1uD08ZWyWkPUFn7U+JfIBdxxwbzoUH1QkLOyDzRF8 s6GC8VlDG4X/JARx/Qk+Y8FZp51sUxGLBmi+yvM4HTuAT7IFHNisVkCy7x6IH3jmAKHH /ExFfD38020TY98NjX0RZNcvobiET1+9/uO5bT778yRkbSM7JVBTL2WXjmKMCzGOhIS3 vALA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=rRO2cGVTQSulpUsuD7AHL5H0phMa9fGSv33dtFof2J4=; b=PBFrYTqjX1IZDQeTgisBUViPyOP8EO7/Y4olv2uI07AT8nULXVsUBTZA3Vwt64x2ct eTa5RWX362/blFEesAE3VTGlwyAnBx3uhW2k1/pUlgEjHT6By3cTqpIoAva/yzmONU0r zBj0xthP59P7NwVE8lh1HNRgd2360Pc6i+XLWFcq5IJNEsuzmsIktxaZzyU7mVfD16KU BS+zJKT/NANuPs02OzF4xFVeRymkSquWXYbc8Y0qSSymBK074cMYnp6+hfUFQNAWfaj5 wczbh6kMG1uSIfWVy9IpL24/MVudTPDsKF+ZN3+Md3ugaTlf1S1mPLfEK/s16Bvyfpwy wY3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PviIEOpj; 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 z11si31033850pfg.107.2018.11.22.01.31.20; Thu, 22 Nov 2018 01:31:35 -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=PviIEOpj; 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 S2387864AbeKVJr6 (ORCPT + 99 others); Thu, 22 Nov 2018 04:47:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:38632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387822AbeKVJr6 (ORCPT ); Thu, 22 Nov 2018 04:47:58 -0500 Received: from localhost (c-71-205-112-160.hsd1.co.comcast.net [71.205.112.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E65F8206BB; Wed, 21 Nov 2018 23:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542841889; bh=qyb70sRe6RjFz/TnM2lS0+RJk7ZLN/MZ76zp3ornU7U=; h=From:To:Cc:Subject:Date:From; b=PviIEOpjpvDcXeKLCaQrkPnSTODPTivpXk7A24W6cVtYtFoYUW2ikw/n1XBzCZLXl jE2H/mPs7Df+MvFcJnGDF6LaK3H+uQIfRu2cReRyU8/RVd5477u8LtwfciEtVOOeFR qi3z2c0zCgOwnv3Sqd1DIvouxp8znnY2qcEhSR4Y= From: Andy Lutomirski To: x86@kernel.org Cc: LKML , Yu-cheng Yu , Dave Hansen , Peter Zijlstra , Borislav Petkov , Andy Lutomirski Subject: [PATCH v2 0/5] x86/fault: #PF improvements, mostly related to USER bit Date: Wed, 21 Nov 2018 15:11:21 -0800 Message-Id: X-Mailer: git-send-email 2.17.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series is a whole bunch of page fault cleanups, plus a couple of OOPS diagnostic improvements. The overall goals are to clean up handling of the faulting CPL, the USER bit in the error_code, and the log messages generated by #PF OOPSes. This series can also be seen as CET preparation. CET introduces the WRUSS instruction, which is the very first way for CPL 0 code to cause a #PF fault with the USER bit set. Let's get the page fault code into shape before we start using WRUSS :) Changes from v1: - Rebase on top of tip:x86/mm, now that a bunch of v1 was applied. The only material changes are that 'x86/fault: Check user_mode(regs) when validating a stack extension' is gone because the code it fixed has been deleted and that 'x86/fault: Remove sw_error_code' lost the hunk that changed the same code. Andy Lutomirski (5): x86/fault: Remove sw_error_code x86/fault: Don't try to recover from an implicit supervisor access x86/oops: Show the correct CS value in show_regs() x86/fault: Decode page fault OOPSes better x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code arch/x86/entry/vsyscall/vsyscall_64.c | 2 +- arch/x86/kernel/process_64.c | 5 +- arch/x86/mm/fault.c | 144 +++++++++++++++++++------- 3 files changed, 108 insertions(+), 43 deletions(-) -- 2.17.2