From patchwork Mon Dec 4 14:03:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10090417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E98F60329 for ; Mon, 4 Dec 2017 14:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CBBC29205 for ; Mon, 4 Dec 2017 14:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39CDA289A0; Mon, 4 Dec 2017 14:12:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8387F29205 for ; Mon, 4 Dec 2017 14:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BptDo1BFczgRk3lRpeQt/AvTKsKc91FUsTMtpND2/B4=; b=NPyulSJivx9CwspwrVuci+mw/y jGjfZZPhJwummRVfZ6/gHp6VD/rkIJyyR/gXigR1bvPkmFxDcmi3Oreb6GIdVj5An8/EoWZQKsczU 9lP+VDOAwfk/r2PluWvjXU49Tx46hUaL1L638OmyW8fgr//Qz6nTJW2LZ/E+WHiuU5WXLR9j0nVf8 qqhglD0jRzRh767h1CrHRUqhOlZJP0vLL9DV77VP4VAHqv3fx4apNUCEvYvhIG+mEfQ6UI6l0GgDE 9lR6Zs3vhr7vE812+Ekotr+WJ6NMf4RQFJdz4iNc9CBOr/U3SxEz9xe+LLfaXk9zPPwLUlrEnRiGx lKg4lDwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLrTf-00033N-M1; Mon, 04 Dec 2017 14:12:11 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLrMH-0002Rn-GW for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 14:04:49 +0000 Received: by mail-wm0-x241.google.com with SMTP id f140so14475794wmd.2 for ; Mon, 04 Dec 2017 06:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christofferdall-dk.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HdGbCZkD7adqQBjucwgNX2KgrNy/obkWPA9VzsrQRjg=; b=EiRTWzSizywGB4evWCvPaYWvuXE428F1It5kWqiCTa/PKleMYyRS6N6miWbln4zMve tF/S7LLYDDFr3jhLlshGM5SCgnYb4PIXtaqvZINmXBeA0CogcnNFO2LcVNepv+xM3Q+e k3Wb6mCXDQn/DG/KRU98Ct+6QuMXh327zhmWFPOlpmXKAfGG+DYyC54KonXMnQoboqik pNS2dS00kJzbxSLSBi4UfRF1CoTRmI9OwVNxwgGdFP2wk1MVFyXQA32ePH/rpcWLPmYw Wa+Eatr2TCVf+2P9ijT0w88KY53uT3lZtC8lLjT2Cm7MGVxRfFXyXNZYdNCL/uvr/+HK tYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HdGbCZkD7adqQBjucwgNX2KgrNy/obkWPA9VzsrQRjg=; b=S1jcaCj2QuwTYOX1ydYuqVZOY6x7TqNYFzo0gYrfsVH62cdWMp1NdiItkHGUDtxArb 15DnWLrXa6+hWCOuOtX7WKz3hUaw0AD1KmuCduVDlbJdPJ6jxy+D+vH00yLSd40PlPTR ojgj/6rA6p+kTrLWhkswd/Ay1TQcx0U4OKl6Rlz1TFYV7DcSFqMejGQWU8bfm0C33Dpr Ucedazq4F3jv3oAdaFV/mVg7ZpwV6lB28xfPfUk1u8liWB0yGbjefIN4b1GWiAHwyYsj 0XwtcYqjv1tR4XLera5ghdTBko4Pr2USE00xtpNs6aJUokpo1XioF9Txx1+sFt+oqJpJ cxlg== X-Gm-Message-State: AKGB3mLbW2hv0Fn0cDYidGK/sXR4Tz9sxTpuLi003c3YyVGb0Z+vr6Bs CPtys6tgJovWVm9aJKcMr0NCuw== X-Google-Smtp-Source: AGs4zMa0DHcFl7HBOE1iQYgziYfJ0TZot447iw0IhgEKUsFOoskErkfsJUYmW+J/A2simlW0zlka6Q== X-Received: by 10.28.220.67 with SMTP id t64mr7255890wmg.150.1512396251777; Mon, 04 Dec 2017 06:04:11 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id g7sm22794279wra.38.2017.12.04.06.04.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 06:04:11 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 18/19] KVM: arm/arm64: kvm_arch_destroy_vm cleanups Date: Mon, 4 Dec 2017 15:03:47 +0100 Message-Id: <20171204140348.21965-16-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204135637.21620-1-cdall@kernel.org> References: <20171204135637.21620-1-cdall@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_060434_162212_02321A25 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Andrew Jones , Christoffer Dall , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrew Jones kvm_vgic_vcpu_destroy already gets called from kvm_vgic_destroy for each vcpu, so we don't have to call it from kvm_arch_vcpu_free. Additionally the other architectures set kvm->online_vcpus to zero after freeing them. We might as well do that for ARM too. Signed-off-by: Andrew Jones Signed-off-by: Christoffer Dall --- virt/kvm/arm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index ca65d06b38a8..675844c2174a 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -188,6 +188,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) kvm->vcpus[i] = NULL; } } + atomic_set(&kvm->online_vcpus, 0); } int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) @@ -296,7 +297,6 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) { kvm_mmu_free_memory_caches(vcpu); kvm_timer_vcpu_terminate(vcpu); - kvm_vgic_vcpu_destroy(vcpu); kvm_pmu_vcpu_destroy(vcpu); kvm_vcpu_uninit(vcpu); kmem_cache_free(kvm_vcpu_cache, vcpu);