From patchwork Thu Oct 5 08:28:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 148873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2016:b0:403:3b70:6f57 with SMTP id fe22csp411844vqb; Thu, 5 Oct 2023 09:18:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/ojhiEfT6uDImlD4M52JplxNzMPJ0XuQyD2PFaf93oJjGDojm5diZFBvY4VkRhhc4f+wT X-Received: by 2002:a9d:7751:0:b0:6c4:ac5b:aaea with SMTP id t17-20020a9d7751000000b006c4ac5baaeamr6067399otl.25.1696522728657; Thu, 05 Oct 2023 09:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696522728; cv=none; d=google.com; s=arc-20160816; b=Z79zRLDv4pytxjbKu7oCnE5Pu6+fgaIxs/tlYXk+0uuoKKMXvx8HRvO7tW9aIujChT ApOLf+autqhOsLXG3HC1gX5eZA2rPaCtBAwWnB/Dzpsv8D5qxwJtqLYtv2WEh539ggZt JINdOBGvzrmqrcgOSswlD9HimpwWx95Zwj58DY3SonWWJBtCp9mN4rANeTQTMiGhqTfH wlylHPyQFpyJ/hx+iOgHO9w1exTCC8jsKtUDERwA6v8mU4/9KuxfjxEpUvMesiLwDQh2 eKhGQGRCgV3J6/fNB/gOwR05XKx1kNstnNxHXbVuyD0eCHrU8sNN6O90BnTF0oiNWWzD BF/Q== 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=kQYKZeQP8pm0NjRWo5780Kw8NMCt/BBjxkH5yR+PxPw=; fh=Z1VpwkS8445X0w0bYeMALnHU25itmjxH7ofqPWG1qI8=; b=n3kJE7m6XlUKjlPMpRMOh2aD9DTBTFYmOySOFCaA5z8qyfluhyd9W3YeC/dS/s2h9K /voTh07HOegBbil6tGcZ8iB2xFs6udPhPGex2vG7w86GcifF5liC5ytiMcVl8WASep60 VO05Lnk4fc3Z3LdB26YHiPHWsIM5Dg2qC+BEXjucClYpWdkGkYaQwJHDy4f9jw6zBbZ/ AFPeuwI4n9zw5a3qf17SgknBrUJAeS8UolDNdyWGBxcztRyN1Iw0cUWaY88NXC+YbCGM wJwVYRHjnKxpk3U0LLrKQR9ZhikGAM4YuLhwPs1WroiVUJAGEHn2/k48co+buGPRo3Q5 lLaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kbiPrJx1; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 137-20020a63018f000000b00578acf1e8a3si1736463pgb.576.2023.10.05.09.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:18:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kbiPrJx1; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 505DB806AFE4; Thu, 5 Oct 2023 09:18:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241338AbjJEQOQ (ORCPT + 19 others); Thu, 5 Oct 2023 12:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238453AbjJEQMW (ORCPT ); Thu, 5 Oct 2023 12:12:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7215E8A6B; Thu, 5 Oct 2023 01:28:38 -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=1696494516; 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=kQYKZeQP8pm0NjRWo5780Kw8NMCt/BBjxkH5yR+PxPw=; b=kbiPrJx1bvBuyseYnFTGoQF+55CE9AnAKQB+xVEo1EYYhegUW8amTYnZlKbtzhpGRfszSX fJhdsdyElQX8umq5olyDov7OyILJN6eqxX+3JdpVq9uSfM5RniKcNzVQRwz5sFPpXRwGRK Ubh5MiXs5tlO16hfCoTi0IsGgt8jejoTLbyu5EZBN2xssSoj0aXDBWEf5tZ1NxIXZ1FJAr ricHYpoYKiad6N6CjreWVhTqyHVnIF1HeW8X1Wc5Z27uIQnuyit8Qy6FhEkCQjl11ZWHTc LWx6k9JV0VAdfjmMZbraD9rg4d3luieqeCZ9c9tdubx5lUsYX+bv8TFjNyOTVw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696494516; 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=kQYKZeQP8pm0NjRWo5780Kw8NMCt/BBjxkH5yR+PxPw=; b=LrXa3UOustYww++UDMFKZ7OOPP9T2KHeEkE8fDsMWEskHaKxs4s2b80JSp56A56MJIboA+ V6m+6P0Pv3Po8ECg== 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/compat: Combine return value test from syscall handler Cc: Brian Gerst , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230721161018.50214-4-brgerst@gmail.com> References: <20230721161018.50214-4-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <169649451603.3135.3339730852325076665.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:18:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772050356753443674 X-GMAIL-MSGID: 1778933016626377295 The following commit has been merged into the x86/entry branch of tip: Commit-ID: eec62f61e134d6711f98d4005c6439f24d03d54f Gitweb: https://git.kernel.org/tip/eec62f61e134d6711f98d4005c6439f24d03d54f Author: Brian Gerst AuthorDate: Fri, 21 Jul 2023 12:10:14 -04:00 Committer: Ingo Molnar CommitterDate: Thu, 05 Oct 2023 10:06:42 +02:00 x86/entry/compat: Combine return value test from syscall handler Move the sysret32_from_system_call label to remove a duplicate test of the return value from the syscall handler. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230721161018.50214-4-brgerst@gmail.com --- arch/x86/entry/entry_64_compat.S | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index 7015029..b162723 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -118,9 +118,6 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL) movq %rsp, %rdi call do_SYSENTER_32 - /* XEN PV guests always use IRET path */ - ALTERNATIVE "testl %eax, %eax; jz swapgs_restore_regs_and_return_to_usermode", \ - "jmp swapgs_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV jmp sysret32_from_system_call .Lsysenter_fix_flags: @@ -212,13 +209,15 @@ SYM_INNER_LABEL(entry_SYSCALL_compat_after_hwframe, SYM_L_GLOBAL) movq %rsp, %rdi call do_fast_syscall_32 + +sysret32_from_system_call: /* XEN PV guests always use IRET path */ ALTERNATIVE "testl %eax, %eax; jz swapgs_restore_regs_and_return_to_usermode", \ "jmp swapgs_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV - /* Opportunistic SYSRET */ -sysret32_from_system_call: /* + * Opportunistic SYSRET + * * We are not going to return to userspace from the trampoline * stack. So let's erase the thread stack right now. */