[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs


  • To: Paolo Bonzini <pbonzini@xxxxxxxxxx>, John Snow <jsnow@xxxxxxxxxx>
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Tue, 27 Jun 2023 13:32:34 +0200
  • Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1687865562; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=3wLDUR1nX20PA1ahDWpaygAfJBpRhBHco6snOa6yefU=; b=Pff1dk9aKUS7uTsYK9YBps7/+OabGa4UyCXeC274kjdOQFiM9jOJxti9Cl3qWrNIes 2pRI9IIUJ06WXXz1oAPlXDk8datpiYAFw8gsylcAZ565s4gBhOHMumKDe2IRRgOdvfbF glfDrVxJoc6tKG0CKoveHrtQFKDtEXy+08zloJtGTydraFc17Wx3TdW63fd7M3G3qC4K M6j/qyrDwwqWYNEOian0QwooYM7Wq3s3gst0N7ecrn1iII3hEs4tTBG3k/x/SZG+SkhT +YgjqsJ+uUXGDfchK3xPjtPiT+RxZ/lO5ES3oW5YQSON5WsZBZfRPN366A6h9XeplfJ5 ktGw==
  • Arc-seal: i=1; a=rsa-sha256; t=1687865562; cv=none; d=strato.com; s=strato-dkim-0002; b=JHvG/liOOg9x6bnQUkcNB+uwuHKGh19BHSc2yGolHCmpCFwyM8g+cf4fSLIGrYPcIQ 3zl9J56v0bksT6YYxzGc2W3LtPYwxVO+Zs0J1YhjEiY8GfKRUFBRqXtfJFGMCg05nlbe 4TXF0N/UXVkykrOYwwwXaCiKYRhsWarEC94uXqKMeGApd7ReA5NKGyrQ9c0cUAy4EOTH 9zYhp8eIHBGPmkWqKa6NO8RH51VvPMTKJqVWd2kTg2hWtFiDFcNYVYQTbmYZsA+61aAE imj/+hoV2GEICOIv/FR/WHCRH0sl11I+W+EjzKuP+QJX8H9Xqmu95QWpLu8uVw7jb0kc Rkdw==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
  • Delivery-date: Tue, 27 Jun 2023 11:33:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

> 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: pgprjrtwcmAfY.pgp
Description: Digitale Signatur von OpenPGP


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.