From: Juan Quintela Subject: Re: [PATCHv2] qemu-kvm: fix crash on reboot with vhost-net Date: Wed, 28 Apr 2010 12:03:49 +0200 Message-ID: References: <20100428092738.GA32184@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: amit.shah@redhat.com, kraxel@redhat.com, kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55479 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994Ab0D1KDw (ORCPT ); Wed, 28 Apr 2010 06:03:52 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3SA3phM001267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Apr 2010 06:03:52 -0400 In-Reply-To: <20100428092738.GA32184@redhat.com> (Michael S. Tsirkin's message of "Wed, 28 Apr 2010 12:27:38 +0300") Sender: kvm-owner@vger.kernel.org List-ID: "Michael S. Tsirkin" wrote: > When vhost-net is disabled on reboot, we set msix mask notifier > to NULL to disable further mask/unmask notifications. > Code currently tries to pass this NULL to notifier, > leading to a crash. The right thing to do is > to add explicit APIs to enable/disable notifications. > Now when disabling notifications: > - if vector is masked, we don't need to notify backend, > just disable future notifications > - if vector is unmasked, invoke callback to unassign backend, > then disable future notifications > > This patch also polls notifier before closing it, > to make sure we don't lose events if poll callback > didn't have time to run. > > Signed-off-by: Michael S. Tsirkin > --- > > Changes from v1: > Separate APIs to set and unset notifiers > Test and clear notifier before destroying it > > hw/msix.c | 40 +++++++++++++++++++++++++++++++++++----- > hw/msix.h | 1 + > hw/virtio-pci.c | 7 +++++-- > 3 files changed, 41 insertions(+), 7 deletions(-) Acked-by: Juan Quintela This patch addresses the issues that I pointed in previous mail and fixes the problem at hand. Creating a better API for interaction between virtio-pci <-> msix still needs more work/thought, already discussed that with mst. Later, Juan.