Received: by 10.223.148.5 with SMTP id 5csp6566440wrq; Wed, 17 Jan 2018 15:42:09 -0800 (PST) X-Google-Smtp-Source: ACJfBouCn5tU8Xe7NHekxeKwswfm4C2A0gNWNvfPk48yiLL5BbLjp1CrmqaZSWJb5kLJSjks+FH9 X-Received: by 10.98.156.71 with SMTP id f68mr20739161pfe.29.1516232529525; Wed, 17 Jan 2018 15:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516232529; cv=none; d=google.com; s=arc-20160816; b=fINphuG8hJBUZPoW4wdnUbxdMvhcLwnRhvlj/J+3y71jdRm31HJCM4ATP/GggMml7b FHVjwowUyNpOpXbY76EmTOaK46qqZ7OfgldZXqftd3bdS6niGteIUTPJg0AUCrIG6Un6 Jt2L+coQt30i6aQOusRqA57bEKqK3mLtREgXZ3q83GdlBOk29nmEYRrOulZiVUKB2ewD a5Cyl/zLoYBmqAbt0/2BOap2vh+4yj1x/gvwBRVxKq+12voYNAZUlvRHHX0dtivuw86F voDKnW0Vn4IfBBqULiyuLAThwI+0Xrczzh3rizsFQ6b6xrKliIezujuz7wVHsr8r9E0K dM/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=niAD9NYfbUKL+MjwB792Z9xPCF6Da9XSWbj1qAvBSEc=; b=0zPKmK4T2rRrj9g+0P/46Z2ARPG1sEUDFsEXqZb0hOY5Fl4XitIt2NEiGNLOnBf/4m JfRH/0X4lPQCZ4kPE+a3BmVZPdbxOBHAmrKUwyvWH0TNGsDjejNUaQZ8XKA6vIyb8aiT /RKdR0eob22r56a3W9U/BYY8jIZPf1ozyz4byEoCdavbQx4hZMBa4GSLvIIJ7H5em+0V KdMasMcPAYNHcbCZRGdBA/6DiP5PAwJiYsCQydW3tZF3F/fsjR023SUqcdHKvL2Xz1gt 2irLyCS+Wy15ilCer7avdykxXOR0sTrOqEw8qb/2iY1oO3SfyPKfoTax49Anlpjq0PyB /ZPQ== 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 e26si4600248pgv.505.2018.01.17.15.41.55; Wed, 17 Jan 2018 15:42:09 -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; 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 S1753968AbeAQXla (ORCPT + 99 others); Wed, 17 Jan 2018 18:41:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:59284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752791AbeAQXl3 (ORCPT ); Wed, 17 Jan 2018 18:41:29 -0500 Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7BFD2177B for ; Wed, 17 Jan 2018 23:41:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7BFD2177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-it0-f53.google.com with SMTP id b5so11323677itc.3 for ; Wed, 17 Jan 2018 15:41:28 -0800 (PST) X-Gm-Message-State: AKwxytcIkNXBR2eLmeskhJj2TMzIkcZa+vdbYY/wug87o58Pe8O2PWDN pZXwEIXWnuFePPrt42A2Ft2X3rbAWpLhVscP2C+z+Q== X-Received: by 10.36.108.13 with SMTP id w13mr10472550itb.109.1516232488286; Wed, 17 Jan 2018 15:41:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.152.114 with HTTP; Wed, 17 Jan 2018 15:41:07 -0800 (PST) In-Reply-To: <1516120619-1159-15-git-send-email-joro@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-15-git-send-email-joro@8bytes.org> From: Andy Lutomirski Date: Wed, 17 Jan 2018 15:41:07 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 14/16] x86/mm/legacy: Populate the user page-table with user pgd's To: Joerg Roedel Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , 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 , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 16, 2018 at 8:36 AM, Joerg Roedel wrote: > From: Joerg Roedel > > Also populate the user-spage pgd's in the user page-table. > > Signed-off-by: Joerg Roedel > --- > arch/x86/include/asm/pgtable-2level.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h > index 685ffe8a0eaf..d96486d23c58 100644 > --- a/arch/x86/include/asm/pgtable-2level.h > +++ b/arch/x86/include/asm/pgtable-2level.h > @@ -19,6 +19,9 @@ static inline void native_set_pte(pte_t *ptep , pte_t pte) > > static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) > { > +#ifdef CONFIG_PAGE_TABLE_ISOLATION > + pmd.pud.p4d.pgd = pti_set_user_pgd(&pmdp->pud.p4d.pgd, pmd.pud.p4d.pgd); > +#endif > *pmdp = pmd; > } > Nothing against your patch, but this seems like a perfectly fine place to rant: I *hate* the way we deal with page table folding. Grr.