Message ID | 1531308586-29340-23-git-send-email-joro@8bytes.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 239EA603D7 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 11 Jul 2018 11:31:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2931A26861 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 11 Jul 2018 11:31:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D13B28844; Wed, 11 Jul 2018 11:31:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8F6826861 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 11 Jul 2018 11:31:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C416B6B0285; Wed, 11 Jul 2018 07:30:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BF6786B0288; Wed, 11 Jul 2018 07:30:15 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A7126B0287; Wed, 11 Jul 2018 07:30:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 3C7116B0285 for <linux-mm@kvack.org>; Wed, 11 Jul 2018 07:30:15 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id c2-v6so9864382edi.20 for <linux-mm@kvack.org>; Wed, 11 Jul 2018 04:30:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=YQx9cZdEuHeJE+gwrrn8Afu/0pGPh6Q3W4RpoMicy/s=; b=dPUNcP00X7VdGixienlL81NRvcKMWjdQCSGpj6p8bBlOWto0C8Po6gSYmE2MhxkhII Og7j/3cFy0uBlY+4VgD7q0up37qJojQCcP3MqL7LntjRfBvfTVWg9Q4HNhvqFDurOM2E 2uu9Qad4UH+o6rU3X8mSqWwRFDg4vqt/t96IydtooBTuu2GVtEh6PO4upCySjK3zvBbA 9OCiaqtzjX/+gex7+akhTuEueRpteZwBhv5QaLf6DD8jJinJzNKAFIHjE5TwSxAMGY2S qTfJVBl6R6pAyIZ9WkhOgfsHba09o1sRBQVpWwTIiXoN+hnOJMzroSr8De0HL2SCakNd LFUQ== X-Gm-Message-State: APt69E2KmV7pLPO+SwkSUxxfA0wRVYPmAHx+1VPjUooW2UW6VAe5g7i4 1Bsk1PIpv5jdObeaSwdbZwka5Mz0VBpjc06J6CBrLRk1Ngs/Q0mY4UZVp+Lvm6dBknYjMZn/kmC H04jv2QjujYJEwzwZNsO7gy8Ee4QCWydlmdwmaofgXATDIRCJgnyjz3IQbjJJi+UF0w== X-Received: by 2002:a50:f9cb:: with SMTP id a11-v6mr30599087edq.26.1531308614826; Wed, 11 Jul 2018 04:30:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftut3ZUkuj2mdnR5RP+yATVDX5Rs5EHG2/bt/kFcaSeyzGnSqZcTumivG2SPT+kYBDtU7F X-Received: by 2002:a50:f9cb:: with SMTP id a11-v6mr30599047edq.26.1531308614124; Wed, 11 Jul 2018 04:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308614; cv=none; d=google.com; s=arc-20160816; b=EtQbzG1Hpdky2kmZuEeO7NSlbnYdxfFGpFehXxI26DdjZ0tv3ksLqx/7VXICzZpLMH fZ47PmllzxMBUByD3FF2lmlZgAY2vM/GiTeRvYSV783cDZYBh0+zaWKCGLrpUeVbtwbF cm7WBKWm+fXZ6aSwAEPNWRH9SQToFSFx+bG/DB6YvwDexdGxTNo9BLVPRmm43w8Vvfhf B1L0D+pJTSae3exJ7cvUkSp1XJwd4Iy/jMoBlvJ0IonFGWmF1M7ovL+vHS8WbEb3N+9h d/c9BhYXAG7tLL4vMXlqVJ+A53C1gj4VqdeMwhnKskEyfvZ0cAwT+W8gyPeE4nKPle1G XS+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=YQx9cZdEuHeJE+gwrrn8Afu/0pGPh6Q3W4RpoMicy/s=; b=KSjYdki32niSdxkvh3SIm2KPnHVbaFeNqi20SdlBaSztN2dWzGAnPrXoODgmtb5ZjZ QhDUSg/Om1oZWXY/gXD48lXh9gdpGD+/nMY770fVWYAqHQ73VdVhh/UGe8UPIPq2hVCa h5H1vShzocWcdCSyStl8MPq5onBlfpv1rM2gFbw6n/6s0+5C67+Pop2xRKQBBycHl8EJ gJSYm0xS6+R/qr3bg7TMuLMX51E4tM8Ls5rZvXUVJgAT5Chr1Q+2Oc/Ph9koUF9mV16Y KrLiVqGgeis5Ys22ThNUTFh9j10DyqY4i51XHbKGFpM3e0bc4goYQGSVw+qAMec8mufi XAnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=Wn+CJu39; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id l62-v6si740758edl.257.2018.07.11.04.30.13 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 04:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=Wn+CJu39; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id E48569DB; Wed, 11 Jul 2018 13:30:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531308604; bh=DSRqcm2/h0MeJA2B6bB5atAwDqT3xDCIA/VjkOUJHKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wn+CJu39w8N4OE2sRBKUdViOJK23vEWNB1sbYkKdKhvGjO7Ljqx3QKGNgw/rzQeA4 6rN55tsJbVuHkTdCzk4atgEdQLBy1VuhrgpXTB21d9PjkcDCN2Mhuzh+He2PfrkuUX 90e3seXfSUCA81Ai+6+wSta5KTc48479mN4Tml3Cq1SfPRc6ellngKWZJWfgK00Nq0 q88hPRGqvnDN3/V32lb/skULJdtDcx8TqoESRLdZwGA1ov9uBBWi9+hZ8/aSQdRyIO CsfMhXIurk3/WStqpm81NPAp6C2C5J1vwuscArE4NUri2j6yb8ngJu1UomVHb9ME8K ty0Qk/gRyRXOQ== From: Joerg Roedel <joro@8bytes.org> To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>, "H . Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds <torvalds@linux-foundation.org>, Andy Lutomirski <luto@kernel.org>, Dave Hansen <dave.hansen@intel.com>, Josh Poimboeuf <jpoimboe@redhat.com>, Juergen Gross <jgross@suse.com>, Peter Zijlstra <peterz@infradead.org>, Borislav Petkov <bp@alien8.de>, Jiri Kosina <jkosina@suse.cz>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Brian Gerst <brgerst@gmail.com>, David Laight <David.Laight@aculab.com>, Denys Vlasenko <dvlasenk@redhat.com>, Eduardo Valentin <eduval@amazon.com>, Greg KH <gregkh@linuxfoundation.org>, Will Deacon <will.deacon@arm.com>, aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli <aarcange@redhat.com>, Waiman Long <llong@redhat.com>, Pavel Machek <pavel@ucw.cz>, "David H . Gutteridge" <dhgutteridge@sympatico.ca>, jroedel@suse.de, joro@8bytes.org Subject: [PATCH 22/39] x86/mm/pae: Populate the user page-table with user pgd's Date: Wed, 11 Jul 2018 13:29:29 +0200 Message-Id: <1531308586-29340-23-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531308586-29340-1-git-send-email-joro@8bytes.org> References: <1531308586-29340-1-git-send-email-joro@8bytes.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index f24df59..f2ca313 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)); } @@ -229,6 +232,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;