From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584087986; cv=none; d=zohomail.com; s=zohoarc; b=dYaBLhL95JSmN5SOQfnjQHfjCJjV28otF3+pOSqahYQGXffLIS05/XckrX/NbexPrCiclG9LN3HgMTvIdvpHYWwGM0ZYq76yIB3qNR1dclna81nH7sXdEPwiAQRGu3HTMP/1GIit40xxkDxMwzGUfioq+NskoO8VQ+aBUzmYeTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584087986; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+V5Eq3Hf+Y4hvjB4V5q8upkR7Zp8vnf1ZPECECWt+7c=; b=VZRL5eK4JvSLVwC4/3iVM4RWJxkuAWj5VwnY8f/J9tlAElMIQhmhh5CMop7qROXMhXJvNGC6a+PBKy2d3zHOMuVY/Kmil2gxc49RGUaU3/dh9JnMtUEgYZqRVmVBaDPCKaT0KcKss7xEtei9jSFV94TiCC0q+3ebxobzzv/Krkc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584087986105598.6248861532063; Fri, 13 Mar 2020 01:26:26 -0700 (PDT) Received: from localhost ([::1]:55492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfeC-0001ap-VQ for importer@patchew.org; Fri, 13 Mar 2020 04:26:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56550) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfcr-00084D-OI for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfcq-0004la-OZ for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:01 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51500 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfco-0004gl-Q9; Fri, 13 Mar 2020 04:24:58 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfd9-0007Mr-FE; Fri, 13 Mar 2020 08:25:22 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:38 +0000 Message-Id: <20200313082444.2439-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 1/7] via-ide: move registration of VMStateDescription to DeviceClass X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: BALATON Zoltan --- hw/ide/via.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 096de8dba0..84f0efff94 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -190,8 +190,6 @@ static void via_ide_realize(PCIDevice *dev, Error **err= p) bmdma_setup_bar(d); pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar); =20 - vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); - for (i =3D 0; i < 2; i++) { ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); ide_init2(&d->bus[i], qemu_allocate_irq(via_ide_set_irq, d, i)); @@ -227,6 +225,7 @@ static void via_ide_class_init(ObjectClass *klass, void= *data) PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 dc->reset =3D via_ide_reset; + dc->vmsd =3D &vmstate_ide_pci; k->realize =3D via_ide_realize; k->exit =3D via_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_VIA; --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584088100; cv=none; d=zohomail.com; s=zohoarc; b=U3b7VR2S5W+EBAOY6XW57oNUSH5uezap59mL3xNeyN0R192iBG/k6HWM7SXciJF8ty6TOQZjwKzJOJLb16kSTZmJKb+iZiyKvu914ky+0NgE72TZmVsQ347wjtbgHxTAS/5ae4hdFkqCBA+HHZ+DDx2YBRHhKgiSr9ur3lyKowg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584088100; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ofiTNrjOtqHQR6zMWyHd6vNMgG+bM8ewWkpOsrpCgKM=; b=fbAZHVHKSfNoesm/gXG0U2WS5n+O/7d6CQwd7/AVW6sbHnV0vShzBj/7VPctwzsFWAaGZWOKX9Gs0P5Vo/9ISj30xqe2xFg8lDXuGYe1/LUv8zBSJTBTtWLHCrSLjM2cdScxfFm3N8lwbfEreLsCQIfU4KRxlsFVS/ORKBLieRA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584088100449122.88927958373142; Fri, 13 Mar 2020 01:28:20 -0700 (PDT) Received: from localhost ([::1]:55518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfg3-00048L-3J for importer@patchew.org; Fri, 13 Mar 2020 04:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56710) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfcy-0008Pt-EJ for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfcx-0004wJ-8V for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51510 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfcu-0004qL-Ji; Fri, 13 Mar 2020 04:25:04 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdC-0007Mr-Qw; Fri, 13 Mar 2020 08:25:27 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:39 +0000 Message-Id: <20200313082444.2439-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 2/7] ide/via: Get rid of via_ide_init() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Follow example of CMD646 and remove via_ide_init function and do it directly in board code instead. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/ide/via.c | 8 -------- hw/mips/mips_fulong2e.c | 5 ++++- include/hw/ide.h | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 84f0efff94..3153be8862 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -211,14 +211,6 @@ static void via_ide_exitfn(PCIDevice *dev) } } =20 -void via_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) -{ - PCIDevice *dev; - - dev =3D pci_create_simple(bus, devfn, "via-ide"); - pci_ide_create_devs(dev, hd_table); -} - static void via_ide_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 4727b1d3a4..639ba2a091 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -37,6 +37,7 @@ #include "qemu/log.h" #include "hw/loader.h" #include "hw/ide.h" +#include "hw/ide/pci.h" #include "elf.h" #include "hw/isa/vt82c686.h" #include "hw/rtc/mc146818rtc.h" @@ -239,6 +240,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus,= int slot, qemu_irq intc, qemu_irq *i8259; ISABus *isa_bus; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; + PCIDevice *dev; =20 isa_bus =3D vt82c686b_isa_init(pci_bus, PCI_DEVFN(slot, 0)); if (!isa_bus) { @@ -256,8 +258,9 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus,= int slot, qemu_irq intc, /* Super I/O */ isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO); =20 + dev =3D pci_create_simple(pci_bus, PCI_DEVFN(slot, 1), "via-ide"); ide_drive_get(hd, ARRAY_SIZE(hd)); - via_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1)); + pci_ide_create_devs(dev, hd); =20 pci_create_simple(pci_bus, PCI_DEVFN(slot, 2), "vt82c686b-usb-uhci"); pci_create_simple(pci_bus, PCI_DEVFN(slot, 3), "vt82c686b-usb-uhci"); diff --git a/include/hw/ide.h b/include/hw/ide.h index 28d8a06439..575c099b5b 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -18,7 +18,6 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo = **hd_table, int devfn); PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn= ); PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn= ); int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux); -void via_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn); =20 /* ide-mmio.c */ void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1= ); --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584088195; cv=none; d=zohomail.com; s=zohoarc; b=OhfWrZx0wmG/YRclMruSBuHSxXzy134OK1KeNVK5E79XYf5ST9mSoNByUBJQuoZROpLchHRd4qHWL1n39wGwlWh4DA1OppzoIyGAhjEwpSg0FkGMj4B0WZxOJYO04uxhMEPFKTYrF5YXu9dNpD5/8Nzoykeb8dEHy4CEGbbxTH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584088195; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3N9qMafSdnjXzi57tKiD/GXtoTON5ujCxclwCb4hHkE=; b=MiR1r9cccwe7RL/qv9l772wV7vB+KOHCGBsC0OBVaUscBS9Xcfkc1MO7hvEMhY7ScuhFDvYaHGgMQdnrSa98Wy6gQNQkk7Jen//1+scGpCtQqKpFmNnd1vzLLwrGwpRhvmZMt0M8aj++jznzBFZI8HkNy6jmb5/DFZlTiD+4ub0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584088195487849.9986512500536; Fri, 13 Mar 2020 01:29:55 -0700 (PDT) Received: from localhost ([::1]:55536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfha-0006Rk-EV for importer@patchew.org; Fri, 13 Mar 2020 04:29:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56724) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfcy-0008RO-Qr for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfcx-0004xE-Nu for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51520 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfcv-0004sW-Fa; Fri, 13 Mar 2020 04:25:05 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdH-0007Mr-P2; Fri, 13 Mar 2020 08:25:29 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:40 +0000 Message-Id: <20200313082444.2439-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 3/7] pci: Honour wmask when resetting PCI_INTERRUPT_LINE X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan The pci_do_device_reset() function (called from pci_device_reset) clears the PCI_INTERRUPT_LINE config reg of devices on the bus but did this without taking wmask into account. We'll have a device model now that needs to set a constant value for this reg and this patch allows to do that without additional workaround in device emulation to reverse the effect of this PCI bus reset function. Suggested-by: Mark Cave-Ayland Signed-off-by: BALATON Zoltan Reviewed-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e1ed6677e1..b5bc842fac 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -302,8 +302,11 @@ static void pci_do_device_reset(PCIDevice *dev) pci_word_test_and_clear_mask(dev->config + PCI_STATUS, pci_get_word(dev->wmask + PCI_STATUS) | pci_get_word(dev->w1cmask + PCI_STATUS)); + /* Some devices make bits of PCI_INTERRUPT_LINE read only */ + pci_byte_test_and_clear_mask(dev->config + PCI_INTERRUPT_LINE, + pci_get_word(dev->wmask + PCI_INTERRUPT_LINE= ) | + pci_get_word(dev->w1cmask + PCI_INTERRUPT_LI= NE)); dev->config[PCI_CACHE_LINE_SIZE] =3D 0x0; - dev->config[PCI_INTERRUPT_LINE] =3D 0x0; for (r =3D 0; r < PCI_NUM_REGIONS; ++r) { PCIIORegion *region =3D &dev->io_regions[r]; if (!region->size) { --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584087996; cv=none; d=zohomail.com; s=zohoarc; b=MHN8nO693asfKYyr1YprOL9hdUtufGcnTYof3ZRCM1lzBpLGiYb6Flg5apuO0kO2pbAbYvjp2ucNpxl6NrwlfPq3XD/luWZLpp3tPsalw+2WSCkLEpitnubgXpb+OO4GGp5KeUwM+dJ262YeubYGAh4sAnZfdoQQUe4DWG0v/Sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584087996; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ci9pRBktToGB1ePv+Jz12c9lt5uV6KbiAqhtTDTormM=; b=lv9U0zbh6t8KbVp7P0Luv15LdrwvWqdCmWDKAkOUbIq/vMFjSVAJBeguSr5hGfOaswo5b1reN3LEHfW1Ac30DRP6kJwsABtbQSfBvLtyLq5t1yXNLRA+DEzoGpG5615DvHazriCoUABHoPrCuCAjZkIl6m7cqjBhY3yjlnnwkM4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584087996152805.1825547723028; Fri, 13 Mar 2020 01:26:36 -0700 (PDT) Received: from localhost ([::1]:55494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfeN-0001rB-26 for importer@patchew.org; Fri, 13 Mar 2020 04:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56855) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfd5-0000Gy-3V for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfd3-00058P-3I for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:15 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51530 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfd0-00050d-P0; Fri, 13 Mar 2020 04:25:10 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdJ-0007Mr-P4; Fri, 13 Mar 2020 08:25:34 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:41 +0000 Message-Id: <20200313082444.2439-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 4/7] via-ide: ensure that PCI_INTERRUPT_LINE is hard-wired to its default value X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Some firmwares accidentally write to PCI_INTERRUPT_LINE on startup which has no effect on real hardware since it is hard-wired to its default value, but causes the guest OS to become confused trying to initialise IDE devices when running under QEMU. Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/ide/via.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 3153be8862..8363bd4802 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -169,7 +169,7 @@ static void via_ide_realize(PCIDevice *dev, Error **err= p) =20 pci_config_set_prog_interface(pci_conf, 0x8f); /* native PCI ATA mode = */ pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); - dev->wmask[PCI_INTERRUPT_LINE] =3D 0xf; + dev->wmask[PCI_INTERRUPT_LINE] =3D 0; =20 memory_region_init_io(&d->data_bar[0], OBJECT(d), &pci_ide_data_le_ops, &d->bus[0], "via-ide0-data", 8); --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584088115; cv=none; d=zohomail.com; s=zohoarc; b=NXuxV+C5qYM8vlxqAPsYzguuyRDMTVu9lNBz9UI7AaeaDFa+CD0sERWLHTSfTJNC66aXRkK2S8KuDXk6I1BkOhYt4JcjrNqrQcRBxpud3bMYTQumqBiLYCHYlWsY9YedPBR1rNVcGYCs+8jb6ov4h9yDC6O4KEFtgTGyn+R/VJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584088115; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=joESo9WkRk4D6rSpSEdgp0vvP0+fQ2x7m+g2qKrUVA0=; b=jVoD7yFhygZ2Ry5OZRPckOgfxOyzqD8QsyY75perxfLgA5Tz+6bHPeJy+o9EKhs48uACMXbuY+QVsawdtjdF/ctSIbsOc/ial+O/Eq5Q0pZpSC63d3G+FDpOa+MTYpAZB5sN8B9Gd7HgV6Xh0pE2OQVuU1r9cT+tlULj0yRjT6Q= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584088115043138.37600842971597; Fri, 13 Mar 2020 01:28:35 -0700 (PDT) Received: from localhost ([::1]:55522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfgI-0004Y0-1F for importer@patchew.org; Fri, 13 Mar 2020 04:28:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57007) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfdC-0000cg-CZ for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfdA-0005Lw-Sx for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51540 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfd7-0005Fy-RI; Fri, 13 Mar 2020 04:25:17 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdO-0007Mr-Kv; Fri, 13 Mar 2020 08:25:40 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:42 +0000 Message-Id: <20200313082444.2439-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 5/7] via-ide: initialise IDE controller in legacy mode X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" According to both the VT82C686B and VT8231 datasheets the VIA Southbridge I= DE controller is initialised in legacy mode. This allows Linux to correctly determine that legacy rather than PCI IRQ ro= uting should be used since the boot console text in the fulong2e test image chang= es from: scsi0 : pata_via scsi1 : pata_via ata1: PATA max UDMA/100 cmd 0xffffffffbfd04050 ctl 0xffffffffbfd04062 \ bmdma 0xffffffffbfd04040 irq 14 ata2: PATA max UDMA/100 cmd 0xffffffffbfd04058 ctl 0xffffffffbfd04066 \ bmdma 0xffffffffbfd04048 irq 14 to: scsi0 : pata_via scsi1 : pata_via ata1: PATA max UDMA/100 cmd 0xffffffffbfd001f0 ctl 0xffffffffbfd003f6 \ bmdma 0xffffffffbfd04040 irq 14 ata2: PATA max UDMA/100 cmd 0xffffffffbfd00170 ctl 0xffffffffbfd00376 \ bmdma 0xffffffffbfd04048 irq 15 Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/ide/via.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 8363bd4802..c8835de01b 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -167,7 +167,7 @@ static void via_ide_realize(PCIDevice *dev, Error **err= p) uint8_t *pci_conf =3D dev->config; int i; =20 - pci_config_set_prog_interface(pci_conf, 0x8f); /* native PCI ATA mode = */ + pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy mode */ pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); dev->wmask[PCI_INTERRUPT_LINE] =3D 0; =20 --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584088305; cv=none; d=zohomail.com; s=zohoarc; b=ait8Nz258Vi++/gOxifPZsbf+qNmocFRapkv/tyBncbxKrthrAAtkXLT1yf0asmIaL85R0HHTc4m6QwhVsp5lqqjl8SQ7mBbrUl5T+YawJj4yghP8eFZzOy58QkRV+oBkvzhxXGv/3E53RlNJUzOBHV50nrtGoTTEpfEALVntBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584088305; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ohAs69ukdMTcxUimVsHYpsCFYN9dUSP2Ftc6aQJ5FVQ=; b=ELVakJYdP1RiaDLjNj2aCCWN1XMLr3P/qyZ59orubEkHkzVcLh1ALi8GaNPDI0HJlQCF/PBSg8NKyd3pwnntXmbN3WIRTvVASLRVSfJPjUGZWEcqZAJH+SdP7MhiHXKbJqaTEvWiVPzT7Dc1vA/KZ4fjxajg2N0KzOsKTraeGX4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584088305603492.0707210425695; Fri, 13 Mar 2020 01:31:45 -0700 (PDT) Received: from localhost ([::1]:55570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfjM-0008VQ-Fu for importer@patchew.org; Fri, 13 Mar 2020 04:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfdM-0000nT-0x for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfdK-0005Yh-Az for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51550 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfdD-0005R9-Pa; Fri, 13 Mar 2020 04:25:23 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdU-0007Mr-SA; Fri, 13 Mar 2020 08:25:47 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:43 +0000 Message-Id: <20200313082444.2439-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 6/7] via-ide: allow guests to write to PCI_CLASS_PROG X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" MorphOS writes to PCI_CLASS_PROG during IDE initialisation to place the controller in native mode, but thinks the initialisation has failed because the native mode bits aren't set when reading the register back. Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/ide/via.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/via.c b/hw/ide/via.c index c8835de01b..3c4d474e48 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -170,6 +170,7 @@ static void via_ide_realize(PCIDevice *dev, Error **err= p) pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy mode */ pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); dev->wmask[PCI_INTERRUPT_LINE] =3D 0; + dev->wmask[PCI_CLASS_PROG] =3D 5; =20 memory_region_init_io(&d->data_bar[0], OBJECT(d), &pci_ide_data_le_ops, &d->bus[0], "via-ide0-data", 8); --=20 2.20.1 From nobody Wed May 1 11:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584088113; cv=none; d=zohomail.com; s=zohoarc; b=hL4vfM/tHKfuXTCP3OfLJ4/pxWGSFxjQLTxxPyrjsx6QwTQnu2nudOuL6qxwe08Ti9GPwiyPhEI+u3BYOGD3I3hGNrvvLoJFguJ3XWC2RUjZ6/O2jHWuTPajNJ/dce/WxVo028u4KaS0v/Num47xXGh+KOzPBtIkoD4tj5SAZpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584088113; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vtdH3qKSLSTK8SVqQPl95znvgrIH8bzUbHHzfP3/LLc=; b=RCjOqcvFo4aTQqmKRHs6p5WP9Sm4XxF02RkkP04jZv712QdYFPktxxapjW4Or1vzjLvHfrH3MZ+vAByd7LvimxCYJwol7ZUqZVI8YwYrmj/Ut2cawgop8BoDHwLJIDQEtO+7QhyXwYa3FiRezRsSPyYPVQ0XOAa8PWr9K47o064= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584088113820329.2777848936571; Fri, 13 Mar 2020 01:28:33 -0700 (PDT) Received: from localhost ([::1]:55520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfgG-0004Uh-Rz for importer@patchew.org; Fri, 13 Mar 2020 04:28:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfdO-0000pP-3o for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfdN-0005bx-5H for qemu-devel@nongnu.org; Fri, 13 Mar 2020 04:25:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51558 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCfdK-0005Xz-Am; Fri, 13 Mar 2020 04:25:30 -0400 Received: from host86-185-91-43.range86-185.btcentralplus.com ([86.185.91.43] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCfdb-0007Mr-N6; Fri, 13 Mar 2020 08:25:52 +0000 From: Mark Cave-Ayland To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com, mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, balaton@eik.bme.hu Date: Fri, 13 Mar 2020 08:24:44 +0000 Message-Id: <20200313082444.2439-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> References: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.185.91.43 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 7/7] via-ide: always use legacy IRQ 14/15 routing X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The existing code uses fixed PCI IRQ routing on IRQ 14 rather than legacy I= RQ 14/15 routing as documented in the datasheet. With the changes in this patchset guest OSs now correctly detect and config= ure the VIA controller in legacy IRQ routing mode, allowing the incorrect fixed PCI IRQ routing to be removed. Note that this fixed legacy IRQ 14/15 routing is identical to similar behav= iour in the early PIIX IDE controllers. Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan --- hw/ide/via.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 3c4d474e48..8de4945cc1 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -113,10 +113,7 @@ static void via_ide_set_irq(void *opaque, int n, int l= evel) } =20 level =3D (d->config[0x70] & 0x80) || (d->config[0x78] & 0x80); - n =3D pci_get_byte(d->config + PCI_INTERRUPT_LINE); - if (n) { - qemu_set_irq(isa_get_irq(NULL, n), level); - } + qemu_set_irq(isa_get_irq(NULL, 14 + n), level); } =20 static void via_ide_reset(DeviceState *dev) --=20 2.20.1