[v10,30/38] x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled
Message ID | 20230914044805.301390-31-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp318642vqi; Thu, 14 Sep 2023 05:43:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwkhvO0a02hZa0+6RG0S3WqLv256KKVAMcNfj1kp4fIEB5mLKL7Kp9/Om9ISzkUjSdmkAz X-Received: by 2002:a05:6870:8306:b0:1d5:21cd:7069 with SMTP id p6-20020a056870830600b001d521cd7069mr5446181oae.8.1694695381405; Thu, 14 Sep 2023 05:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694695381; cv=none; d=google.com; s=arc-20160816; b=uaT03MnLrOmR+Ws1ngZbRgFt84VSmrB6RvF7Q2LqqZGOVGukR5+sQ56XsrOipTkMsB SO7FGyUKpq69v/rHMFnUxRd5W1blazvnmTa9L7G4lLQ0p3qy4hZ/hJ3p/RkLqRd+TC2c 2Vo1NY8Ff9cqPYTg9pwD6P6RDU0HcqFzQrg8WF8IVw5bW3dPXsMWf5k9Tue0AKi9pXWP T2UfkUCnC644jSWl+HmDOPygtDe+P2ZWdfN2QCYEXn6WBCONJDcFjXO5p/KEngH0e9i5 VVj3rXTVWb0XMOh3g/91MBQyUOTA+dmcRM7ZabSv8cK5DDTiDYttZPUY/bQFxD3G6tZ2 KErQ== 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=93MSjcJ6Bs7PzVYpjZ+pJb/z4pfhnQhtULS1NVn4xLc=; fh=jqCbnajAXgJ+s7A1aA7DOHJD13/+EpD442pw8d+Ofss=; b=tzgOcwQzjIv5hgxzHGRrLgXQTsdiBxQQb1JNcdUPWIi4AHpa0PV5GLevD/tQhROhM7 BHgIuBELpZYJkK3Ym88xt3QVydb4LSk9R750PmgOY7O8gpSDt1XzuDcuxl+UNWRE2Fxb e4mMC1KgQYiQhsw0ghPocSzgqeuZLiR3WbOlR5vgF4KpESDHxkbEh2dfW67ILy+QgrWm Kx6VpNeQkQMdkuo8yQkVneTM6BVn0Kw1lBGjXkb9cNYjuyilQA3jzdS3ebFVBm3Ankxk 3y1IOfzfrnFHiYpwoHah5yc5d8JL7cNQO1W13qfFENcDp0QSdPkmuljZxpmwaHGxpF3p H+Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hlQOIJCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id 67-20020a630246000000b0056951c9473esi1386751pgc.619.2023.09.14.05.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 05:43:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hlQOIJCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 9EE1782F9168; Wed, 13 Sep 2023 22:22:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235540AbjINFUo (ORCPT <rfc822;chrisfriedt@gmail.com> + 35 others); Thu, 14 Sep 2023 01:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235447AbjINFTx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 01:19:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 903682110; Wed, 13 Sep 2023 22:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694668764; x=1726204764; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M6fmRAapBD1o7lcFP0DE6JJOLTPbVa+6x+sO9If/vNA=; b=hlQOIJCIBUTSnhebYrT5AkuQGB95vOGW02WTEZpV8Z+Y4gMYPqdgOb8j 4VbZoDS7SKJEUafGgqYkHKHIj3l7sCk4eIt6+HFoXONYFiNrEqcnwZBzM QtToJPOk79G9ncwLT7fNo+6JUR7ZFk2jNQEN1lsyXk00O+0Go1lT72cag Kem2l49MLVO4s2BLE1ooQydYsVbXJsrkBwyTLMXF5iY9B5Hm/2Tx+9601 XgeAkoCHiKEASfGppgmepnW4FM72HF/CZYNdiVbfo9A4SvF7+NxUJT9J1 IghRtbZazismvWuXwD9WioaXx78GL2HNIvSDCmi75ZgC7jX7yqqiDGA9b A==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="382661458" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="382661458" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 22:17:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="779488829" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="779488829" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2023 22:17:44 -0700 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 Subject: [PATCH v10 30/38] x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled Date: Wed, 13 Sep 2023 21:47:57 -0700 Message-Id: <20230914044805.301390-31-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914044805.301390-1-xin3.li@intel.com> References: <20230914044805.301390-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 22:22:11 -0700 (PDT) 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777016903823708571 X-GMAIL-MSGID: 1777016903823708571 |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Sept. 14, 2023, 4:47 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 9cdb61ea91de..c9e14617dd3f 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -309,7 +309,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)