From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BD6FCA9EAF for ; Thu, 24 Oct 2019 08:08:14 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 935BA20684 for ; Thu, 24 Oct 2019 08:08:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 935BA20684 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E7EBA4A651; Thu, 24 Oct 2019 04:08:12 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s4VIYVflvvpC; Thu, 24 Oct 2019 04:08:11 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9E5954A658; Thu, 24 Oct 2019 04:08:11 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C19A04A659 for ; Thu, 24 Oct 2019 03:04:49 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IZygREC7DcOV for ; Thu, 24 Oct 2019 03:04:48 -0400 (EDT) Received: from 8.mo3.mail-out.ovh.net (8.mo3.mail-out.ovh.net [87.98.172.249]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 930E34A555 for ; Thu, 24 Oct 2019 03:04:48 -0400 (EDT) Received: from player788.ha.ovh.net (unknown [10.108.57.76]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 462DB22A46E for ; Thu, 24 Oct 2019 09:04:47 +0200 (CEST) Received: from kaod.org (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player788.ha.ovh.net (Postfix) with ESMTPSA id CA63BB4D6960; Thu, 24 Oct 2019 07:04:07 +0000 (UTC) Date: Thu, 24 Oct 2019 09:04:03 +0200 From: Greg Kurz To: Sean Christopherson Subject: Re: [PATCH 01/45] KVM: PPC: Book3S HV: Uninit vCPU if vcore creation fails Message-ID: <20191024090403.5e564e39@bahia.lan> In-Reply-To: <20191022015925.31916-2-sean.j.christopherson@intel.com> References: <20191022015925.31916-1-sean.j.christopherson@intel.com> <20191022015925.31916-2-sean.j.christopherson@intel.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-Ovh-Tracer-Id: 5552375392181655889 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrledtgdduudefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-Mailman-Approved-At: Thu, 24 Oct 2019 04:08:10 -0400 Cc: Wanpeng Li , kvm@vger.kernel.org, James Hogan , linux-kernel@vger.kernel.org, Paul Mackerras , kvmarm@lists.cs.columbia.edu, Janosch Frank , Marc Zyngier , Joerg Roedel , David Hildenbrand , Christian Borntraeger , kvm-ppc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , linux-mips@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, 21 Oct 2019 18:58:41 -0700 Sean Christopherson wrote: > Call kvm_vcpu_uninit() if vcore creation fails to avoid leaking any > resources allocated by kvm_vcpu_init(), i.e. the vcpu->run page. > > Fixes: 371fefd6f2dc4 ("KVM: PPC: Allow book3s_hv guests to use SMT processor modes") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson > --- Reviewed-by: Greg Kurz > arch/powerpc/kvm/book3s_hv.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c > index 709cf1fd4cf4..36abbe3c346d 100644 > --- a/arch/powerpc/kvm/book3s_hv.c > +++ b/arch/powerpc/kvm/book3s_hv.c > @@ -2354,7 +2354,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_hv(struct kvm *kvm, > mutex_unlock(&kvm->lock); > > if (!vcore) > - goto free_vcpu; > + goto uninit_vcpu; > > spin_lock(&vcore->lock); > ++vcore->num_threads; > @@ -2371,6 +2371,8 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_hv(struct kvm *kvm, > > return vcpu; > > +uninit_vcpu: > + kvm_vcpu_uninit(vcpu); > free_vcpu: > kmem_cache_free(kvm_vcpu_cache, vcpu); > out: _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm