All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Olaf Hering <olaf@aepfle.de>, John Snow <jsnow@redhat.com>
Cc: xen-devel@lists.xenproject.org,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs
Date: Thu, 25 Mar 2021 17:49:49 +0100	[thread overview]
Message-ID: <dae251e1-f808-708e-902c-05cfcbbea9cf@redhat.com> (raw)
In-Reply-To: <20210325121219.7b5daf76.olaf@aepfle.de>

On 25/03/21 12:12, Olaf Hering wrote:
> Am Mon, 22 Mar 2021 18:09:17 -0400
> schrieb John Snow <jsnow@redhat.com>:
> 
>> My understanding is that XEN has some extra disks that it unplugs when
>> it later figures out it doesn't need them. How exactly this works is
>> something I've not looked into too closely.
> 
> It has no extra disks, why would it?
> 
> I assume each virtualization variant has some sort of unplug if it has to support guests that lack PV/virtio/enlightened/whatever drivers.

No, it's Xen only and really should be legacy.  Ideally one would just 
have devices supported at all levels from firmware to kernel.

>> So if these IDE devices have been "unplugged" already, we avoid
>> resetting them here. What about this reset causes the bug you describe
>> in the commit message?
>>
>> Does this reset now happen earlier/later as compared to what it did
>> prior to ee358e91 ?
> 
> Prior this commit, piix_ide_reset was only called when the entire
> emulated machine was reset. Like: never. With this commit,
> piix_ide_reset will be called from pci_piix3_xen_ide_unplug. For some
> reason it confuses the emulated USB hardware. Why it does confused
> it, no idea.

> I wonder what the purpose of the qdev_reset_all() call really is. It
> is 10 years old. It might be stale.

piix_ide_reset is only calling ide_bus_reset, and from there ide_reset 
and bmdma_reset.  All of these functions do just two things: reset 
internal registers and ensure pending I/O is completed or canceled.  The 
latter is indeed unnecessary; drain/flush/detach is already done before 
the call to qdev_reset_all.

But the fact that it breaks USB is weird.  That's the part that needs to 
be debugged, because changing IDE to unbreak USB needs an explanation 
even if it's the right thing to do.

If you don't want to debug it, removing the qdev_reset_all call might do 
the job; you'll have to see what the Xen maintainers think of it.  But 
if you don't debug the USB issue now, it will come back later almost surely.

Paolo



  reply	other threads:[~2021-03-25 16:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  7:00 [PATCH v2] piix: fix regression during unplug in Xen HVM domUs Olaf Hering
2021-03-22 22:09 ` John Snow
2021-03-22 22:09   ` John Snow
2021-03-25 11:12   ` Olaf Hering
2021-03-25 11:12     ` Olaf Hering
2021-03-25 16:49     ` Paolo Bonzini [this message]
2023-05-09 22:58       ` Olaf Hering
2023-05-10  7:47         ` Olaf Hering
2023-05-12 21:12           ` Stefano Stabellini
2023-05-16 17:38             ` John Snow
2023-05-16 20:00               ` Olaf Hering
2023-06-26 21:19         ` Olaf Hering
2023-06-27  7:11           ` Paolo Bonzini
2023-06-27 10:12             ` Bernhard Beschow
2023-06-27 11:40               ` Olaf Hering
2023-06-27 12:07               ` Olaf Hering
2023-06-28  9:27                 ` Bernhard Beschow
2023-06-30  7:29                   ` Olaf Hering
2023-06-30  8:05                     ` Bernhard Beschow
2023-06-30 11:32                       ` Olaf Hering
2023-06-30 22:15                         ` Bernhard Beschow
2023-06-30  8:48                   ` Paolo Bonzini
2023-07-01  9:53                     ` Bernhard Beschow
2023-07-01 11:58                       ` Mark Cave-Ayland
2023-07-02 22:25                         ` Bernhard Beschow
2023-06-27 11:32           ` Olaf Hering

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=dae251e1-f808-708e-902c-05cfcbbea9cf@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=jsnow@redhat.com \
    --cc=olaf@aepfle.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.