From nobody Mon Feb 9 13:38:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621374960; cv=none; d=zohomail.com; s=zohoarc; b=bfyBOylgDo+Kd9E9ZVeUl7oZYGP7KMlv2cg+jh4gHQq4VU4WV/ZgZO67DhX28VPNcWw+1nRz5jS+9cyWaDyOY1dpNM2On9o70yzyx+UEnRjvGcnujgTzny73zxnSwJNlvOEm0CVxYIaIack6dMiRyEbc8ThhEZtbhTxgmwBwEXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621374960; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=dfCgiJU0/iWOxOTGg77x6mXGX5z5RsV773l26eByVJA=; b=WclXsSy39U8w06e0o+tzBGnySbJ0zM4oZtt3ILIRHN5SvWbrDwGKB7G9FgHgYBa/+CsZkBhhZQc1YAoGRWqC/1v534mh1JOmQ4DnpKiUbcrTVMsL6xht8rbQqxvK1/o0ACaJYCP2lGk3Ib7PDtVobIlFcGHk61oTEv0u64Zp/Qo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1621374960497716.1488343067844; Tue, 18 May 2021 14:56:00 -0700 (PDT) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-U1OoipDEPxyOemvc3Tjc8g-1; Tue, 18 May 2021 17:55:58 -0400 Received: by mail-ed1-f72.google.com with SMTP id u14-20020a05640207ceb029038d4bfbf3a6so2928938edy.9 for ; Tue, 18 May 2021 14:55:57 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id f26sm6989792ejl.66.2021.05.18.14.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 14:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621374959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dfCgiJU0/iWOxOTGg77x6mXGX5z5RsV773l26eByVJA=; b=Kli1h2L7zEJft5MiX18k3xySSnegfZaHUWjlGxACzQvOcm00Tqzg1X7MAlj3GlD3u6iivr HBQcsRDez+Xj1N3mq1PdHLQRPlqnN2W3zEd2VT8QvDIqnS9zM9ATlEUp9X4I5WPGnOVS2R 87cvsxYQb/pu6hPHBk0EorPnvH2+oZE= X-MC-Unique: U1OoipDEPxyOemvc3Tjc8g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dfCgiJU0/iWOxOTGg77x6mXGX5z5RsV773l26eByVJA=; b=IAc35XutJ3C5mAxV8frHp7xpMIGNIPn8qsZAxZO/wip8/6TDjWVV+oMV5v9mGCxB7o ZpddpGOXpVXrh5JiAnvghOtO1kQgvF5m/TyGco0OWYuc+jiY7rUvxOCZ/t88s/a5UqCl cqzYwBf2w9usgtowjaMGLQ+eliQkasCY7vzqldyECrC1zb0Dz/IwVdjTJIvRIviGe1ya h8/+Hd7nVBT8OHeERegDjoDkwa007IFaZYHElMpr6/GXzTPFhD00u9h88+kiHrsXLV9I i94szOiI5We7dHVm3qDzgefwXB13rizM6oNgWxtpX0bo00Ukszmt8k9UsI2TTsZV3oXs XyFQ== X-Gm-Message-State: AOAM532V7aSrRyoFfAY5jFCEghtA4XUc8bG3meM2++KdctaXpfz2F8Po hCApBL6TNhx/A0bqwHHMmCOdyz4AZ1kK5+izTen5J0uK60do4gRrp1YtHzGDV8Ay2TpECGXklN0 ytK8XsuZsMT3ijw== X-Received: by 2002:a17:907:920e:: with SMTP id ka14mr8282131ejb.193.1621374956761; Tue, 18 May 2021 14:55:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+MTukvoJwK8+OcNQSzpnyMtpae8UHmkN1XpssPufUEfT7X9ivR+M6SXkYCeI/zYf5hMpEDg== X-Received: by 2002:a17:907:920e:: with SMTP id ka14mr8282122ejb.193.1621374956593; Tue, 18 May 2021 14:55:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: John Snow , qemu-devel@nongnu.org Cc: Elena Ufimtseva , Markus Armbruster , Mark Cave-Ayland , Stefan Hajnoczi , Jagannathan Raman , Thomas Huth , John G Johnson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link Date: Tue, 18 May 2021 23:55:36 +0200 Message-Id: <20210518215545.1793947-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518215545.1793947-1-philmd@redhat.com> References: <20210518215545.1793947-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) IDE bus depends on ISA bus for IRQ/DMA. Add an ISABus reference in PCIIDEState, and add link properties to it in the PIIX and VIA objects (which inherit PCI_IDE). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ide/pci.h | 1 + hw/ide/piix.c | 11 ++++++++++- hw/ide/via.c | 10 +++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index d8384e1c422..e790722ed14 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -47,6 +47,7 @@ struct PCIIDEState { PCIDevice parent_obj; /*< public >*/ =20 + ISABus *isa_bus; IDEBus bus[2]; BMDMAState bmdma[2]; uint32_t secondary; /* used only for cmd646 */ diff --git a/hw/ide/piix.c b/hw/ide/piix.c index b9860e35a5c..48da68da37f 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -30,8 +30,9 @@ #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/dma.h" - +#include "qapi/error.h" #include "hw/ide/pci.h" +#include "hw/isa/isa.h" #include "trace.h" =20 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size) @@ -207,6 +208,12 @@ static void pci_piix_ide_exitfn(PCIDevice *dev) } } =20 +static Property piix_ide_properties[] =3D { + DEFINE_PROP_LINK("isa-bus", PCIIDEState, isa_bus, + TYPE_ISA_BUS, ISABus *), + DEFINE_PROP_END_OF_LIST(), +}; + /* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */ static void piix3_ide_class_init(ObjectClass *klass, void *data) { @@ -221,6 +228,7 @@ static void piix3_ide_class_init(ObjectClass *klass, vo= id *data) k->class_id =3D PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->hotpluggable =3D false; + device_class_set_props(dc, piix_ide_properties); } =20 static const TypeInfo piix3_ide_info =3D { @@ -249,6 +257,7 @@ static void piix4_ide_class_init(ObjectClass *klass, vo= id *data) k->class_id =3D PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->hotpluggable =3D false; + device_class_set_props(dc, piix_ide_properties); } =20 static const TypeInfo piix4_ide_info =3D { diff --git a/hw/ide/via.c b/hw/ide/via.c index be09912b334..65fdca6dcf4 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -28,8 +28,9 @@ #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/module.h" +#include "qapi/error.h" #include "sysemu/dma.h" - +#include "hw/isa/isa.h" #include "hw/ide/pci.h" #include "trace.h" =20 @@ -210,6 +211,12 @@ static void via_ide_exitfn(PCIDevice *dev) } } =20 +static Property via_ide_properties[] =3D { + DEFINE_PROP_LINK("isa-bus", PCIIDEState, isa_bus, + TYPE_ISA_BUS, ISABus *), + DEFINE_PROP_END_OF_LIST(), +}; + static void via_ide_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -224,6 +231,7 @@ static void via_ide_class_init(ObjectClass *klass, void= *data) k->revision =3D 0x06; k->class_id =3D PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + device_class_set_props(dc, via_ide_properties); } =20 static const TypeInfo via_ide_info =3D { --=20 2.26.3