Message ID | 20231205105030.8698-18-xin3.li@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <xen-devel-bounces@lists.xenproject.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31FFBC10F04 for <xen-devel@archiver.kernel.org>; Tue, 5 Dec 2023 11:22:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.647567.1010910 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1rATUe-00069b-1b; Tue, 05 Dec 2023 11:21:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 647567.1010910; Tue, 05 Dec 2023 11:21:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1rATUd-00068b-Ew; Tue, 05 Dec 2023 11:21:35 +0000 Received: by outflank-mailman (input) for mailman id 647567; Tue, 05 Dec 2023 11:21:34 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <SRS0=QGQ0=HQ=intel.com=xin3.li@srs-se1.protection.inumbo.net>) id 1rATUb-0005GD-UA for xen-devel@lists.xenproject.org; Tue, 05 Dec 2023 11:21:33 +0000 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 71355103-9360-11ee-98e5-6d05b1d4d9a1; Tue, 05 Dec 2023 12:21:32 +0100 (CET) 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 Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:21 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Inumbo-ID: 71355103-9360-11ee-98e5-6d05b1d4d9a1 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=hmQpiQvapcbti3jANBGIdxV6K3xVoAfCMfULqYzqZvw=; b=hk5ZJYNoJsRuKrHHQ8eCDFxC4b3dK1UPmyRly4fUaHyGzrSGs5HOYDvm gdipRKRLOKesu5nP9ZtS0addaqYgy3aA05hmBfvZAu6PESdZXxyHWAsn8 p2kk5H+/V6uq8eAvFyWPcdJkgT+19Vu19llJGTOQqzgS/34r1JIze5/Ex r/IjxbcDqRVhagplgrWE4K6kt9t6RdEDKpnHX2DvPMDuL7UxPbr40v8Sm Ijo6728RU/pd+UgxO66KRIP7+us9Ir+bGu3u3wJCPUeRR29/uZExqFbpv tB/gUj/Xu//JYVfavHPsnzHWbVkZWigknyBe38SdpXDsJgM+xrVKc4OVt g==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942514" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942514" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192957" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192957" 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 17/35] x86/fred: Update MSR_IA32_FRED_RSP0 during task switch Date: Tue, 5 Dec 2023 02:50:06 -0800 Message-ID: <20231205105030.8698-18-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 |
Series |
x86: enable FRED for x86-64
|
expand
|
diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h index f42dbf17f52b..c3bd0c0758c9 100644 --- a/arch/x86/include/asm/switch_to.h +++ b/arch/x86/include/asm/switch_to.h @@ -70,9 +70,13 @@ static inline void update_task_stack(struct task_struct *task) #ifdef CONFIG_X86_32 this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0); #else - /* Xen PV enters the kernel on the thread stack. */ - if (cpu_feature_enabled(X86_FEATURE_XENPV)) + if (cpu_feature_enabled(X86_FEATURE_FRED)) { + /* WRMSRNS is a baseline feature for FRED. */ + wrmsrns(MSR_IA32_FRED_RSP0, (unsigned long)task_stack_page(task) + THREAD_SIZE); + } else if (cpu_feature_enabled(X86_FEATURE_XENPV)) { + /* Xen PV enters the kernel on the thread stack. */ load_sp0(task_top_of_stack(task)); + } #endif }