From patchwork Thu Nov 2 13:02:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 160873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp334396vqu; Thu, 2 Nov 2023 06:02:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtxzWMHBqw+IbRrANb4BHGa6d1UNF4RWu9GNDrWJRVCaX1+1+x5jRYz/xD7k4049igkCZg X-Received: by 2002:a05:6358:7e07:b0:169:98e4:af72 with SMTP id o7-20020a0563587e0700b0016998e4af72mr6305140rwm.2.1698930162954; Thu, 02 Nov 2023 06:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698930162; cv=none; d=google.com; s=arc-20160816; b=gKJ44h9pBL0JBiJlRre5Woea1reNm3cpal6MgxRPMj5HlmbGg3DeAmh1Ce78HJgsZe 5luhkhoIIxhDgr0w0woBBZaNDt6J3YGmHNgM3WAric8MIeD+2rU1SoaDivkb10rpU0cT lWrbDK0qUKgxydc0ZaO3ZiRhs/oCGT9JYdYHudvzn1sTk5mmYUYUeDaeKaJTvbYibF6z QjFMc5DXclaoOt7YOiOQ9dIaNFeH7RyZaWK306obp0EfeI5LPEfwFi9s4JZZZmdWcHoI UwjDrJP3rHWzpJBCBSnzjfwZ+fl5S+Yewg358PPUs4IzKPF8qMMn2uozQ44hJQkDXOCx DWRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nwOAu+lvDKzMgzPr8m1BY5NSLiFclCMWdwSry0oMoMQ=; fh=3oqmXZz3zAtU6dvnqgFUfLvaDqubDXen/oWOzajCuT8=; b=yqpCGDluwnvnljzuEihn9MO9/KcOULYpp4yPV+rzGsxsFr/aA1WQyLjH5EpwzmkHQe zUEajyh7fNwjnKSzOhjotJKm02DEGx7qwTeDaevjjeHmpW5kJnE5e7aOYRK3YpX1AOS+ VOk15NBwTfQdLvtrk0QvBHjceQeWZwpUylSuABUjmV1CMk/Z/CDdmjdUx8j1aGckvSg5 h10gZdrUovDRG7YsHzHvdMHakGCT7JBWxClQClps61gRqEbJmR23god2HeZyyFvvQD3R uJjS7P/uMHcHXLwUpnvpZA9CIym+YIDY/yFh1g31Ft3JfzCi5zN7W1che1oeMH7Mw6by yL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=d5vhxMYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id cn1-20020a056a020a8100b0059cdf90b9b2si1686838pgb.685.2023.11.02.06.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 06:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=d5vhxMYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E3968821A142; Thu, 2 Nov 2023 06:02:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345965AbjKBNCO (ORCPT + 36 others); Thu, 2 Nov 2023 09:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjKBNCN (ORCPT ); Thu, 2 Nov 2023 09:02:13 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF792FB; Thu, 2 Nov 2023 06:02:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6AE201F8C8; Thu, 2 Nov 2023 13:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698930126; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nwOAu+lvDKzMgzPr8m1BY5NSLiFclCMWdwSry0oMoMQ=; b=d5vhxMYvPTW6u7j/olDef3dOle+DhmrULu1M0lAstoMmV+ZsdiD8j4j03gEpbMhPRPv6Lo 6/Uz6kqZfJDWB7+T82ab+9ARKGgx5Fqrq+6v8QwMH8aOdqRn2LSQcrBcMiu4NMcPKZ23Gh n0llD+JxFPkggRxYt4S3/u0EAj7v6QM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 02AE813584; Thu, 2 Nov 2023 13:02:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CZivOc2dQ2XQWgAAMHmgww (envelope-from ); Thu, 02 Nov 2023 13:02:05 +0000 From: Nikolay Borisov To: corbet@lwn.net Cc: tglx@linutronix.de, bp@alien8.de, x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolay Borisov Subject: [PATCH] docs: Remove reference to syscall trampoline in PTI Date: Thu, 2 Nov 2023 15:02:04 +0200 Message-Id: <20231102130204.41043-1-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 06:02:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781457394716169340 X-GMAIL-MSGID: 1781457394716169340 Commit bf904d2762ee ("x86/pti/64: Remove the SYSCALL64 entry trampoline") removed the syscall trampoline and instead opted to enable using the default syscall64 entry point by mapping the percpu TSS. Unfortunately the PTI documentation wasn't updated when the respective changes were made, so let's bring the doc up to speed. Signed-off-by: Nikolay Borisov --- Documentation/arch/x86/pti.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.34.1 diff --git a/Documentation/arch/x86/pti.rst b/Documentation/arch/x86/pti.rst index 4b858a9bad8d..e08d35177bc0 100644 --- a/Documentation/arch/x86/pti.rst +++ b/Documentation/arch/x86/pti.rst @@ -81,11 +81,9 @@ Protection against side-channel attacks is important. But, and exit (it can be skipped when the kernel is interrupted, though.) Moves to CR3 are on the order of a hundred cycles, and are required at every entry and exit. - b. A "trampoline" must be used for SYSCALL entry. This - trampoline depends on a smaller set of resources than the - non-PTI SYSCALL entry code, so requires mapping fewer - things into the userspace page tables. The downside is - that stacks must be switched at entry time. + b. Percpu TSS is mapped into the user page tables to allow SYSCALL64 path + to work under PTI. This doesn't have a direct runtime cost but it can + be argued it opens certain timing attack scenarios. c. Global pages are disabled for all kernel structures not mapped into both kernel and userspace page tables. This feature of the MMU allows different processes to share TLB @@ -167,7 +165,7 @@ that are worth noting here. * Failures of the selftests/x86 code. Usually a bug in one of the more obscure corners of entry_64.S * Crashes in early boot, especially around CPU bringup. Bugs - in the trampoline code or mappings cause these. + in the mappings cause these. * Crashes at the first interrupt. Caused by bugs in entry_64.S, like screwing up a page table switch. Also caused by incorrectly mapping the IRQ handler entry code.