qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs
Date: Tue, 27 Jun 2023 13:32:34 +0200	[thread overview]
Message-ID: <20230627133234.400a2ec7.olaf@aepfle.de> (raw)
In-Reply-To: <20230626231901.5b5d11c1.olaf@aepfle.de>

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Mon, 26 Jun 2023 23:19:01 +0200 Olaf Hering <olaf@aepfle.de>:

> So far I was unable to decipher how the pci_set_word calls can
> possibly affect the outcome and the owner of memory_region_ops_read.

It is enough to return from piix_ide_reset right after
pci_set_word(pci_conf + PCI_COMMAND, 0) to trigger the issue.


One thing which was not mentioned yet: the order in which kernel drivers
are loaded matters. Usually it is xen-platform-pci/uhci-hcd/ata_piix.

When uhci loads, it scans the USB bus, finds the tablet, loads usbhid.
While this happens, ata_piix loads. It finds the PCI device in state
disabled. The PCI code enables the device. On the qemu side this ends
up in pci_default_write_config for PCI device "piix3-ide" with addr=4,
val=1, len=2. This calls pci_update_mappings, which for region #4
changes the addr from 0xc120 to 0xc100. This causes the issue. Now
usbhid tries to use the USB bus, but uhci_irq fails.

If ata_piix is not loaded, uhci works.
If ata_piix is loaded before uhci-hcd, the USB bus can not be scanned,
udev is killed after a timeout and boot proceeds.
If usbhid is loaded before ata_piix, USB bus discovery usually finishes
before ata_piix enables its PCI device, boot proceeds.


Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2023-06-27 11:33 UTC|newest]

Thread overview: 24+ 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-25 11:12   ` Olaf Hering
2021-03-25 16:49     ` Paolo Bonzini
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 [this message]

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=20230627133234.400a2ec7.olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --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 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).