qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>,
	qemu-devel@nongnu.org, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH v3 2/3] ehci: fix segfault when hot-unplugging ehci controller
Date: Wed, 18 Mar 2015 17:06:12 +0800	[thread overview]
Message-ID: <55094004.90802@huawei.com> (raw)
In-Reply-To: <1426667029.32192.33.camel@nilsson.home.kraxel.org>

On 2015/3/18 16:23, Gerd Hoffmann wrote:
> On Mi, 2015-03-18 at 09:49 +0800, arei.gonglei@huawei.com wrote:
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> 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.
> 
Actually, these fails were introduced by the follow patch:

commit c3cf77cb63b71618224129df41f114488e0f74e4
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Wed Feb 18 16:01:01 2015 +1100

    Make sysbus EHCI devices ARM only by default

    A number of ARM embedded boards include EHCI USB host controllers which
    appear as directly mapped devices, rather than sitting on a PCI bus.

    At present code to emulate such devices is included whenever EHCI support
    is included.  This patch adjusts teh config options to only include them
    in builds targetting ARM by default.

But on the other hand, the sysbus variants lost the reset hookup is a real bug,
I will fix them in the next version. thanks!

Regards,
-Gonglei

  reply	other threads:[~2015-03-18  9:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  1:49 [Qemu-devel] [PATCH v3 0/3] usb: fix segfault when hot-unplugging usb host adapter arei.gonglei
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 1/3] uhci: fix segfault when hot-unplugging uhci controller arei.gonglei
2015-03-18  7:02   ` Gerd Hoffmann
2015-03-18  7:21     ` Gonglei
2015-03-18  7:35     ` Markus Armbruster
2015-03-18  7:55       ` Gonglei
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 2/3] ehci: fix segfault when hot-unplugging ehci controller arei.gonglei
2015-03-18  8:23   ` Gerd Hoffmann
2015-03-18  9:06     ` Gonglei [this message]
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 3/3] ohci: fix resource cleanup leak arei.gonglei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55094004.90802@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=kraxel@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).