From nobody Sat Feb 7 19:41:36 2026 Delivered-To: importer@patchew.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; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634260693996288.52876097017986; Thu, 14 Oct 2021 18:18:13 -0700 (PDT) Received: from localhost ([::1]:56418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbBrQ-0002nt-O7 for importer@patchew.org; Thu, 14 Oct 2021 21:18:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqP-0000n3-Gh for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:13 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]:56132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqH-0006aF-DV for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:09 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 4828A756066; Fri, 15 Oct 2021 03:16:58 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id BD3DE748F56; Fri, 15 Oct 2021 03:16:57 +0200 (CEST) Message-Id: <7cb7a16ff4daf8f48d576246255bea1fd355207c.1634259980.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 1/4] vt82c686: Move common code to via_isa_realize Date: Fri, 15 Oct 2021 03:06:20 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634260696895100001 Content-Type: text/plain; charset="utf-8" The vt82c686b_realize and vt8231_realize methods are almost identical, factor out the common parts to a via_isa_realize function to avoid code duplication. Signed-off-by: BALATON Zoltan Reviewed-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/vt82c686.c | 67 ++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index f57f3e7067..5b41539f2c 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -542,6 +542,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ViaISAState, VIA_ISA) struct ViaISAState { PCIDevice dev; qemu_irq cpu_intr; + ISABus *isa_bus; ViaSuperIOState *via_sio; }; =20 @@ -572,6 +573,29 @@ static void via_isa_request_i8259_irq(void *opaque, in= t irq, int level) qemu_set_irq(s->cpu_intr, level); } =20 +static void via_isa_realize(PCIDevice *d, Error **errp) +{ + ViaISAState *s =3D VIA_ISA(d); + DeviceState *dev =3D DEVICE(d); + qemu_irq *isa_irq; + int i; + + qdev_init_gpio_out(dev, &s->cpu_intr, 1); + isa_irq =3D qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); + s->isa_bus =3D isa_bus_new(dev, get_system_memory(), pci_address_space= _io(d), + &error_fatal); + isa_bus_irqs(s->isa_bus, i8259_init(s->isa_bus, *isa_irq)); + i8254_pit_init(s->isa_bus, 0x40, 0, NULL); + i8257_dma_init(s->isa_bus, 0); + mc146818_rtc_init(s->isa_bus, 2000, NULL); + + for (i =3D 0; i < PCI_CONFIG_HEADER_SIZE; i++) { + if (i < PCI_COMMAND || i >=3D PCI_REVISION_ID) { + d->wmask[i] =3D 0; + } + } +} + /* TYPE_VT82C686B_ISA */ =20 static void vt82c686b_write_config(PCIDevice *d, uint32_t addr, @@ -610,27 +634,10 @@ static void vt82c686b_isa_reset(DeviceState *dev) static void vt82c686b_realize(PCIDevice *d, Error **errp) { ViaISAState *s =3D VIA_ISA(d); - DeviceState *dev =3D DEVICE(d); - ISABus *isa_bus; - qemu_irq *isa_irq; - int i; =20 - qdev_init_gpio_out(dev, &s->cpu_intr, 1); - isa_irq =3D qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); - isa_bus =3D isa_bus_new(dev, get_system_memory(), pci_address_space_io= (d), - &error_fatal); - isa_bus_irqs(isa_bus, i8259_init(isa_bus, *isa_irq)); - i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); - s->via_sio =3D VIA_SUPERIO(isa_create_simple(isa_bus, + via_isa_realize(d, errp); + s->via_sio =3D VIA_SUPERIO(isa_create_simple(s->isa_bus, TYPE_VT82C686B_SUPERIO)); - mc146818_rtc_init(isa_bus, 2000, NULL); - - for (i =3D 0; i < PCI_CONFIG_HEADER_SIZE; i++) { - if (i < PCI_COMMAND || i >=3D PCI_REVISION_ID) { - d->wmask[i] =3D 0; - } - } } =20 static void vt82c686b_class_init(ObjectClass *klass, void *data) @@ -691,26 +698,10 @@ static void vt8231_isa_reset(DeviceState *dev) static void vt8231_realize(PCIDevice *d, Error **errp) { ViaISAState *s =3D VIA_ISA(d); - DeviceState *dev =3D DEVICE(d); - ISABus *isa_bus; - qemu_irq *isa_irq; - int i; - - qdev_init_gpio_out(dev, &s->cpu_intr, 1); - isa_irq =3D qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); - isa_bus =3D isa_bus_new(dev, get_system_memory(), pci_address_space_io= (d), - &error_fatal); - isa_bus_irqs(isa_bus, i8259_init(isa_bus, *isa_irq)); - i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); - s->via_sio =3D VIA_SUPERIO(isa_create_simple(isa_bus, TYPE_VT8231_SUPE= RIO)); - mc146818_rtc_init(isa_bus, 2000, NULL); =20 - for (i =3D 0; i < PCI_CONFIG_HEADER_SIZE; i++) { - if (i < PCI_COMMAND || i >=3D PCI_REVISION_ID) { - d->wmask[i] =3D 0; - } - } + via_isa_realize(d, errp); + s->via_sio =3D VIA_SUPERIO(isa_create_simple(s->isa_bus, + TYPE_VT8231_SUPERIO)); } =20 static void vt8231_class_init(ObjectClass *klass, void *data) --=20 2.21.4 From nobody Sat Feb 7 19:41:36 2026 Delivered-To: importer@patchew.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; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634260801279666.0879089471861; Thu, 14 Oct 2021 18:20:01 -0700 (PDT) Received: from localhost ([::1]:60834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbBtA-0005mc-2r for importer@patchew.org; Thu, 14 Oct 2021 21:20:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqO-0000mx-I3 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:13 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:28384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqH-0006a5-Ew for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:06 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 45C3575604D; Fri, 15 Oct 2021 03:16:58 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id C6E65748F58; Fri, 15 Oct 2021 03:16:57 +0200 (CEST) Message-Id: <778c04dc2c8affac060b8edf9e8d7dab3c3e04eb.1634259980.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 2/4] vt82c686: Add a method to VIA_ISA to raise ISA interrupts Date: Fri, 15 Oct 2021 03:06:20 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634260803420100001 Content-Type: text/plain; charset="utf-8" Other functions in the VT82xx chips need to raise ISA interrupts. Keep a reference to them in the device state and add via_isa_set_irq() to allow setting their state. Signed-off-by: BALATON Zoltan Reviewed-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/vt82c686.c | 10 +++++++++- include/hw/isa/vt82c686.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 5b41539f2c..8f656251b8 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -542,6 +542,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ViaISAState, VIA_ISA) struct ViaISAState { PCIDevice dev; qemu_irq cpu_intr; + qemu_irq *isa_irqs; ISABus *isa_bus; ViaSuperIOState *via_sio; }; @@ -567,6 +568,12 @@ static const TypeInfo via_isa_info =3D { }, }; =20 +void via_isa_set_irq(PCIDevice *d, int n, int level) +{ + ViaISAState *s =3D VIA_ISA(d); + qemu_set_irq(s->isa_irqs[n], level); +} + static void via_isa_request_i8259_irq(void *opaque, int irq, int level) { ViaISAState *s =3D opaque; @@ -584,7 +591,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp) isa_irq =3D qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); s->isa_bus =3D isa_bus_new(dev, get_system_memory(), pci_address_space= _io(d), &error_fatal); - isa_bus_irqs(s->isa_bus, i8259_init(s->isa_bus, *isa_irq)); + s->isa_irqs =3D i8259_init(s->isa_bus, *isa_irq); + isa_bus_irqs(s->isa_bus, s->isa_irqs); i8254_pit_init(s->isa_bus, 0x40, 0, NULL); i8257_dma_init(s->isa_bus, 0); mc146818_rtc_init(s->isa_bus, 2000, NULL); diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index 0f01aaa471..56ac141be3 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -1,6 +1,8 @@ #ifndef HW_VT82C686_H #define HW_VT82C686_H =20 +#include "hw/pci/pci.h" + #define TYPE_VT82C686B_ISA "vt82c686b-isa" #define TYPE_VT82C686B_PM "vt82c686b-pm" #define TYPE_VT8231_ISA "vt8231-isa" @@ -8,4 +10,6 @@ #define TYPE_VIA_AC97 "via-ac97" #define TYPE_VIA_MC97 "via-mc97" =20 +void via_isa_set_irq(PCIDevice *d, int n, int level); + #endif --=20 2.21.4 From nobody Sat Feb 7 19:41:36 2026 Delivered-To: importer@patchew.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; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634260879427638.5493535586791; Thu, 14 Oct 2021 18:21:19 -0700 (PDT) Received: from localhost ([::1]:34722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbBuQ-0007CY-HP for importer@patchew.org; Thu, 14 Oct 2021 21:21:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqP-0000n2-CS for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:13 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:50161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqN-00079R-Ng for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:09 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 2C3D1756072; Fri, 15 Oct 2021 03:17:05 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id CB7B7756057; Fri, 15 Oct 2021 03:16:57 +0200 (CEST) Message-Id: <228ffba872d7870392270b36910ac8250cd7ff96.1634259980.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 3/4] hw/usb/vt82c686-uhci-pci: Avoid using isa_get_irq() Date: Fri, 15 Oct 2021 03:06:20 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634260881483100001 Content-Type: text/plain; charset="utf-8" Use via_isa_set_irq() which better encapsulates irq handling in the vt82xx model and avoids using isa_get_irq() that has a comment saying it should not be used. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/vt82c686-uhci-pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c index e70e739409..92479d11e5 100644 --- a/hw/usb/vt82c686-uhci-pci.c +++ b/hw/usb/vt82c686-uhci-pci.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "hw/irq.h" +#include "hw/isa/vt82c686.h" #include "hcd-uhci.h" =20 static void uhci_isa_set_irq(void *opaque, int irq_num, int level) @@ -7,7 +8,7 @@ static void uhci_isa_set_irq(void *opaque, int irq_num, int= level) UHCIState *s =3D opaque; uint8_t irq =3D pci_get_byte(s->dev.config + PCI_INTERRUPT_LINE); if (irq > 0 && irq < 15) { - qemu_set_irq(isa_get_irq(NULL, irq), level); + via_isa_set_irq(pci_get_function_0(&s->dev), irq, level); } } =20 --=20 2.21.4 From nobody Sat Feb 7 19:41:36 2026 Delivered-To: importer@patchew.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; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163426069813891.6057843818005; Thu, 14 Oct 2021 18:18:18 -0700 (PDT) Received: from localhost ([::1]:56600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbBrU-0002vA-Vm for importer@patchew.org; Thu, 14 Oct 2021 21:18:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqP-0000n1-5k for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:13 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:50156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbBqH-0006a7-FG for qemu-devel@nongnu.org; Thu, 14 Oct 2021 21:17:08 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 4A10B75606C; Fri, 15 Oct 2021 03:16:58 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id CFC3A756060; Fri, 15 Oct 2021 03:16:57 +0200 (CEST) Message-Id: <26cb1848c9fc0360df7a57c2c9ba5e03c4a692b5.1634259980.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 4/4] via-ide: Avoid using isa_get_irq() Date: Fri, 15 Oct 2021 03:06:20 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634260698600100005 Content-Type: text/plain; charset="utf-8" Use via_isa_set_irq() which better encapsulates irq handling in the vt82xx model and avoids using isa_get_irq() that has a comment saying it should not be used. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/via.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 94cc2142c7..252d18f4ac 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -29,7 +29,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h" - +#include "hw/isa/vt82c686.h" #include "hw/ide/pci.h" #include "trace.h" =20 @@ -112,7 +112,7 @@ static void via_ide_set_irq(void *opaque, int n, int le= vel) d->config[0x70 + n * 8] &=3D ~0x80; } =20 - qemu_set_irq(isa_get_irq(NULL, 14 + n), level); + via_isa_set_irq(pci_get_function_0(d), 14 + n, level); } =20 static void via_ide_reset(DeviceState *dev) --=20 2.21.4 From nobody Sat Feb 7 19:41:36 2026 Delivered-To: importer@patchew.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; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634290177988155.71265006727958; Fri, 15 Oct 2021 02:29:37 -0700 (PDT) Received: from localhost ([::1]:44896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbJWy-0000uj-Pu for importer@patchew.org; Fri, 15 Oct 2021 05:29:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbJPh-0005NA-GC for qemu-devel@nongnu.org; Fri, 15 Oct 2021 05:22:05 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:55705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbJPe-0006Gv-OR for qemu-devel@nongnu.org; Fri, 15 Oct 2021 05:22:04 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 5A2EA748F58; Fri, 15 Oct 2021 11:21:59 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 3E863748F57; Fri, 15 Oct 2021 11:21:59 +0200 (CEST) In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH] via-ide: Set user_creatable to false Date: Fri, 15 Oct 2021 11:16:54 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org Message-Id: <20211015092159.3E863748F57@zero.eik.bme.hu> X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634290179738100003 Content-Type: text/plain; charset="utf-8" This model only works as a function of the via superio chip not as a standalone PCI device. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- This should be before the last patch changing via-ide or squshed into it. And similar to usb part but there I need to add it to the info struct. I can resend with these if you think this series worth the hassle. The previous one fixing the usb irq works without this clean up. hw/ide/via.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/ide/via.c b/hw/ide/via.c index 252d18f4ac..82def819c4 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -217,6 +217,9 @@ static void via_ide_class_init(ObjectClass *klass, void= *data) =20 dc->reset =3D via_ide_reset; dc->vmsd =3D &vmstate_ide_pci; + /* Reason: only works as function of VIA southbridge */ + dc->user_creatable =3D false; + k->realize =3D via_ide_realize; k->exit =3D via_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_VIA; --=20 2.21.4