[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 2/8] x86/vmx: Remove lazy FPU support


  • To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 19 Mar 2026 16:38:35 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DgR34ti4Vj78jjx6affmOqgPQGdNrHTkN731mp2HtO8=; b=e1+JwVIxxuH3lCNrSIkDK2LgmvF9biWJLOvSsagkC1ww1K3hMYR7yp+uJpC4v+KehDNCqdY3MQKh6X+1a0HApBugiHcv83dWaxC8LI9DBBLSJvtmJRKd/Fqi0w6N9VxlC5swoZMQU/0em12PptUhEM8b5yb4lDl3/FHcuYIZxWgJFyivoAfxg96A5VDA77Kkqm42+NIMY/zv+jp0C/BTH5LnyD7Pnq2HiByH1Le97bZS+VVmUKRxzS8C+qqHCMeaFpYwzLVCqQ1Ir2WljoyNOJoSgMYOkloR5TxCywRYjd36xJ6m2II7tLDLnwqfZ8o5Gfz+ZwW1oexS9V1CN9cUGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=is7baWtADlXZzrNul6b8Wk+zB3rV5NctClJDQxT/5LwQHQjpwX/+2WVBxLiSArLomTm2+BTAuwjxqBlB6Vk389jGkgyVWJd7itY94GpMkOa2zAMJIz+UTWcwgp8YPDmvBGhVi+O/wPSvyAlk+d2+xFiJUsvMX8HFkIu0OXPTZ8O9cLBq7XPtQkVRt2NW8B8sDz9JEI1gNlMpmHWjgkx3wXa5rnoi0ID2MRIjD3TZZNhNG+SU0GtipQOA/MJaLLAF6vvPWVNzzXm7Ja9rQbHHcsw11MADaeD0Zw8qmvwYTEeaJcexygfjVBs9KmHC8beZx6U1g2Esb72Mv8cfawdwjA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 19 Mar 2026 16:38:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/03/2026 1:29 pm, Ross Lagerwall wrote:
> Remove lazy FPU support from the VMX code since fully_eager_fpu is now
> always true.
>
> No functional change intended.
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

> ---
>  xen/arch/x86/hvm/vmx/vmcs.c             |  8 +--
>  xen/arch/x86/hvm/vmx/vmx.c              | 70 +------------------------
>  xen/arch/x86/hvm/vmx/vvmx.c             | 15 +-----
>  xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  2 -
>  4 files changed, 5 insertions(+), 90 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index c2e7f9aed39f..8e52ef4d497a 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1247,10 +1247,7 @@ static int construct_vmcs(struct vcpu *v)
>      __vmwrite(HOST_TR_SELECTOR, TSS_SELECTOR);
>  
>      /* Host control registers. */
> -    v->arch.hvm.vmx.host_cr0 = read_cr0() & ~X86_CR0_TS;
> -    if ( !v->arch.fully_eager_fpu )
> -        v->arch.hvm.vmx.host_cr0 |= X86_CR0_TS;
> -    __vmwrite(HOST_CR0, v->arch.hvm.vmx.host_cr0);
> +    __vmwrite(HOST_CR0, read_cr0());

(Not for this patch) but I'm pretty sure there's room to optimise this
further.

CR0 should be constant, both here and in SVM.  Reading the active cr0 is
an example of the anti-pattern we need to purge to make nested-virt work
better.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.