From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YY9Gk-00069t-A1 for qemu-devel@nongnu.org; Wed, 18 Mar 2015 04:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YY9Gg-0002he-8W for qemu-devel@nongnu.org; Wed, 18 Mar 2015 04:24:02 -0400 Message-ID: <1426667029.32192.33.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Wed, 18 Mar 2015 09:23:49 +0100 In-Reply-To: <1426643370-15804-3-git-send-email-arei.gonglei@huawei.com> References: <1426643370-15804-1-git-send-email-arei.gonglei@huawei.com> <1426643370-15804-3-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 2/3] ehci: fix segfault when hot-unplugging ehci controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: qemu-stable , qemu-devel@nongnu.org, peter.huangpeng@huawei.com On Mi, 2015-03-18 at 09:49 +0800, arei.gonglei@huawei.com wrote: > From: Gonglei > > When hot-unplugging the usb controllers (ehci/uhci), > we have to clean all resouce of these devices, > involved registered reset handler. Otherwise, it > may cause NULL pointer access and/or segmentation fault > if we reboot the guest os after hot-unplugging. > > Let's hook up reset via DeviceClass->reset() and drop > the qemu_register_reset() call. Then Qemu will register > and unregister the reset handler automatically. Fails "make check" (for aarch64). My guess is the sysbus variants lost the reset hookup. cheers, Gerd