[v13,28/35] x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled
Message ID | 20231205105030.8698-29-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3359828vqy; Tue, 5 Dec 2023 03:24:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFjzfwFDuK7OFJlLuXzMjCSn4tLCqchjqmm6nyIXzPfcs5sgSAJGcrmzhFKiGL0SmhryMg X-Received: by 2002:a05:6a21:329f:b0:18b:4f8b:5a05 with SMTP id yt31-20020a056a21329f00b0018b4f8b5a05mr1489852pzb.30.1701775445585; Tue, 05 Dec 2023 03:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775445; cv=none; d=google.com; s=arc-20160816; b=rskprlpc+J/t0nDsZGUK4BDe0WKhj6AOImPtZP9KhJCfx9tHmxEw0d2xWy+GiGtJur B3yIK3C17jTRaGDKvYPnOISpny9WF1J8t6Cam6FmnYN4GVOgnxor85dRMFuf8zmmnHmc n4mcGShp7J94dCO8o0mtT0+W1+XftFNSpMc8JKbKlPmNJk5zdd0WNZpX3+sc+E/ZxWSS iwz+HxiCEWLwwkth4RCmkYjobfK9tSC8FZkCgx0q+VEekZ832TQYg7t0l4G/WxMVfC+A ZL1s2dcC+pDv6Yi4DDV+6rdDc3z0ePu8LFyQddAZA2zdSfDt91VcInwI88xemNa5Dj7u i8kw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e7QBTyWf6f8HYiRZ3zjqYVW7kKRDmMfHFlg+voG+etU=; fh=uCCWEUVpLc/xDP/D3WvGY/BxHU9d0NQYu/T71GEsNmA=; b=uiT0J79IDAYpZZSM3rl+ygcqKIN9BsoVeeXC1q2rkC6Yb2a5X75MwUQexJuIx0vfKD gFe7C5PXO2UK64QT2WgPbx7X4PJP7fsC2+rsT9BvKyF7eUNNXExmp2zKoi7u1w7gCLI2 +ZxAY/fqp8EbVGKYhU8iR8SIfqYzrc5mrzUpeFXANb3+cCUi1oTE87HHdfjoFEue6J56 O2vAmMud6/1bLtY/KfDdbBWgF65vVS8m6aczqLEeVP1PsnqBgONFldDLYSlNyMmAQzxe Yme6b7qd+nYXx69RaDT5hmUBzqlQRXKLguSQ2DgIswiTXF9mzZEi8wpdMivnLQajZqlt wCnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="T/OK1cUy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a23-20020a63e417000000b005b8f24e6525si9440144pgi.81.2023.12.05.03.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:24:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="T/OK1cUy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 77EEE8131C09; Tue, 5 Dec 2023 03:23:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442153AbjLELWn (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Tue, 5 Dec 2023 06:22:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442166AbjLELVk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 5 Dec 2023 06:21:40 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54BCE129; Tue, 5 Dec 2023 03:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775294; x=1733311294; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WNry4Fzy15Ftidcudz/wq0ei+oIMjP7Ry/4o5mJqLAU=; b=T/OK1cUyrWa6Hvq2uNLy0GxZgCSaHa4oOwNCFT9CdaSnQ6zoTbwFASH9 lxELjIt/MVUOM5MhVBPx/wTlZ5re76MjF0fBCTlf7LgavKQPuUQjqaAlW gMlXJ0690Tl3MZeLI3ntJ3ZZZhWoaOkb6aoPmjXahC209fW+ed+M0toEk fFbjG2+EKQh2sFgxnNTYn/d+GmXceHH2PGPRhy8PsJKm8hPTZbcmenHVk v8rphlWeKsv13ih3J2eurKveE+uB4hQ0KujKdQWQt1YapmCkYQoZUQvTO nBxFN39cVdWh3J/cudKr2kr4lMsUUaKR6CCY6iw0YAn+DKsjI+1hZqhed A==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942645" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942645" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:21:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192998" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192998" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:24 -0800 From: Xin Li <xin3.li@intel.com> To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com, nik.borisov@suse.com, shan.kang@intel.com Subject: [PATCH v13 28/35] x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled Date: Tue, 5 Dec 2023 02:50:17 -0800 Message-ID: <20231205105030.8698-29-xin3.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205105030.8698-1-xin3.li@intel.com> References: <20231205105030.8698-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:23:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440889941421256 X-GMAIL-MSGID: 1784440889941421256 |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Dec. 5, 2023, 10:50 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled, otherwise the existing IDT code is chosen. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Shan Kang <shan.kang@intel.com> Signed-off-by: Xin Li <xin3.li@intel.com> --- arch/x86/entry/entry_64.S | 6 ++++++ arch/x86/entry/entry_64_fred.S | 1 + 2 files changed, 7 insertions(+)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 5a1660701623..87d817296dcb 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -247,7 +247,13 @@ SYM_CODE_START(ret_from_fork_asm) * and unwind should work normally. */ UNWIND_HINT_REGS + +#ifdef CONFIG_X86_FRED + ALTERNATIVE "jmp swapgs_restore_regs_and_return_to_usermode", \ + "jmp asm_fred_exit_user", X86_FEATURE_FRED +#else jmp swapgs_restore_regs_and_return_to_usermode +#endif SYM_CODE_END(ret_from_fork_asm) .popsection diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S index 37a1dd5e8ace..5781c3411b44 100644 --- a/arch/x86/entry/entry_64_fred.S +++ b/arch/x86/entry/entry_64_fred.S @@ -32,6 +32,7 @@ SYM_CODE_START_NOALIGN(asm_fred_entrypoint_user) FRED_ENTER call fred_entry_from_user +SYM_INNER_LABEL(asm_fred_exit_user, SYM_L_GLOBAL) FRED_EXIT ERETU SYM_CODE_END(asm_fred_entrypoint_user)