From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v2 0/3] KVM: x86: use pic/ioapic destructor when proper Date: Wed, 15 Mar 2017 16:59:36 +0800 Message-ID: <20170315085936.GD5971@pxdev.xzpeter.org> References: <1489564879-6097-1-git-send-email-peterx@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= To: David Hildenbrand Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44650 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbdCOI7n (ORCPT ); Wed, 15 Mar 2017 04:59:43 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FDC380466 for ; Wed, 15 Mar 2017 08:59:43 +0000 (UTC) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Mar 15, 2017 at 09:47:14AM +0100, David Hildenbrand wrote: > Am 15.03.2017 um 09:01 schrieb Peter Xu: > > v2: > > - add one more patch (patch 2 in v2) to check pic/ioapic's > > existance before destroying them > > Patch 2+3 without 1 should work, too, right? We may need that? When destroy VM, it's: kvm_destroy_vm() foreach (bus) do kvm_io_bus_destroy() kfree(bus) <--- [1] kvm_arch_destroy_vm() kvm_pic_destroy() kvm_io_bus_unregister_dev() <--- [2] Here if without patch 1 we'll reference bus->dev_count in [2], while actually the bus has been freed already in [1]. Thanks, -- peterx