From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
qemu-devel@nongnu.org
Cc: Olaf Hering <olaf@aepfle.de>, John Snow <jsnow@redhat.com>
Subject: [PATCH v1] piix: fix regression during unplug in Xen HVM domUs
Date: Tue, 16 Mar 2021 23:44:12 +0100 [thread overview]
Message-ID: <20210316224412.11609-1-olaf@aepfle.de> (raw)
Commit ee358e919e385fdc79d59d0d47b4a81e349cd5c9 causes a regression in
Xen HVM domUs which run xenlinux based kernels.
If the domU has an USB device assigned, for example with
"usbdevice=['tablet']" in domU.cfg, the late unplug of devices will
kill the emulated USB host. As a result the khubd thread hangs, and as
a result the entire boot process.
For some reason this does not affect pvops based kernels. This is
most likely caused by the fact that unplugging happens very early
during boot.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
hw/ide/piix.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index b9860e35a5..2a380a90e9 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -34,6 +34,7 @@
#include "hw/ide/pci.h"
#include "trace.h"
+static bool pci_piix3_xen_ide_unplug_done;
static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size)
{
BMDMAState *bm = opaque;
@@ -109,6 +110,8 @@ static void piix_ide_reset(DeviceState *dev)
uint8_t *pci_conf = pd->config;
int i;
+ if (pci_piix3_xen_ide_unplug_done == true)
+ return;
for (i = 0; i < 2; i++) {
ide_bus_reset(&d->bus[i]);
}
@@ -169,6 +172,7 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux)
IDEBus *idebus;
BlockBackend *blk;
+ pci_piix3_xen_ide_unplug_done = true;
pci_ide = PCI_IDE(dev);
for (i = aux ? 1 : 0; i < 4; i++) {
@@ -259,6 +263,7 @@ static const TypeInfo piix4_ide_info = {
static void piix_ide_register_types(void)
{
+ pci_piix3_xen_ide_unplug_done = false;
type_register_static(&piix3_ide_info);
type_register_static(&piix3_ide_xen_info);
type_register_static(&piix4_ide_info);
next reply other threads:[~2021-03-16 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 22:44 Olaf Hering [this message]
2021-03-16 22:48 ` [PATCH v1] piix: fix regression during unplug in Xen HVM domUs no-reply
2021-03-17 0:16 ` Philippe Mathieu-Daudé
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=20210316224412.11609-1-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=jsnow@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 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).