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

Re: [PATCH] x86/HVM: correct cleanup after failed viridian_vcpu_init()


  • To: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 13:10:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9Mk/9E7f886e4J5u++DJqz9PL0afmdhKT2a+g4quzVI=; b=D+kRBH+kM32qDCKY5GXpfNI2wxt40+yegZhkMYmPD7QWTAs3ZCPveNoZbW8Oqwt+rjC2yQMaWKmEdLxA6GhzSN9wwvtB9sJZ+CKakaVp9oR5DZa+IlE8bYd2DtZ5d0OEPeQfORsLNX8/Vy59mAVa9NxFUlFM1/hHJFHrmpB2mYKOw8oHJcYpXdDuSRWYE4Xa5463p9PxAG5mOhV67Bq38sVXy2RkdWUqRmxGjSb0BB4ArG6OvFruHpzomF5ZX8vugTRp/9ItAGq990N2z+xwuZjtx/uMY21FIS8VgRkJ35JhVsbDGPVBQyRHhVppxIzS7PmzWQih2oY0Sl2B4LTlDQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MrRib/FwjjM3fqD7CP9CmJAyqKxCcsP6nbz0gUM9r8KGNrYMLGfT0Qk4P0dtNEk8pNXTnsnDB6U3yK8JmuB85UfBLw/2eWpl5okY6/5oHSohCrbttHG2DUFbubhIypfzru/NUnrrgBTty65jXO/wwJkvoHYadHgVRYoIfSe/40ruNO8QtobXjRGyttrpBcMA4bslt3VJy9B/i5BWrdqGTXsnpRvlw4uf9RmXZQkDcHig8F5dW2NeYhauBFRAWocDpOPBt/G+ozdtgJ9Zc2M6nmhDMxh5LXhohRxiHnsn37U5Z/A+m8OoQyezDik7Vo7vdNd0Go4BFj4bwS/QuOuECA==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Mon, 18 Oct 2021 11:10:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.10.2021 12:42, Ian Jackson wrote:
> Jan Beulich writes ("[PATCH] x86/HVM: correct cleanup after failed 
> viridian_vcpu_init()"):
>> This happens after nestedhvm_vcpu_initialise(), so its effects also need
>> to be undone.
>>
>> Fixes: 40a4a9d72d16 ("viridian: add init hooks")
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -1583,7 +1583,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
>>  
>>      rc = viridian_vcpu_init(v);
>>      if ( rc )
>> -        goto fail5;
>> +        goto fail6;
> 
> Not acomment about the patch; rather about the code in general.
> 
> I have not looked at the context.
> 
> But OMG, this is horrific.  How can anyone write code in such an idiom
> without writing endless bugs ?

Well, one of the reasons I dislike "goto".

Since you've been looking here - any chance of getting a release ack?
Perhaps also on "x86/shadow: make a local variable in sh_page_fault()
HVM-only" and "x86/PV: address odd UB in I/O emulation"? Aiui that's
going to be needed from today on ...

Jan




 


Rackspace

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