Received: by 10.223.185.116 with SMTP id b49csp2474913wrg; Mon, 5 Mar 2018 03:37:47 -0800 (PST) X-Google-Smtp-Source: AG47ELtkXnVmcU+ZaN633lgbjchKDgzJT7PDt8p3d00lrA9sDiCy2II9Qauvug2gtS847+PuVS4S X-Received: by 2002:a17:902:167:: with SMTP id 94-v6mr12983384plb.294.1520249867708; Mon, 05 Mar 2018 03:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520249867; cv=none; d=google.com; s=arc-20160816; b=OS9Lq2VC6CKQNCRUSV2r6gKC76zVfPQ8RU6U2vUW8Z4cnAr02QhcyX79gpzk1jittv lNfTFljAPjfzCfv+jp10ZCohlK/UmDaefYAZzrCcv0kUxJB05H48zzVJfGCErKMkOEYg XgZQKthVT1ssknvdFuEF2t5abBpV0H5sE5K6TKTmy49lpzbsaGQa6RX6qRZWAjzA1n69 cFzED0BXpV+fjDwxExBZIwoA94a7r9uJWm0VT3fGaQm0vz8Dh+cMQrcIQ7Q90A7IVEx8 licVVEVRy2jK81cJq0lM7qVHEsbW2Y5Qv4Lnz0OAphux2S1ZQNAZ4CpnEFCW52MDnpk/ OS4Q== 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=59MhfMU72c18caWRDgmz/TzHGVoGLjlnnaF4XkAcR74=; b=TSW/hIIZqM7eEfO4ESv+oDhhtEwcZXCFqjS4jvtUuQkvxvExOzsLj1iqiaBH3nSgiD VGSjrlwLVJ3sA4P/+tnUIJeMXp9N/RfiR1N9gGd5hcoMczgKtLZYF52dWlnATs3p2jSi 4O5mhj43cnIezW5GQhH0gfXChGRTVfAZJxeFaPl1ThOSrpDuDZDIypi0ndStd9XFzsHy MJfJORzJN/4fXLGrqk02ZqV+vxCbOmB98Fpc6VpRvNtgHTsDARxuayaVh77qvwiqD7Fj 7Pt/y6v6vjhrdQgJnR/YnT5MRsZwxWdFjkEmdzuWmVNzMxO42+Z9xIcIHoh+xK05YN5W zM4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=Cx1hIp5A; 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 h186si8193175pge.814.2018.03.05.03.37.33; Mon, 05 Mar 2018 03:37:47 -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=Cx1hIp5A; 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 S934190AbeCEKb3 (ORCPT + 99 others); Mon, 5 Mar 2018 05:31:29 -0500 Received: from 8bytes.org ([81.169.241.247]:54736 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933024AbeCEK0Q (ORCPT ); Mon, 5 Mar 2018 05:26:16 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id C4AE1BEB; Mon, 5 Mar 2018 11:26:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245567; bh=umf2p9zMXU5JsIUke5iOiboS0aw/+aqGVN4vkxdDGGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cx1hIp5Acq76N1uNZrAIkNkWMY7gCbaQqvdtaGDBS5Lz1qM6MgLXYZ8jrkzYRk8aX Htg4ePKghKxa33wXR82zUjlhE/My4fhV1i7MVhnOo+DbY1bpxDOQ2bygTz0rEDYtmC o8Qyppmwu4n4o41CgFkwVQPlU2DDqAu4GpYTufPV6ftuUQ7Z5GZw0RkicMr0XTO3AS OTo1H2Tj+QemFC/RWvvV2jkwhT8E4DskIDZsEk0dXXr3K1TRS+X0hE9tChf2m7eKuM n6TldI7IVS+v/leN01rlbIZMBQiq6ILl96/RGuM3tcxncLHv95v7f7/HRGFaxKtyza U4op1BKW1/LoA== 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 16/34] x86/pgtable/pae: Unshare kernel PMDs when PTI is enabled Date: Mon, 5 Mar 2018 11:25:45 +0100 Message-Id: <1520245563-8444-17-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 With PTI we need to map the per-process LDT into the kernel address-space for each process, so we need separate kernel PMDs per PGD. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/pgtable-3level_types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/pgtable-3level_types.h b/arch/x86/include/asm/pgtable-3level_types.h index 876b4c7..ed8a200 100644 --- a/arch/x86/include/asm/pgtable-3level_types.h +++ b/arch/x86/include/asm/pgtable-3level_types.h @@ -21,9 +21,10 @@ typedef union { #endif /* !__ASSEMBLY__ */ #ifdef CONFIG_PARAVIRT -#define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd) +#define SHARED_KERNEL_PMD ((!static_cpu_has(X86_FEATURE_PTI) && \ + (pv_info.shared_kernel_pmd))) #else -#define SHARED_KERNEL_PMD 1 +#define SHARED_KERNEL_PMD (!static_cpu_has(X86_FEATURE_PTI)) #endif /* -- 2.7.4