Mon, 26 Jun 2023 23:19:01 +0200 Olaf Hering <o...@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
pgp1EYH9LJ2Cu.pgp
Description: Digitale Signatur von OpenPGP