Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6913949yba; Thu, 2 May 2019 00:13:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6TRowyz1N22vmLPpIftca2/lcoYzcH1Trxxz9xf0F4Ia6BeqjwR8sbaKK/X+wNWJHZixd X-Received: by 2002:aa7:8851:: with SMTP id k17mr2436825pfo.121.1556781238059; Thu, 02 May 2019 00:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556781238; cv=none; d=google.com; s=arc-20160816; b=z/GEywD86YOZ2kuv1fCVZe5MqykxGNcmnVTTPT+Fj9iXpJNypDAuR2EEWM0gmIoqTp PqLz3qcUgDJQQnghBPlhsqEghfGk0iJJgeADh6txPkWK76+T93AvKl3HJu3XSRy56Ov8 +dTGmQ52R9agl23HnD8bClMsLDCzN5orZEzT8qEaufdO3Zldqa71K6gq5KxCjwxfmocj JLmD/5iwG5CMAYdlHEWl33MRBxPYeE7WIHsLR+rZLOPMLCSwkJWRHjW5cZgRTrjpP/K9 IvAs88QE8n04/KPQoyciyd9wB/pRsO/4DtSqb+W+HW7CI52d1KtpjOES0zHDyIM0FjD6 smEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zAXLPjGujT6Na6Fx5FR5OHTWfQ8Sl9PgNJoSP5Q6+xc=; b=lwPVIt/7HJZ5zMyioEVO0cRU9wLqlvCGMp/6QimLZOREA5mzcIUkaAmj46QxKXaGbX 0jMPo6H/4iRs0BSXKSJ1dMsA13cqiZcd8mmS20keQDqYFa+Rm8JvOD9CdHD2HH86pwwW mPbEvsyEY69OgAPvohpoSINqMyUXrE9BWgFngKyyFQ2pbC/IHkTJUvNw2Pi/oFMBbGsp 5YmBWW8ClMePGeUxirgVPM+OG8oMOCB6z2PSti1mxsnPav6UhLWtLX11CS77/57lByG3 yJEHQ7jtjJwkIdAlB14kv7gZm399g+CmrOnVX+Z4P9LseXjxXJUtnIBq4TEpndvGQNGo t/+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Xj9wvu/s"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si43493955plb.346.2019.05.02.00.13.42; Thu, 02 May 2019 00:13:58 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Xj9wvu/s"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbfEBHLE (ORCPT + 99 others); Thu, 2 May 2019 03:11:04 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34103 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfEBHLD (ORCPT ); Thu, 2 May 2019 03:11:03 -0400 Received: by mail-pl1-f196.google.com with SMTP id ck18so615785plb.1; Thu, 02 May 2019 00:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zAXLPjGujT6Na6Fx5FR5OHTWfQ8Sl9PgNJoSP5Q6+xc=; b=Xj9wvu/sdmDisAwYpAw4EuInNNPgHsMvheqhZ7h7EyF1oIPFs2yhJuDenCQk43p2E3 7+9mpBVgOvDcTHSdah4n1VyVchpnDO9rllSQOc5sy4AH4LWgAZcZ0gtTiyh0bsv72waz T2R8ebYk3pjZl3rC9smphDAdNCXBoK4rpU19KWUhD6XskZHIW/b7TO+Dw859ZOYMQLVf fOGMP1+0XiXcLZK1fvBWgHsbxmOM+A98SlbeyuNW2/1BfxNnjRfm3qjbsyfLCc2Sz5bo dZZUSseyukMet3pMxdLa48BtCC/sh4eFtFk9fkDkocNORxyB8AU8YVtpUH89RDJuhrah VJDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zAXLPjGujT6Na6Fx5FR5OHTWfQ8Sl9PgNJoSP5Q6+xc=; b=mEtOIZdneFnOsbsMQGBPO2V5GTc/bhxxZB7BSOKAQq0uiLplvi8ltne/vw3DLyZYda zE5jvWdgnYht6NfOp0OL4s42CFwA9115Rq+LoDbUJ+CUaVEf6dCDsxPaPgaLrkxvcOOY DqjKk0ZAcSwy7mP3zTCSJhdYfJpl+L55uS061+Pk7/heSKZvdApvxTRXUNvW9Ge9JpCA tRP07mS/GKeBPuBO2H/wGQ+zWaLSCJXVKA9219vT6c+jmwYd2PZPqcqlIMScLP1CaYBl sBbp3wJR7OaPFrwAv/p1LN1IQxjz4rPxlWtFXYnACBA8TLCsE5ZoNunKI+pCNyHBoGOz bePQ== X-Gm-Message-State: APjAAAV4U7haovC/tUEemtQmpYrVDtz4PxTogTO/2h22Fn0wtG4i71jt 6uj98sbdIKJvnADkDmj4+tY= X-Received: by 2002:a17:902:324:: with SMTP id 33mr2108195pld.246.1556781062321; Thu, 02 May 2019 00:11:02 -0700 (PDT) Received: from laptop.DHCP ([104.238.181.70]) by smtp.gmail.com with ESMTPSA id u24sm4686976pfh.91.2019.05.02.00.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 00:11:01 -0700 (PDT) From: Changbin Du To: corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du , Mauro Carvalho Chehab Subject: [PATCH v2 15/27] Documentation: x86: convert pti.txt to reST Date: Thu, 2 May 2019 15:06:21 +0800 Message-Id: <20190502070633.9809-16-changbin.du@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502070633.9809-1-changbin.du@gmail.com> References: <20190502070633.9809-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Changbin Du Reviewed-by: Mauro Carvalho Chehab --- Documentation/x86/index.rst | 1 + Documentation/x86/{pti.txt => pti.rst} | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) rename Documentation/x86/{pti.txt => pti.rst} (96%) diff --git a/Documentation/x86/index.rst b/Documentation/x86/index.rst index 85f1f44cc8ac..6719defc16f8 100644 --- a/Documentation/x86/index.rst +++ b/Documentation/x86/index.rst @@ -21,3 +21,4 @@ x86-specific Documentation protection-keys intel_mpx amd-memory-encryption + pti diff --git a/Documentation/x86/pti.txt b/Documentation/x86/pti.rst similarity index 96% rename from Documentation/x86/pti.txt rename to Documentation/x86/pti.rst index 5cd58439ad2d..4b858a9bad8d 100644 --- a/Documentation/x86/pti.txt +++ b/Documentation/x86/pti.rst @@ -1,9 +1,15 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================== +Page Table Isolation (PTI) +========================== + Overview ======== -Page Table Isolation (pti, previously known as KAISER[1]) is a +Page Table Isolation (pti, previously known as KAISER [1]_) is a countermeasure against attacks on the shared user/kernel address -space such as the "Meltdown" approach[2]. +space such as the "Meltdown" approach [2]_. To mitigate this class of attacks, we create an independent set of page tables for use only when running userspace applications. When @@ -60,6 +66,7 @@ Protection against side-channel attacks is important. But, this protection comes at a cost: 1. Increased Memory Use + a. Each process now needs an order-1 PGD instead of order-0. (Consumes an additional 4k per process). b. The 'cpu_entry_area' structure must be 2MB in size and 2MB @@ -68,6 +75,7 @@ this protection comes at a cost: is decompressed, but no space in the kernel image itself. 2. Runtime Cost + a. CR3 manipulation to switch between the page table copies must be done at interrupt, syscall, and exception entry and exit (it can be skipped when the kernel is interrupted, @@ -142,6 +150,7 @@ ideally doing all of these in parallel: interrupted, including nested NMIs. Using "-c" boosts the rate of NMIs, and using two -c with separate counters encourages nested NMIs and less deterministic behavior. + :: while true; do perf record -c 10000 -e instructions,cycles -a sleep 10; done @@ -182,5 +191,5 @@ that are worth noting here. tended to be TLB invalidation issues. Usually invalidating the wrong PCID, or otherwise missing an invalidation. -1. https://gruss.cc/files/kaiser.pdf -2. https://meltdownattack.com/meltdown.pdf +.. [1] https://gruss.cc/files/kaiser.pdf +.. [2] https://meltdownattack.com/meltdown.pdf -- 2.20.1