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: 10090349 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 8EB0E60329 for ; Mon, 4 Dec 2017 14:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7582E28A6E for ; Mon, 4 Dec 2017 14:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A1862899A; Mon, 4 Dec 2017 14:04:23 +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=-4.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AAB02899A for ; Mon, 4 Dec 2017 14:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754326AbdLDOEV (ORCPT ); Mon, 4 Dec 2017 09:04:21 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37431 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754485AbdLDOEN (ORCPT ); Mon, 4 Dec 2017 09:04:13 -0500 Received: by mail-wm0-f66.google.com with SMTP id f140so14475793wmd.2 for ; Mon, 04 Dec 2017 06:04:12 -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=jMxW3/dzQgvHtaXs7T9Ik1wHdT5mpuLi+Lf9JrhipqgMBeMpPaqoDmP3mkAstHOMsB dx1dzLu/SXOtAygp1exP9PKlCu8lSaP2SXgXw+PVht8uPXyUNB9E2cXXI32Aca36fOWJ Arb5Xw20t+7nBYspWL+W3nNQlpVbYuXHxSs5MWNenmoBYasaPS/55HGwBE9qY6aTZKqh mQh6iCDe+c7C1JebTIJFhDRGp+7m+4sp0fV8N7jaq/aKsciZfg+elTmTCBx1sdHPp25y upnZ2tcDqBx2UWt2f9+ByUbjL94f0SwtdJSF7VDeQv3C17TCNK1J5B1XB79hBeEaXu9F fkOQ== X-Gm-Message-State: AKGB3mIJ8iBrWenMkGtlYysvnW3MqvMJT3gO1h0N/rGGn0E+ybfy1gNg LUclyrn7+/95lku2UCfdRaHeFg== 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?= Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Andrew Jones , Christoffer Dall 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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);