Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp337799rdb; Thu, 5 Oct 2023 07:27:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiujZb8TG7tTvulgR5pk3Kh6tBxYiVxv3Q26AI0Lok2f/XFrlvll02P1PESd4hzbOBoToF X-Received: by 2002:a17:902:c946:b0:1c3:e3b1:98df with SMTP id i6-20020a170902c94600b001c3e3b198dfmr6044460pla.52.1696516024392; Thu, 05 Oct 2023 07:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516024; cv=none; d=google.com; s=arc-20160816; b=tG3+sssd7mavZ6R1CmQrwOKpKjbZ2v7q99x+PJUwcVDBbCQHEOgxpltn4PlccVt9wF 1d7AlzSVqhwOG5KnrIxTJrWHHzbeTRFrVlvKZcQMfE9waSqi/GeAj5CpeKMqMRzNIcLo FstLVlzjYa0/camAo4/BZWNTyv3NpYWNXpBQDvkAJiO0LY5XhPiY7UENYOfsKhjhTCF3 Cl4E26UdrShYHi+dAmIfZAVr7tvS/wc9jDgzQo9/XrvvZorGUal4YSo+4yCL16Fcj0gZ 7sLHM3ijhqYkUN1VlaS0MSeq5O3JkgoFJoVI7r1MsbCOhHbQG70TY1SxdRLwwedvloWx 6dAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=evv78FngNWctCCQEqys9FY9hmwWT89p4vAJNsmIFnPQ=; fh=wFnicNmHvAcvy9ic2dM2Yls9LLSGIrhlsmizWYA3+V0=; b=DTzEMvcwSzKhNBMP6ZgxiGPCcRAXfkomlFIv6NZbO2cqZSytXduBITgDQ2iiSXkME0 aPESqtq6bmpntTvZg3/Pw016aL4s6zx13IcLTtVGPtUuoga5d3WMlHXNAs9cuP/psyHG iypsqCUBNg669k6iPDTa2glymkMGL3HP4Ju4QCAFlXVq0PmIcWwG/6NWgDBn/a8iWs+2 x7NVwGxdOoy1cY9fMHW3KIxrbqxk+ilBM3AJlvfjSo1HekZM/SunCvRePCFd/mmft3I6 rdCq5SqQ4/L9B8GqT0icGpPk501Ic6Rdr4SZ+NRfmRMpBmPmpv7xupwTaiJd8g52hEWO uGaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aObYPq5u; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5olFckmS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g11-20020a1709026b4b00b001c426636990si1479430plt.637.2023.10.05.07.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:27:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aObYPq5u; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5olFckmS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EFB0E819FC32; Thu, 5 Oct 2023 07:26:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234019AbjJEOZX (ORCPT + 99 others); Thu, 5 Oct 2023 10:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234663AbjJEOX2 (ORCPT ); Thu, 5 Oct 2023 10:23:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72A488A6E; Thu, 5 Oct 2023 01:28:41 -0700 (PDT) Date: Thu, 05 Oct 2023 08:28:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696494517; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=evv78FngNWctCCQEqys9FY9hmwWT89p4vAJNsmIFnPQ=; b=aObYPq5udMMfdIGZTa6kExWAL97kTfvpDf0PUvExGbpnJItcBgr3hihVemDnGJs2xKylUO Ewj5jkyhwpEcOkzfar04mYCplHjOSK/gwOqCh8Jje9a97Js/NiI2HMpJ7FqaUvzL8easUk HCjsyQH/LoJv91BcCcQfg5jLxmp7+R+5GClvXtpJFT/zbGapevsuWuu69uv1/0aKHhp/lZ +81Xv/3T2I7lRKMvQyGDOFYO596MYw0GoAWiL7PLjkA1AVxJAuHiT+vhJaw5wRwp2i7sKz 3KN3xkbJi6Ed6pvQWO7MBxZ//2b9PmM7sHIg/8Jl1y5z/FXKnQgqPsAyZgpjlg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696494517; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=evv78FngNWctCCQEqys9FY9hmwWT89p4vAJNsmIFnPQ=; b=5olFckmS8ifLH2QY1VVYjppNKgUwC/cjygXTXciZV4oXgZmwdU3XCFU8qI/omCPK6myLNi qi1YS26NDE8n40Cg== From: "tip-bot2 for Brian Gerst" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/entry] x86/entry/64: Remove obsolete comment on tracing vs. SYSRET Cc: Brian Gerst , Ingo Molnar , Andy Lutomirski , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230721161018.50214-2-brgerst@gmail.com> References: <20230721161018.50214-2-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <169649451666.3135.702628742900040217.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:26:38 -0700 (PDT) The following commit has been merged into the x86/entry branch of tip: Commit-ID: eb43c9b1517b48e2ff0d3a584aca197338987d7b Gitweb: https://git.kernel.org/tip/eb43c9b1517b48e2ff0d3a584aca197338987d7b Author: Brian Gerst AuthorDate: Fri, 21 Jul 2023 12:10:12 -04:00 Committer: Ingo Molnar CommitterDate: Thu, 05 Oct 2023 10:06:42 +02:00 x86/entry/64: Remove obsolete comment on tracing vs. SYSRET This comment comes from a time when the kernel attempted to use SYSRET on all returns to userspace, including interrupts and exceptions. Ever since commit fffbb5dc ("Move opportunistic sysret code to syscall code path"), SYSRET is only used for returning from system calls. The specific tracing issue listed in this comment is not possible anymore. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20230721161018.50214-2-brgerst@gmail.com --- arch/x86/entry/entry_64.S | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index f71664d..7574639 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -166,22 +166,9 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL) jne swapgs_restore_regs_and_return_to_usermode /* - * SYSCALL clears RF when it saves RFLAGS in R11 and SYSRET cannot - * restore RF properly. If the slowpath sets it for whatever reason, we - * need to restore it correctly. - * - * SYSRET can restore TF, but unlike IRET, restoring TF results in a - * trap from userspace immediately after SYSRET. This would cause an - * infinite loop whenever #DB happens with register state that satisfies - * the opportunistic SYSRET conditions. For example, single-stepping - * this user code: - * - * movq $stuck_here, %rcx - * pushfq - * popq %r11 - * stuck_here: - * - * would never get past 'stuck_here'. + * SYSRET cannot restore RF. It can restore TF, but unlike IRET, + * restoring TF results in a trap from userspace immediately after + * SYSRET. */ testq $(X86_EFLAGS_RF|X86_EFLAGS_TF), %r11 jnz swapgs_restore_regs_and_return_to_usermode