File qemu.230dfd9257e92259876c113e58b5f0d22b056d2e.patch of Package qemu-5.1

From: Olaf Hering <olaf@aepfle.de>
Date: Sat, 15 Jul 2023 05:51:49 +0000
Subject: 230dfd9257e92259876c113e58b5f0d22b056d2e
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

hw/ide/piix: properly initialize the BMIBA register

According to the 82371FB documentation (82371FB.pdf, 2.3.9. BMIBA-BUS
MASTER INTERFACE BASE ADDRESS REGISTER, April 1997), the register is
32bit wide. To properly reset it to default values, all 32bit need to be
cleared. Bit #0 "Resource Type Indicator (RTE)" needs to be enabled.

The initial change wrote just the lower 8 bit, leaving parts of the "Bus
Master Interface Base Address" address at bit 15:4 unchanged.

Fixes: e6a71ae327 ("Add support for 82371FB (Step A1) and Improved support for 82371SB (Function 1)")

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230712074721.14728-1-olaf@aepfle.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 hw/ide/piix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -111,25 +111,25 @@ static void piix_ide_reset(DeviceState *dev)
 
     for (i = 0; i < 2; i++) {
         ide_bus_reset(&d->bus[i]);
     }
 
     /* TODO: this is the default. do not override. */
     pci_conf[PCI_COMMAND] = 0x00;
     /* TODO: this is the default. do not override. */
     pci_conf[PCI_COMMAND + 1] = 0x00;
     /* TODO: use pci_set_word */
     pci_conf[PCI_STATUS] = PCI_STATUS_FAST_BACK;
     pci_conf[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_MEDIUM >> 8;
-    pci_conf[0x20] = 0x01; /* BMIBA: 20-23h */
+    pci_set_long(pci_conf + 0x20, 0x1);  /* BMIBA: 20-23h */
 }
 
 static void pci_piix_init_ports(PCIIDEState *d) {
     static const struct {
         int iobase;
         int iobase2;
         int isairq;
     } port_info[] = {
         {0x1f0, 0x3f6, 14},
         {0x170, 0x376, 15},
     };
     int i;
openSUSE Build Service is sponsored by