Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2228888imm; Fri, 7 Sep 2018 12:52:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaJJBBr5bwtIr9XX22FwuAmRv9espHMNO4ZXDtRdc6KyHQ/3MNI3vjVcET8u8uKB4Tnxi19 X-Received: by 2002:a63:1e63:: with SMTP id p35-v6mr10089268pgm.376.1536349978082; Fri, 07 Sep 2018 12:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536349978; cv=none; d=google.com; s=arc-20160816; b=zrqsFVI/9s9UGQF/5gLvrouL0ZsTvkX6WrH21NgUgwLV3xoHApNvlJi3mlk39Z4vEG 4AWrHRRKXMt95xnxptpP//qDEIp6igzrMdHxgRliS6xlNwm50uabNFTvCTAenhDRHP3+ px9vLSYqivf4PwE46F0PP5E7OXWfTgCJJUDpmQEW2bIIO4RFZEGZP14bpyS5/9s+/UOr q8jg9th8gIlqVrmbUoVxA/4jwV+gzSD6iPvvR9oRpTefDZG+9W3OZxOdZ+TuAgiytnMU 6TFFB8iHNtxWJ/tjqurLJvIIIQM5thGNdZu2AFcDvYZNtesltuLlBu59xvr9XiVHw32w WG0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:references:date :from:cc:to:subject; bh=hl6krfV7GBs0gtT43qVWnzPc7DoT+6q3NizqZ+RM7Vo=; b=qh98D7ylyZjqG28hXDQ7lOvoONL82jC7dzME0s2ftvLyev8q6d5LF4QBmutGReR0x3 INCLJ9uOf44muqgVgjiFkMzv63G5pQTavEFpad8Mmea1ETf9Se/qKr4aG20tNxKcOSyH I6mz+xfDwNRzI/nEqXK0weVA25a7PYaCtE0VNii5P6Sq1+7nOrZDgzRev4nUAlqFhz1o 9c8R0wEZNOomEo0WV3ugIjFNeapIJRPoIdCjeDWv49NJvhUvfy4MnA93b182TZa8ypbC EqyNHvEbG9MI6gWCC238wrepxL9xGJ7Rh2Wv2UM5iqeiCX0lPx7KDOc3P9r5SL951TDv afYg== 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 184-v6si8855354pgj.421.2018.09.07.12.52.43; Fri, 07 Sep 2018 12:52:58 -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; 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 S1726766AbeIHAd6 (ORCPT + 99 others); Fri, 7 Sep 2018 20:33:58 -0400 Received: from mga17.intel.com ([192.55.52.151]:2878 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbeIHAd5 (ORCPT ); Fri, 7 Sep 2018 20:33:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2018 12:51:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,343,1531810800"; d="scan'208";a="88584859" Received: from viggo.jf.intel.com (HELO localhost.localdomain) ([10.54.77.144]) by orsmga001.jf.intel.com with ESMTP; 07 Sep 2018 12:51:29 -0700 Subject: [RFC][PATCH 4/8] x86/mm: add clarifying comments for user addr space To: linux-kernel@vger.kernel.org Cc: Dave Hansen , sean.j.christopherson@intel.com, peterz@infradead.org, tglx@linutronix.de, x86@kernel.org, luto@kernel.org From: Dave Hansen Date: Fri, 07 Sep 2018 12:48:58 -0700 References: <20180907194852.3C351B82@viggo.jf.intel.com> In-Reply-To: <20180907194852.3C351B82@viggo.jf.intel.com> Message-Id: <20180907194858.FD74A39F@viggo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Hansen The SMAP and Reserved checking do not have nice comments. Add some to clarify and make it match everything else. Signed-off-by: Dave Hansen Cc: Sean Christopherson Cc: "Peter Zijlstra (Intel)" Cc: Thomas Gleixner Cc: x86@kernel.org Cc: Andy Lutomirski --- b/arch/x86/mm/fault.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN arch/x86/mm/fault.c~pkeys-fault-warnings-02 arch/x86/mm/fault.c --- a/arch/x86/mm/fault.c~pkeys-fault-warnings-02 2018-09-07 11:21:47.182751900 -0700 +++ b/arch/x86/mm/fault.c 2018-09-07 11:21:47.185751900 -0700 @@ -1274,9 +1274,17 @@ void do_user_addr_space_fault(struct pt_ if (unlikely(kprobes_fault(regs))) return; + /* + * Reserved bits are never expected to be set on + * entries in the user portion of the page tables. + */ if (unlikely(hw_error_code & X86_PF_RSVD)) pgtable_bad(regs, hw_error_code, address); + /* + * Check for invalid kernel (supervisor) access to user + * pages in the user address space. + */ if (unlikely(smap_violation(hw_error_code, regs))) { bad_area_nosemaphore(regs, hw_error_code, address, NULL); return; _