Received: by 10.223.185.116 with SMTP id b49csp2458014wrg; Mon, 5 Mar 2018 03:19:04 -0800 (PST) X-Google-Smtp-Source: AG47ELs2fvRbMQ2B33a8V3kZb5B+GuxhzLgNrPU39bSoUeo/qYEL+vR8wAIjt+ts0g1vOlL4QDJR X-Received: by 10.101.97.135 with SMTP id c7mr11906239pgv.425.1520248743945; Mon, 05 Mar 2018 03:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520248743; cv=none; d=google.com; s=arc-20160816; b=lG05gcnnQ0eRYpHpkhwysJKLOqfLTnGKWRDJmiBAEVicH+0D/SUE2keb/Zr1llQMea QHu8ooTOkadAt7Hzj/VZzTirPIa91exJKk89ZpwhF9wYg6dne06QzGMG/N665ZQaZBuv b/c8ledzC373ZCak6m1nF4/i/gmUIqDE5Mhkmz646tLUF5d7juBSNcrapYbTT9s8Xc0e nfDOmjhJ8xayLQASFKCoT31U+K9qEtHSiiIuDpJO9jGQVZgglK+HqzH94lkyy+5JCyl3 myNf79RgQYBo4ockRt1Keqw+wrLoesa/pxAjYfJeg92kQUr1hD60+Ar/Mguxq/ompCuA rsOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4x3jaKCTpOjd7aP6kGef2VaGv6jG5TscCsECPMsIZvU=; b=jz1Ts/e7gvXs68jb5f8fsn5SCreBMXGr8zIEhDZ2cLMlhzAzR4m3gJ5rAfSW/4Wji2 naojsNGMSEFFkGsAHaWzG8C/TBKGiQQbn61zOdfAtKLCiVuCuZE+V+y3CVxYJJh9OIAS LZ83K8GRCJFU3c8O5WJHaNwSR02wOMTHbAddR3nbmTZ3oCxKP9qJEIXiwzvBN6KXZIlb IcCNNeGLFDQFRzg34dO7vJ/2tanB5I81kKNusJ/78cwAIyjS1kAVPANXJs3pzXE4QlgX sLWQo33J/vpA53LdV1D8QYCBn1Kqaplaus/094xqTRjfhNDs9PzXRjZtQTVDD1uF4nyE 0E5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=RX62EDQy; 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=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si4866762pll.99.2018.03.05.03.18.48; Mon, 05 Mar 2018 03:19:03 -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=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=RX62EDQy; 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=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934113AbeCEK3n (ORCPT + 99 others); Mon, 5 Mar 2018 05:29:43 -0500 Received: from 8bytes.org ([81.169.241.247]:54534 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933789AbeCEK0T (ORCPT ); Mon, 5 Mar 2018 05:26:19 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 4100D128C; Mon, 5 Mar 2018 11:26:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245569; bh=406JSY+Ea4pVqcP0CjRhs2QK4LhyYrgVQmBlKSFOhZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RX62EDQyXWjXvbcY7MKOVmeR4aAy/Fw1M7cHDO6cU0t+bSwcX7K2mZckXXB/lNgjj 64QVJ8bPynMDuACCczoy1lq7qtQvtIIdRaX6B2KfJlPGLowwWJ96BvBP22DRkou+L9 dhiRO5BX6Ir63F/vyz18ClOc+40dCexCKOdRRtrHzNvkt38sLvDJLr6+BHXNRpFEC3 OYm/j+kCK5Hczn/JjLrzND4yeuAixvC6YozvpogDYNY9h7QFSYiZVU2wVH/FPg6sr6 6OF2IwxYJ5z3mZzWCaadlY2RcUjDjTLts+vHSBE7Yw1F5SD+ym4D0bpa3cnhm86S2K FjnUMr6S6Xefg== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 22/34] x86/mm/pae: Populate the user page-table with user pgd's Date: Mon, 5 Mar 2018 11:25:51 +0100 Message-Id: <1520245563-8444-23-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520245563-8444-1-git-send-email-joro@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel When we populate a PGD entry, make sure we populate it in the user page-table too. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/pgtable-3level.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index bc4af54..ab2aa44 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h @@ -98,6 +98,9 @@ static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) static inline void native_set_pud(pud_t *pudp, pud_t pud) { +#ifdef CONFIG_PAGE_TABLE_ISOLATION + pud.p4d.pgd = pti_set_user_pgtbl(&pudp->p4d.pgd, pud.p4d.pgd); +#endif set_64bit((unsigned long long *)(pudp), native_pud_val(pud)); } @@ -194,6 +197,10 @@ static inline pud_t native_pudp_get_and_clear(pud_t *pudp) { union split_pud res, *orig = (union split_pud *)pudp; +#ifdef CONFIG_PAGE_TABLE_ISOLATION + pti_set_user_pgtbl(&pudp->p4d.pgd, __pgd(0)); +#endif + /* xchg acts as a barrier before setting of the high bits */ res.pud_low = xchg(&orig->pud_low, 0); res.pud_high = orig->pud_high; -- 2.7.4