Message ID | 20231205105030.8698-20-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 r17csp3359192vqy; Tue, 5 Dec 2023 03:22:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFk0Xq7xpDEqQekpzs/6ru10qKIxGyF/9WpQ+69cFr9RQ1gLrNLWqAb9pL3xM+PNurMwwrC X-Received: by 2002:a17:902:8f8c:b0:1d0:6ffd:9e23 with SMTP id z12-20020a1709028f8c00b001d06ffd9e23mr5890155plo.117.1701775365080; Tue, 05 Dec 2023 03:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775365; cv=none; d=google.com; s=arc-20160816; b=ytF+fdfxi5qwvo6xpeT6I8fEgbiEFaSW+TkP3ItwJCJCQ4MqaTpuWE6H0W5v7s+c0S D7864vLw7Ai4f9+SI9nCNU/A4tP2SGpCRi/AmfYx7Ejpfw6qLxMViSQ3T4Yin0AtIPn8 tGOzDICdRKfawam8SRqPVuro6HXy1yMI5aLDxBLJDx8HZnJA1jkrURznBC8VZfXrsbbS 7cxKp3TmtmJDoTAXcZ0yJMX+OVDgGt3JuEqtKVWraaVKEj6TmcdqMjB4C3e5g3F9YKd/ JKeFQpZHNxN1HQuG2yv311+EW60W+7znda5qh68CpYSuvAFD+dd8pB53oQNY5mI/ZmZc rh8g== 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=ev0AS+62vNauLOXJPFpvl2iRWuwhBPS9q43Xn+eKMkQ=; fh=uCCWEUVpLc/xDP/D3WvGY/BxHU9d0NQYu/T71GEsNmA=; b=EJkIEtD3QwxmCqsZzaePgjrOnkoZbLKX34RPLNe0wUir4zXxNt2nztfMX6mEXmRSHW bSslM7QZK+BHxhldCGEA3/0k29F61l5kM9mA/3ZK3XP13rUZ7DHu/eNnpfnsW/d44+DV BHeManmklVNaFjtUIysg1vHCs0djxaieximo+GB+T5bdCwcjSKQJhJ4Cue0Ky8lxHLpV qniaThp8mcsVe7HNyvECImDlZe/3YDxiiZQg4f8dV4+0l4PNYoT3D7R2ATDxrukn9apr Z3tR9qjFRF+VlM6JsDOFWOG2Uiaeh6vxLrWYN6jU/T+8KerxfwVvKJyZ6OG3pXXbZz6P NqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z5Tq47ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j17-20020a170902da9100b001cfa8f0e365si6714429plx.305.2023.12.05.03.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z5Tq47ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 9DA518227781; Tue, 5 Dec 2023 03:22:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442086AbjLELWS (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Tue, 5 Dec 2023 06:22:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442105AbjLELV0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 5 Dec 2023 06:21:26 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E43A1187; Tue, 5 Dec 2023 03:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775290; x=1733311290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hPsnAnmRCEio5pl6T3lxKlJogXHr45sRU/QYYYLaUzw=; b=Z5Tq47eyrDr7px0HUR8QJ/kdeHe4FPlpSIQsmaYVWUagXRI0BdbByvIq oy+sQ45WJeh6vfSAWHGANk5CfpJ8Np7dOJatmUPfZd37ikfMg76YVjuLy qM+LNt8E6yDHk1C4Zc2pNCONnJphCt4m2wWrIHq2nKyiwgfCLxD+5IpkY 1tYkVhCSx0eOTJca0d4Add/RzTiV0lChojtB9K5/r4hD4ZS5K0BR1v7ID K/KvRl28/1fiDspkHf2TS30ck8tb1ge9+BNw5KGl+OJC55kmmqU7fUIQP Apj8NOHYo/3nTG9+tLRxAuF2Q3m7VAyEcTxB+xrULoGY5dKgQ2gDo3CVJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942530" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942530" 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:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192965" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192965" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:21 -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 19/35] x86/fred: No ESPFIX needed when FRED is enabled Date: Tue, 5 Dec 2023 02:50:08 -0800 Message-ID: <20231205105030.8698-20-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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:22:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440805200975813 X-GMAIL-MSGID: 1784440805200975813 |
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> Because FRED always restores the full value of %rsp, ESPFIX is no longer needed when it's enabled. 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/kernel/espfix_64.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c index 16f9814c9be0..6726e0473d0b 100644 --- a/arch/x86/kernel/espfix_64.c +++ b/arch/x86/kernel/espfix_64.c @@ -106,6 +106,10 @@ void __init init_espfix_bsp(void) pgd_t *pgd; p4d_t *p4d; + /* FRED systems always restore the full value of %rsp */ + if (cpu_feature_enabled(X86_FEATURE_FRED)) + return; + /* Install the espfix pud into the kernel page directory */ pgd = &init_top_pgt[pgd_index(ESPFIX_BASE_ADDR)]; p4d = p4d_alloc(&init_mm, pgd, ESPFIX_BASE_ADDR); @@ -129,6 +133,10 @@ void init_espfix_ap(int cpu) void *stack_page; pteval_t ptemask; + /* FRED systems always restore the full value of %rsp */ + if (cpu_feature_enabled(X86_FEATURE_FRED)) + return; + /* We only have to do this once... */ if (likely(per_cpu(espfix_stack, cpu))) return; /* Already initialized */