Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A651C433F5 for ; Mon, 18 Oct 2021 10:43:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E18B9610A3 for ; Mon, 18 Oct 2021 10:43:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E18B9610A3 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.212006.369724 (Exim 4.92) (envelope-from ) id 1mcQ6Z-0004KG-MY; Mon, 18 Oct 2021 10:42:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 212006.369724; Mon, 18 Oct 2021 10:42:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mcQ6Z-0004K9-Jg; Mon, 18 Oct 2021 10:42:55 +0000 Received: by outflank-mailman (input) for mailman id 212006; Mon, 18 Oct 2021 10:42:54 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mcQ6Y-0004K0-7O for xen-devel@lists.xenproject.org; Mon, 18 Oct 2021 10:42:54 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mcQ6Y-0002o1-6d for xen-devel@lists.xenproject.org; Mon, 18 Oct 2021 10:42:54 +0000 Received: from iwj (helo=mariner.uk.xensource.com) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1mcQ6Y-0002Zv-5s for xen-devel@lists.xenproject.org; Mon, 18 Oct 2021 10:42:54 +0000 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.89) (envelope-from ) id 1mcQ6U-0005YL-RS; Mon, 18 Oct 2021 11:42:50 +0100 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=References:In-Reply-To:Subject:Cc:To:Date :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:From; bh=luKiMLwYeNzkpUIEP+eDifVCSZHNpqH38O8R8ikOigA=; b=5GK1kBUjQNGgWGc8fX5fiCj+VJ Nn82sm8qF2Rrg7XLY1NKMC5DJih9qsWf0tekvnJAYbambXzmgL+5ZF+eoRB34cU8xruM9OE9GfXoY kNRtY1c6QGMvXUeNQwnJMS6WXPGMXTKXi1cQclSE4tok9Oyw9h2zoFlWKdV2/VSrSQmo=; From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <24941.20394.574634.548545@mariner.uk.xensource.com> Date: Mon, 18 Oct 2021 11:42:50 +0100 To: Jan Beulich Cc: "xen-devel\@lists.xenproject.org" , Andrew Cooper , Wei Liu , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Paul Durrant Subject: Re: [PATCH] x86/HVM: correct cleanup after failed viridian_vcpu_init() In-Reply-To: <55570db5-3823-8996-f69b-c2b00bcd4227@suse.com> References: <55570db5-3823-8996-f69b-c2b00bcd4227@suse.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) 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 > > --- 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 ? Ian.