[RFC,24/32] x86/fred: let ret_from_fork() jmp to fred_exit_user when FRED is enabled
Message ID | 20221220063658.19271-25-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2813907wrn; Mon, 19 Dec 2022 23:04:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ZQ/48X05t4Zd2AgY82TGgRhbJiAyg27FzW6qbDSwlYLMapelRTTvCoUwhZqtzC6pwUDJl X-Received: by 2002:a05:6a00:2189:b0:56d:59f0:d291 with SMTP id h9-20020a056a00218900b0056d59f0d291mr56760952pfi.18.1671519883018; Mon, 19 Dec 2022 23:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671519883; cv=none; d=google.com; s=arc-20160816; b=BoLRRex8BZuRkWAps0Naa2kYwqyudtZ8X7xYyLvKndxvpc0W4fS9LQROurVgu3vVFT iaY6u2Wy3zN5e7qoZ2aS6XBwpDHeXCVRyeec4EQ98S69nD2fZJF4erqGKJQ5Eb+s99w/ Ml97I3D83RVWJdN7wX1hb6gSfpkSx7H3MjGtKlfEb8CrSF3hyrDUB6tUTrv6ltqPlKPI mGciml2rMswpd8Fzkp8A8HZlZ9H0ViAV/KR8VEfEAjrwg8MZzTkFgO1Z8IsWKMQToxLT LUrFWeeDJraJ7B1dFl+GTnVM8DfvM/5pXQGyNW6okCtgqKLX/niLQ6PJ+AnMXxEbqxMj KgRg== 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=FrltQJqW0gF7PrIrFXeKm6HC6ihndXAgN7IIv7oGQIs=; b=IU6RxJSgSVqSSi3a0wG0BUWgEb/gShYdvHior4sfOKlcW22jY3Gy3riojGVqGW4AIF 5yqyrGPLKhJbEEgUziIKppz4CGr2GwxKcS8L22jwjHo+AY1kMrcc3dGO4OgilgLeaoFG Pe0cwM9voL+w58WDS5EjHhdRrq8+1EXgGEJ9jTnwl8ZHUiF0UhuA+DHGKWrLBj8rOFv9 KWcKXh5xk+rUDRYC26ue/UBEhFlLNxfR42922K/miaKtCNe1gs8BSrVUbEf5k1jJOOhv EDk1hC5ptD6ZnuGKtbwfsvSdW0ZlsSWiFjxaolR8IeYtDE/VMU7lMy7vkpBKwdxQTiw2 bokg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="lsxv/yEd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056a001c8700b005764c8f3918si11833412pfw.262.2022.12.19.23.04.30; Mon, 19 Dec 2022 23:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="lsxv/yEd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233383AbiLTHDy (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Tue, 20 Dec 2022 02:03:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbiLTHBo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 20 Dec 2022 02:01:44 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106A915F04; Mon, 19 Dec 2022 23:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671519700; x=1703055700; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9Ow+AUlF3YAQbms59Th+YlBw4taXZzsqN7sPL++pLxY=; b=lsxv/yEdrsDp/zOeI2dLcYmfjwWoq3PqZ8oSwV2aseNzMKwVPYr8xQbx QlCgLscpeE8LuntB8mxdw0B3Ek9k39J0peruw1wNcI5AmMwBA9ezJtBtj IQQZ50Zb7+VPFQHiVR1fdH5r8mQexbKmD++HZhvxZLCUoC4djv4YROqnU bmr3I/x44LXRtFpnWqT78swRK8+8r5WV3/6wseYb0tksOkOJjxeaDghjW Gb8urLO1sjp2vgZFEO1l/4uaWUmobTkOCuSIp3viPdzVUWnmr9n1YNdyT qjfEUb9cxcbyvcC1FBAtQDMObn9hsv0CqJYc2ulWS+75Oy7mkl/4Sz+Ls Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="302972119" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="302972119" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 23:01:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="644326526" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="644326526" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga007.jf.intel.com with ESMTP; 19 Dec 2022 23:01:17 -0800 From: Xin Li <xin3.li@intel.com> To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com Subject: [RFC PATCH 24/32] x86/fred: let ret_from_fork() jmp to fred_exit_user when FRED is enabled Date: Mon, 19 Dec 2022 22:36:50 -0800 Message-Id: <20221220063658.19271-25-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220063658.19271-1-xin3.li@intel.com> References: <20221220063658.19271-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752715632790173745?= X-GMAIL-MSGID: =?utf-8?q?1752715632790173745?= |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Dec. 20, 2022, 6:36 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> Let ret_from_fork() jmp to fred_exit_user when FRED is enabled, otherwise the existing IDT code is chosen. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Signed-off-by: Xin Li <xin3.li@intel.com> --- arch/x86/entry/entry_64.S | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index e0c48998d2fb..cdb696cbb2a0 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -297,7 +297,12 @@ SYM_CODE_START(ret_from_fork) UNWIND_HINT_REGS movq %rsp, %rdi call syscall_exit_to_user_mode /* returns with IRQs disabled */ +#ifdef CONFIG_X86_FRED + ALTERNATIVE "jmp swapgs_restore_regs_and_return_to_usermode", \ + "jmp fred_exit_user", X86_FEATURE_FRED +#else jmp swapgs_restore_regs_and_return_to_usermode +#endif 1: /* kernel thread */