[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>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 24 Mar 2026 14:50:15 +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=5iDFXhUIBetYfHEkNaSgVmrep20L/k8Pni+YdPg5Jz8=; b=nQXdbyF8Ibb37TTlUuhkt/jF3g4qgqrsfU/Iz67U+FrklnsFHViWBmXkwOKA7SH7GO2zxBp5EXu0mh26f4ERDm3hH3jl1jP3Qy4dfaZPaxjkslQYklhZYnwoanBNU7Od6o8z7b3Jy80D1kQAiG3sr6GRAWM49NYJSS7Jg7t2s9hXdizzHPGA/sF02QcCHaafJKuyV9j6mlakS7sztTOgGM1dnlNV1JgaSxYr7uDo2egaAZS1YFcW7fyrnpkf3PgKFdkh8WxU09qqn+ebLS2Y80NGQQSLHNaX6B/QpPSq7Aq2o5GXT+8knHKSQQ7nCNJbRuzkTreRnA4TSZbjHfejvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jSGFSiJ/b3iiJ29qfK+0yq44QGQKyiE+dYBy4TzSNTO1AQ2oqezDbktrCnwKK8VWOcvITa5T/AyhRQbGu1xeMztyeWEjtu953Hsi8DJs948aEr8QvcPPtj14QimFB1Ofxhbpu+1fPxhlzyLvibxbTTkIapkOPLvMATo5PcwEmcpWDAQKeWgjo67nsiv6XSvDvARMYjIjshIuDkYfeVcmEK2Zm55Lbu6udnTlXwnSSg5KQx69z44iEMCTCFYDwJUIeD83zclQmfajJZbEbjDhiWOrAO24Uoot83FYmli0Ci9pdJSU2bDRxm6LuhlQBkpdvMPYtfxEJGvCW7tZK/NqOA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Tue, 24 Mar 2026 14:50:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20/03/2026 10:45 am, Ross Lagerwall wrote:
> On 3/19/26 4:54 PM, Andrew Cooper wrote:
>> On 19/03/2026 4:43 pm, Jan Beulich wrote:
>>> On 19.03.2026 17:38, Andrew Cooper wrote:
>>>> 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.
>>> In which case, is it a good idea to purge the host_cr0 field?
>>
>> Oh hmm, I take back my R-by slightly.  We still need to initialise
>> v->arch.hvm.vmx.host_cr0 for this patch to be no functional change.
>> Easy enough to fix, or fix on commit.
>>
>
> Not sure I follow why v->arch.hvm.vmx.host_cr0 is needed when this would
> be the only place it is used? 

Never mind.  I'd mixed deleting this variable.  My original R-by stands.

~Andrew



 


Rackspace

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