Received: by 10.213.65.68 with SMTP id h4csp2874182imn; Mon, 9 Apr 2018 10:21:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3Wnw9lFbKb7QEqxyFCkgnEvOM5vifVjItw13ckHKHO+qghvpTg0G7tAZ5vm6L9eTFxjus X-Received: by 10.99.113.93 with SMTP id b29mr25791101pgn.243.1523294491432; Mon, 09 Apr 2018 10:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523294491; cv=none; d=google.com; s=arc-20160816; b=vZrJu0kxhYQaBzHNyh9bcWIG75L4s91T3RliKLW7cpkbngdQPOXOavTYLlkhVIXcH7 trf5f0PIPII2XWW53sIyd7BrwmAM19VgkXloheHQiDIm8lGjunZCFimoaOHRo4qS6Dc+ ShLnzHDnw8EP03se/fsTNyFR9dZjsGYm6VVrkh0C+DKaQcVeGpmt4oDm+KXgxqBRLYrP gRR9Grxms5o6jcj5382HRTlS676jcX8JOBVQqiiDN1cliSlHw6NzzV7ObWo/8WBoSrmB gtgNakqY+alySj57sUaC7Rb1g/iGir0CFI7xG7yAkt3Iyiy2JpcQVMQ9EMrOtovmVJ5g 1vtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=xL5lc5tbaPWy9c82VEJPW6go5jdwFN791VHTn4KyIW0=; b=Ka3xD6y1SdNPM4oGdBEabHkVU0e6rjzuAmOx1BgT1Z5K9ejypLcG0oDzEBlz7F9h+j L/tk+31bzfDWAp0ZDz6bpvFUTaUpp1Cxh3yqXNXNE4DiAIuVE9sP6Kzxm2QnxVxa+qKU BHrwimyzmHw+qJYtm9JCCwKxHVdTceFi8y8RKouPCpMOmof5wIOS+SaiIbWFm7LISXle HwViTr/lwYRa+tSOgKr8y9T3il13F53bH/qZI19KvQLBeDE3iuPBz/sy04ZhboGKFdUK mD1YB5wf8SRv4DFzYDP/yuWjqxnr5gZ3TMH6hb9A04u0s7fRczI3s8dGo5s8O1KQej84 MPiw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si562655pfm.106.2018.04.09.10.20.54; Mon, 09 Apr 2018 10:21:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422AbeDIROT (ORCPT + 99 others); Mon, 9 Apr 2018 13:14:19 -0400 Received: from terminus.zytor.com ([198.137.202.136]:49431 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbeDIROS (ORCPT ); Mon, 9 Apr 2018 13:14:18 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w39HDIEt1894278; Mon, 9 Apr 2018 10:13:18 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w39HDHqn1894275; Mon, 9 Apr 2018 10:13:17 -0700 Date: Mon, 9 Apr 2018 10:13:17 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dave Hansen Message-ID: Cc: jpoimboe@redhat.com, torvalds@linux-foundation.org, dave.hansen@linux.intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, namit@vmware.com, bp@alien8.de, aarcange@redhat.com, luto@kernel.org, jgross@suse.com, keescook@google.com, gregkh@linuxfoundation.org, peterz@infradead.org, hpa@zytor.com, dan.j.williams@intel.com, hughd@google.com, mingo@kernel.org, dwmw2@infradead.org Reply-To: jgross@suse.com, keescook@google.com, hpa@zytor.com, peterz@infradead.org, gregkh@linuxfoundation.org, dwmw2@infradead.org, mingo@kernel.org, hughd@google.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, torvalds@linux-foundation.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, arjan@linux.intel.com, luto@kernel.org, namit@vmware.com, aarcange@redhat.com, bp@alien8.de, tglx@linutronix.de In-Reply-To: <20180406205507.BCF4D4F0@viggo.jf.intel.com> References: <20180406205507.BCF4D4F0@viggo.jf.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/espfix: Document use of _PAGE_GLOBAL Git-Commit-ID: 6baf4bec02dbc41645c3a5130ee15a8e1d62b80f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6baf4bec02dbc41645c3a5130ee15a8e1d62b80f Gitweb: https://git.kernel.org/tip/6baf4bec02dbc41645c3a5130ee15a8e1d62b80f Author: Dave Hansen AuthorDate: Fri, 6 Apr 2018 13:55:07 -0700 Committer: Ingo Molnar CommitDate: Mon, 9 Apr 2018 18:27:33 +0200 x86/espfix: Document use of _PAGE_GLOBAL The "normal" kernel page table creation mechanisms using PAGE_KERNEL_* page protections will never set _PAGE_GLOBAL with PTI. The few places in the kernel that always want _PAGE_GLOBAL must avoid using PAGE_KERNEL_*. Document that we want it here and its use is not accidental. Signed-off-by: Dave Hansen Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Dan Williams Cc: David Woodhouse Cc: Greg Kroah-Hartman Cc: Hugh Dickins Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Kees Cook Cc: Linus Torvalds Cc: Nadav Amit Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/20180406205507.BCF4D4F0@viggo.jf.intel.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/espfix_64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c index e5ec3cafa72e..aebd0d5bc086 100644 --- a/arch/x86/kernel/espfix_64.c +++ b/arch/x86/kernel/espfix_64.c @@ -195,6 +195,10 @@ void init_espfix_ap(int cpu) pte_p = pte_offset_kernel(&pmd, addr); stack_page = page_address(alloc_pages_node(node, GFP_KERNEL, 0)); + /* + * __PAGE_KERNEL_* includes _PAGE_GLOBAL, which we want since + * this is mapped to userspace. + */ pte = __pte(__pa(stack_page) | ((__PAGE_KERNEL_RO | _PAGE_ENC) & ptemask)); for (n = 0; n < ESPFIX_PTE_CLONES; n++) set_pte(&pte_p[n*PTE_STRIDE], pte);