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

Re: [PATCH] vVMX: Cleanup partial vCPU initialization


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Mon, 27 Oct 2025 09:53: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=UtgKoyOCh6PYcXV+V7eu72pNy1m714ueBTbxQkipoEY=; b=eHUIxy4JxyuSrXc6RD/ELvx3JhHYZ8XWz8MKnn4+Xc3OSETDpKiqGSFG3iXjSmt4/RV8HhaH+us88xC3hAxn0QmuhM71TB1USb5WRR2g2H5yOsPQB3LKiJ9qH2UYpJEWwUqCwQwfmlDDojx0ar2T/2FnwhGagGaI7axhFlGvCgiG50WX/2u7ofzM1TV+MTj9TO96Tx5xUhiRb4LCnGFiDi+YjTYhbkAUC2lOolsdFaG6Ho0eQFc8BXWKR1TgXhLEsKOnmqmnj+/d0Ea7BJ2sRjhMb2711iY0IXquVp5VYoSVo2ECbsuZKlum2fjR3idw2e70aRIeV76KCMvoTUmM+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CeARPfWDNDh5DjZ++6lFJJuzyES0pVYS3OqHjqQwcGFVNoweLQKVb338mvNn1R2x+FkD4V3s1jho3HCNHU37lWKq5/w0vyY5USg/Lprt1h/5v9K5UEZOGWNfMtvGi3yMS4O/N2T1sh80Cmw+/FWmV6rbSs1I1Rw9kkSYCUOm05S2Y6cgQswHi5ldoLzKH8FeZ+LZhpUDXDVIYMI/it+utx95tT/TWg9uGdvM7FU4/7YqWxf8FpL+QeeI6zKJDBiOqah+kdUEY5/g01jP8KevY6RnBu1UmVfn4T/NnbZxKpDieLDIgTYMxqEX4qxVk7rIvN9S5zVBWi5FI7i7QS657A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 27 Oct 2025 09:53:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/24/25 7:08 PM, Andrew Cooper wrote:
On 24/10/2025 5:20 pm, Ross Lagerwall wrote:
If nested vCPU initialization fails, cleanup the allocated memory since
it is no longer handled by the caller.

Fixes: c47984aabead ("nvmx: implement support for MSR bitmaps")
Fixes: f5bdb4aaa165 ("x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM")
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>

AFAICT, this is because of hvm_vcpu_initialise() not calling
nestedhvm_vcpu_destroy() if nestedhvm_vcpu_initialise() fails?

I think this is an improvement in the short term, but we really need to
fix our object lifecycle.  Relatedly, I should dust off the fault-ttl
series because it would be able to find this failure automatically.

~Andrew

Having hvm_vcpu_initialise() call nestedhvm_vcpu_destroy() would be one way of fixing it (albeit it is complicated because some cleanup is also done in vcpu_relinquish_resources()). But IMO generally a partial failure of an initialization function should be handled up internally rather than expecting the caller to deal with it.

Ross



 


Rackspace

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