From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796945; cv=none; d=zohomail.com; s=zohoarc; b=Z7eYROmiD1vuiXr4UfOfGrC00NpgEvHoNc8l2xdGysJEuyZLdIBGLYbp+izUwDXVAFYb0hQo+PNejXUqZf/mNgUZuTaMid8FuOTOI/6RWNX27crHiHmvANXMIRImcJH0PFlUCaVwK79fueW+t8dCGN/PX08CnWWmWSSYU1jkwSk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796945; h=Content-Type:Content-Transfer-Encoding:Cc: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=NiuWoaksh0oshsP0kUmDcyGu8Cw2DTFvBk0EZlMxbKo=; b=mfLHRQqnVNIiYKzVvs4adA/w9a80WfylerhcPwye7MhDorWoZO1Ja4O73pK1VQ/cjYKP1jbsZrLXA7lvU5a7LlWIBKVX5vgJXxMXPgL2BGVHIFMgSpnWVDricqyj1GeH0ozx563R0NDFShSgUpAdb9U1F7djaOMt994n4RRWMbc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796945641854.9528296521124; Thu, 2 Mar 2023 14:42:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrby-0006yS-3c; Thu, 02 Mar 2023 17:41:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrbx-0006y6-8g for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:17 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrbt-0008Nk-9y for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:17 -0500 Received: by mail-wr1-x42d.google.com with SMTP id g3so601431wri.6 for ; Thu, 02 Mar 2023 14:41:12 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id m13-20020a056000008d00b002c54c92e125sm531885wrx.46.2023.03.02.14.41.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NiuWoaksh0oshsP0kUmDcyGu8Cw2DTFvBk0EZlMxbKo=; b=FPJNv+8+TTdqtmnHj6tfqzCUql0vlOPht4vuAofMHp9KurkxIXez/i7YoPWfaqoczJ LGR++0OiKXATsIJ2BZTSQkiDEcuHQMZNJHet3XDroBncOoUIH+hfGW16Wid+dBy8NrFe +GFQH76wicQNeOkXA/3Xt7KzbHibzev4nVpSBxAYtbZY3paNibJiNO5mIbV/djgc8mGt 6k+xVlfbUTOqeiKODx9NhvK1kVrrA2KFA7aIHEiOI+PdCBahP/GBd5X4TNteuUfv1x4Z ZDnN3hQR7mqguYe0UmU11aViP8cCfOnXDFu5ck+G2m6NeslkyBAsISxKvjjCGdQtgpjJ 0zqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NiuWoaksh0oshsP0kUmDcyGu8Cw2DTFvBk0EZlMxbKo=; b=DHEwGxZefQw1scGCi6RXMqNouNSdAUNjH4DCoPkcKBo3mluSI/SWPg9exXY48sD2Tm E8WJf5q2SwPiZixFLjgxi7UjyqJhK5B2xh5RgCrvXnP1Kwp/jXYPX+wRce4ShNWWfq67 H4KF1H+VSyEAk0zCLAfxGREvSMVTghoQFfFoB/7Q9RbO2Jn7AJWeRpvg09/Vgc2ae6fu pQ4MUWc9fjnsCMh/xCy5ULzbMW1l+TT0og50JyaScl3qxb1GHoG/ogyO5IcvfPDkpEAb GHuQmHaEH22+AubUyS+bLZ0z8G/c3NFkyMWPF2KTNu9r2evid5TlTyt/RemLOLliRnXB NxIA== X-Gm-Message-State: AO0yUKVAlxY6Thq8iIaRP6jy4PCEGyD7MgU/z531ybcMxOvh7WZpFWpt di2Qg3cT/XQdHI3t+r4awkYq5tr2rwoQL8hI X-Google-Smtp-Source: AK7set/+kcd80h2vQXleyqG0reDFOHPU8JU1qjbumAByxDLDzlzrojg/VjIOT6lfDOGhFay66eR4AA== X-Received: by 2002:a5d:6b10:0:b0:2c5:55cf:b1ab with SMTP id v16-20020a5d6b10000000b002c555cfb1abmr8410671wrw.48.1677796870769; Thu, 02 Mar 2023 14:41:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org Subject: [PATCH v3 01/18] hw/ide/piix: Expose output IRQ as properties for late object population Date: Thu, 2 Mar 2023 23:40:41 +0100 Message-Id: <20230302224058.43315-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796946090100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/ide/piix.c | 14 ++++++++++++-- include/hw/ide/piix.h | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 41d60921e3..a36dac8469 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -121,6 +121,13 @@ static void piix_ide_reset(DeviceState *dev) pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */ } =20 +static void piix_ide_initfn(Object *obj) +{ + PCIIDEState *dev =3D PCI_IDE(obj); + + qdev_init_gpio_out_named(DEVICE(obj), dev->isa_irq, "ide-irq", 2); +} + static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) { static const struct { @@ -133,6 +140,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned = i, Error **errp) }; int ret; =20 + qemu_irq irq_out =3D d->isa_irq[i] ? : isa_get_irq(NULL, port_info[i].= isairq); ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); ret =3D ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, port_info[i].iobase2); @@ -141,7 +149,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned = i, Error **errp) object_get_typename(OBJECT(d)), i); return false; } - ide_bus_init_output_irq(&d->bus[i], isa_get_irq(NULL, port_info[i].isa= irq)); + ide_bus_init_output_irq(&d->bus[i], irq_out); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus =3D &d->bus[i]; @@ -162,7 +170,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error = **errp) =20 vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); =20 - for (unsigned i =3D 0; i < 2; i++) { + for (unsigned i =3D 0; i < ARRAY_SIZE(d->isa_irq); i++) { if (!pci_piix_init_bus(d, i, errp)) { return; } @@ -199,6 +207,7 @@ static void piix3_ide_class_init(ObjectClass *klass, vo= id *data) static const TypeInfo piix3_ide_info =3D { .name =3D TYPE_PIIX3_IDE, .parent =3D TYPE_PCI_IDE, + .instance_init =3D piix_ide_initfn, .class_init =3D piix3_ide_class_init, }; =20 @@ -221,6 +230,7 @@ static void piix4_ide_class_init(ObjectClass *klass, vo= id *data) static const TypeInfo piix4_ide_info =3D { .name =3D TYPE_PIIX4_IDE, .parent =3D TYPE_PCI_IDE, + .instance_init =3D piix_ide_initfn, .class_init =3D piix4_ide_class_init, }; =20 diff --git a/include/hw/ide/piix.h b/include/hw/ide/piix.h index ef3ef3d62d..533d24d408 100644 --- a/include/hw/ide/piix.h +++ b/include/hw/ide/piix.h @@ -1,6 +1,10 @@ #ifndef HW_IDE_PIIX_H #define HW_IDE_PIIX_H =20 +/* + * QEMU interface: + * + named GPIO outputs "ide-irq": asserted by each IDE channel + */ #define TYPE_PIIX3_IDE "piix3-ide" #define TYPE_PIIX4_IDE "piix4-ide" =20 --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796932; cv=none; d=zohomail.com; s=zohoarc; b=TbQ24ZGV/Mbp0l7x5S7BkPp+6cc3WfMOZE4fXTMO/Y0u1nbVBYigBgEm3bKQ3/259g4QStPvpwHYg6Wf2uicTzNotc0f3MmPc8EZ7cRjUggh38NnkthAZ1GUqDnSy4zxDd4pKlcBJEy3nnI4pjUDkD5C6SNCXgOlRjEE4+QxTKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796932; h=Content-Type:Content-Transfer-Encoding:Cc: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=uGLX24+M0yUzTdArc9wULeHBvztrfWJqtGM1+N7rTy8=; b=YOH2yrrMxURYqTSG+XmvxYEhU4CSg8Xnq9q/jDh7RBuPcr8oQ872HEtO8CefMfNQVEdTwlQsucS/mdAcCYNssHq6EEZ/FfqG0Ij4cDL7QHXqVgA6UbNjTf0H5edHpRFAoRCa5eGVLSwwEyyI7sHI0MymoRG3iuyxGjAT9LFgQcw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796932756996.7348305672983; Thu, 2 Mar 2023 14:42:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrc3-000702-RR; Thu, 02 Mar 2023 17:41:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrc1-0006zB-PF for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:21 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrbz-0008Q4-Gi for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:21 -0500 Received: by mail-wr1-x431.google.com with SMTP id v16so659509wrn.0 for ; Thu, 02 Mar 2023 14:41:19 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id z5-20020a5d4c85000000b002c71703876bsm504884wrs.14.2023.03.02.14.41.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uGLX24+M0yUzTdArc9wULeHBvztrfWJqtGM1+N7rTy8=; b=lkXMb2pmp0VBpjxu+KgHJRXikOFCoOPaEn9jhjjf+pZY/se/m6/bjXTLAXumgYB2Fo grUMWFWZt1REFn3c2B8vedD5qR+cFpC3oZmvlKXoBg9KWWv2m0pz6UpslDTnTDazyr7Y JyTFtD7a8WlfJ60UoixzlC5tDpHh2ImTb2WmagLBmMPfivOzvo0UFpq5YmvbxfhINwWL R30WJOrdswAeQg5y4XTlcDNDf/8gaMpZaIxwbreXImQMUtON3OojSLgTcYJhM0upDTvP DHIJcR1jhWReIDy2igCtv0dUtX3GgSFNvE5bYrGgroGvBOBqXQ7i261q/tWimusV4lU8 UamQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uGLX24+M0yUzTdArc9wULeHBvztrfWJqtGM1+N7rTy8=; b=klsLir9UrmGNSIoc9pJmCpDK0fhlvVSLBatn5rad6J9HcFa+aFYsgjL9PcX8Sf5Ucz k+0xvO6+dqmSNDpeQMlRgK/D2LhmS0lf8znZp3xwvt3nbAXTgu7bOVGDRi408810Rt2n AvKRL4Drj0sp514Rh5WsN8jo1UQ45bypfJhCEPKN5AZ4Nvd/DGXRErlNPLRx82c9NRS6 auKQHkkQK9Ou/ZZ6BJeR+ZswpcyolA/oqus+Pl7gjPHEXCB/hohgPSXWnb+cWBEbJuOi mxvpj/KKtHDg5X7AKV0v9d9me7ZunL9LxLws0o2rF7+dCrzIcdooAFaXAt+HEajcm3Mk mbvw== X-Gm-Message-State: AO0yUKUhQi2pAFlDhNg+E7/3G188hYMz/XwCEXJk3lpCwD9/WnjmGTA5 uxiX8i0an8YApIswEno0vjFlLz6Hz/OJTcuw X-Google-Smtp-Source: AK7set/VdsYSqCf/teNcK0HX2PypW1I9sRFjn1vqmKM9NYD97DCMEmg/QdI2OuTPtjMnTou58f3iEA== X-Received: by 2002:adf:fc8b:0:b0:2bf:d285:b787 with SMTP id g11-20020adffc8b000000b002bfd285b787mr8422599wrr.56.1677796877885; Thu, 02 Mar 2023 14:41:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org Subject: [PATCH v3 02/18] hw/ide/piix: Allow using PIIX3-IDE as standalone PCI function Date: Thu, 2 Mar 2023 23:40:42 +0100 Message-Id: <20230302224058.43315-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796934669100001 In order to allow Frankenstein uses such plugging a PIIX3 IDE function on a ICH9 chipset (which already exposes AHCI ports...) as: $ qemu-system-x86_64 -M q35 -device piix3-ide add a kludge to automatically wires the IDE IRQs on an ISA bus exposed by a PCI-to-ISA bridge (usually function #0). Restrict this kludge to the PIIX3. Reported-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- TODO: describe why this configuration is broken (multiple output IRQs wired to the same input IRQ can lead to various IRQ level changed in the iothread, thus missed by the vCPUs). --- hw/ide/piix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a36dac8469..7cb96ef67f 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -170,6 +170,18 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) =20 vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); =20 + if (!d->isa_irq[0] && !d->isa_irq[1] + && DEVICE_GET_CLASS(d)->user_creatable) { + /* kludge specific to TYPE_PIIX3_IDE */ + Object *isabus =3D object_resolve_path_type("", TYPE_ISA_BUS, NULL= ); + + if (!isabus) { + error_setg(errp, "Unable to find a single ISA bus"); + return; + } + d->isa_irq[0] =3D isa_bus_get_irq(ISA_BUS(isabus), 14); + d->isa_irq[1] =3D isa_bus_get_irq(ISA_BUS(isabus), 15); + } for (unsigned i =3D 0; i < ARRAY_SIZE(d->isa_irq); i++) { if (!pci_piix_init_bus(d, i, errp)) { return; @@ -202,6 +214,13 @@ static void piix3_ide_class_init(ObjectClass *klass, v= oid *data) k->class_id =3D PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->hotpluggable =3D false; + /* + * This function is part of a Super I/O chip and shouldn't be user + * creatable. However QEMU accepts impossible hardware setups such + * plugging a PIIX IDE function on a ICH ISA bridge. + * Keep this Frankenstein (ab)use working. + */ + dc->user_creatable =3D true; } =20 static const TypeInfo piix3_ide_info =3D { @@ -225,6 +244,8 @@ 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; + /* Reason: Part of a Super I/O chip */ + dc->user_creatable =3D false; } =20 static const TypeInfo piix4_ide_info =3D { --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796939; cv=none; d=zohomail.com; s=zohoarc; b=FXqvKlLToo6LQvEZ6IRTTcCyPyZyQvQ1ScsPEfEnGArftodOqxt4OEcRNhd8QVj1s5xJG78kpIGnvNTYAXo3Bdbu4lKWpzkSUMbNiI+54cAdyJLHGzwa+By6PxPjUsNM2AZR+o1/qYwobtw1o5OZEwe3nRG70p3kDlZ+qzlfHUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796939; h=Content-Type:Content-Transfer-Encoding:Cc: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=IBU+8jdhjCYbSlld/hmcA7nJYY2utc4DYNvGGjyLRLg=; b=ngD95e1ee1q06Lad5AbPeCPLzAX7vNAkcudvA950nplVg4e0+loxqU6BKULFD3p9RyilsYTXVc/B6DARMnm6VwdvL8G5mjxAnt1KWh+nf8z//NRy9WYhyvENm84WpAciqJNFLFYeDVlxXMCmuJHCjW/cq3uZmm5/YVUEDU/be90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796939274909.7607390674982; Thu, 2 Mar 2023 14:42:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrc9-00074V-WB; Thu, 02 Mar 2023 17:41:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrc7-00073y-Um for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:27 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrc6-0008Ni-D0 for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:27 -0500 Received: by mail-wr1-x42b.google.com with SMTP id q16so619608wrw.2 for ; Thu, 02 Mar 2023 14:41:26 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id o14-20020a5d408e000000b002bfd524255esm497315wrp.43.2023.03.02.14.41.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IBU+8jdhjCYbSlld/hmcA7nJYY2utc4DYNvGGjyLRLg=; b=n0/7lUwEOFQu4z7Uz/XunGZ/aSRMTUgk6d35oeLKW+f7siuafmKtyGvOZYBcdMzPZp PddLv2zeG/pRLQSJynI114jC/FN6Xt3hjyRSi0xK4fXFO4KK+n9MwgKMb8CxFOhao+P0 gHnVQcuGXJohuWxfNjvN5aWMvwEM3DgRIX2U6I1pFnFR9rX7GyMr6aEcO7otPIoeE07x PPN5d/a/Dx3mCroJzs35ZfyhdNzRDEpQFbZEzPuKsc2/AWC/x77BOamjI00gfeRss53c w2RZjxXPpFhdrwL2vnD45ADQDpN5/wSwWzg+wFolxowCWcAdwXuf2oGi245DQPjwmVHX KAGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IBU+8jdhjCYbSlld/hmcA7nJYY2utc4DYNvGGjyLRLg=; b=cfH4lAJTDDuMYCjean1eV/DAI5Fz/jfEvj90BKv7LAAlsFUG23j1sTVlAAye7qDhUm mK8R1kUauNONVm2tDqfBTsGSBphcAORSOypDPbggGkMDIIZv29Jo61uFGju7FWxqggQa 3pNyb5np3Tr8YmtF1ehjADV42TrItpfjDBDPmHfkbzD9Yxxmo170+Fp8et+PlXou5Mx0 Tu7saJS3WAy9GIm8sDFL+KdVBNQL8lty1iurdedZtYjE+EEKa/p4M9bAuaJUAB7MGs0P 6GuA1PmEi6irbm4tDQH1ixhNHPjCSNRpBTGrrrTUFz/3zRGE1hvuQBcdxQ+bT0n+Hy1G UTyw== X-Gm-Message-State: AO0yUKVskC8B7VVZuhgheOZgCSoyJYphL/fr3dx43TQGxdFXZPDVmTjc zFEh225Q3OTMQTLlV71MrWZUl6UcXuWKstKj X-Google-Smtp-Source: AK7set/jAHe9MIJ8MxkrxDtuqjOugi5d05k1ZtGm3TrKR/JfXo8iKB6uB7Yyztas2/BEbal/p+t2cw== X-Received: by 2002:adf:f9c5:0:b0:2cb:eef2:daff with SMTP id w5-20020adff9c5000000b002cbeef2daffmr8803089wrr.22.1677796885442; Thu, 02 Mar 2023 14:41:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v3 03/18] hw/i386/pc_piix: Wire PIIX3 IDE ouput IRQs to ISA bus IRQs 14/15 Date: Thu, 2 Mar 2023 23:40:43 +0100 Message-Id: <20230302224058.43315-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796940103100001 Since pc_init1() has access to the ISABus*, retrieve the ISA IRQs with isa_bus_get_irq(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 126b6c11df..1e90b9ff0d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -277,7 +277,13 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PCIDevice *dev; =20 - dev =3D pci_create_simple(pci_bus, piix3_devfn + 1, TYPE_PIIX3_IDE= ); + dev =3D pci_new_multifunction(piix3_devfn + 1, false, TYPE_PIIX3_I= DE); + qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", 0, + isa_bus_get_irq(isa_bus, 14)); + qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", 1, + isa_bus_get_irq(isa_bus, 15)); + pci_realize_and_unref(dev, pci_bus, &error_fatal); + pci_ide_create_devs(dev); idebus[0] =3D qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] =3D qdev_get_child_bus(&dev->qdev, "ide.1"); --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796939; cv=none; d=zohomail.com; s=zohoarc; b=KII7A3szeUVkyYUT/SxabyWMoSS8iRx/mUiIGxtCM9g24pX2OmJr6mAt94n9GxwsGp/43iWqL+q7U/rfc820Iudm5j6IwUna9yyoi0WYLY4yOuj5zzDGHuxapcyeOnr8XywUJb7dDdrVA6HMwbnsoF2x+XBSENKA8AxvqKo9oTs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796939; h=Content-Type:Content-Transfer-Encoding:Cc: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=+sfyAsKb/ybApqIFl07T9s+7iUFCDW80zwk8fRCVEAE=; b=NxKnFVjEJUX3R4uuGy3RJaKSMblsTWf2RiQWAJATnt3h/CS6expIj47ZwlQjg+yWOoEZlEqBke7XxoX6MFLW5A+P8OfW5OVDu8BP69MId2dhN2X0lUtXWULV3NbUKXHeNfMTixjh6LvjLKpN1br9Nr4alMSkrpfHBtAZrsdqW1w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796939815631.9545466302235; Thu, 2 Mar 2023 14:42:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcP-0007Ba-TK; Thu, 02 Mar 2023 17:41:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcN-00079W-SG for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:43 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrcL-0008Rs-2P for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:43 -0500 Received: by mail-wm1-x32e.google.com with SMTP id j19-20020a05600c1c1300b003e9b564fae9so2844206wms.2 for ; Thu, 02 Mar 2023 14:41:33 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id x17-20020adfdcd1000000b002c5804b6afasm497341wrm.67.2023.03.02.14.41.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+sfyAsKb/ybApqIFl07T9s+7iUFCDW80zwk8fRCVEAE=; b=xu1rjB7YD8DjZWjxzi3BvlMN8UixTnVYDqagQlFTxx2InrN87xWrEjkJp069tuj7Bz CxCQMD6hNI2YHq+JwGw0t3NrUUBdZOipfiA3z7a7BQxVUJJOWERZehqGQvhVf8KMhQLy fhV/jRictU1DOTTReu77WjZBTgZGBkQ7F/JKWDhvP3VrpglK/OTY6UsET+CtU3MPGa44 l/IUBYI2w5GPoVB9II3ocN2mXZtoAs4dxwvtJBg4Gv5sxd0k9OAMpwsTHjcPstW6z9st 1nGVu16OalqMzqfW1utxpjSRJVc0Ypo8j5QOq23tpKOImzT5RCGXPDNWLJxbYNh9uLRt nB2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+sfyAsKb/ybApqIFl07T9s+7iUFCDW80zwk8fRCVEAE=; b=Zozx7WbSyz4txfS3voJdpK2Qjs6egntBPpTt4J/x2+Ri2OTgz9fCbd5dQhuPxgK8s7 ri/2x+q+P9P+LP4Y2tuNHI64ns3GevI9E7V559DO8mhD9NdvsKWL6sReLlVx/kBvU06S pGL7eDk6ym3ML9JVhOVXbH3IRScu34+cZhwfoHdhyfo3kxacUFZXHYEkfyzCIlwBfr9n YXBOwLhWTWDj3wOExNQXfrEzuu8sPxBAFG0XzFDPn9DUIXdqqD9R9Ywp2Z/jpC+4mQ4d hswb8AQD+xb39OOM1ItgvPlOepEs9yPEa0jDzk0lmmKVi71BHN8YJAuc6RIuuGDXkajD H3uQ== X-Gm-Message-State: AO0yUKXeNuHS3JlDItOC2/PGyA7TjEztAwrWzTn0T5ISeIHIUfjnYfOR I+5lzQUkuoQNKCA5Dqp4CcM1XL6K0RTQQhxr X-Google-Smtp-Source: AK7set8SWvk0HWg5p/Zd2njTCKsAOYJMTaC75KODxQ5MiBsOXZLVWHVmhLXt0tld7ks3knru+bb7dA== X-Received: by 2002:a05:600c:3422:b0:3e2:20c7:6544 with SMTP id y34-20020a05600c342200b003e220c76544mr8899029wmp.19.1677796892714; Thu, 02 Mar 2023 14:41:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [PATCH v3 04/18] hw/isa/piix4: Wire PIIX4 IDE ouput IRQs to ISA bus IRQs 14/15 Date: Thu, 2 Mar 2023 23:40:44 +0100 Message-Id: <20230302224058.43315-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796940199100003 piix4_realize() initialized an array of 16 ISA IRQs in PIIX4State::isa[], use it to wire the IDE output IRQs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/isa/piix4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index e0b149f8eb..702b458a3e 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -229,6 +229,8 @@ static void piix4_realize(PCIDevice *dev, Error **errp) =20 /* IDE */ qdev_prop_set_int32(DEVICE(&s->ide), "addr", dev->devfn + 1); + qdev_connect_gpio_out_named(DEVICE(&s->ide), "ide-irq", 0, s->isa[14]); + qdev_connect_gpio_out_named(DEVICE(&s->ide), "ide-irq", 1, s->isa[15]); if (!qdev_realize(DEVICE(&s->ide), BUS(pci_bus), errp)) { return; } --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796988; cv=none; d=zohomail.com; s=zohoarc; b=cL/pAedv2agEfsxl9NGRZBUkYi+7WCr79EN8U18pUsHC3ez8XqQqLZcqoWoyPoBkhhKYz4E2Ty+9qlxN1UQB/VnrBx+SN+q8LtpjLnST3fUk1pVc/HCGBvFOcPeQUhP4YH4ZHThFkVgLurcEXLnazNuFbIgZvNLHdcecY75xmOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796988; h=Content-Type:Content-Transfer-Encoding:Cc: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=vZWv5g94w5/z2ukq0a5DPi6E7jJ1PV3zxu20I2knB1k=; b=labuDMaCmUVpcwYZq4HXm0omtbrxb3LlNTeNusBVKE5vljaQ1gdv6bhUDnxXaX6Y94uHxF37JFc+/LOhH4k9Ve9kVtu5c4RAdScNaC8xYkR3Jbjiv8cd0adC4/765fa3Oa1yed6Qx8aejM7MUig7GonYm2Lo9z0MrGh9NF/DmMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796988693554.7395100783999; Thu, 2 Mar 2023 14:43:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcQ-0007Bg-4D; Thu, 02 Mar 2023 17:41:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcO-00079j-6K for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:44 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrcL-0008SN-OR for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:43 -0500 Received: by mail-wr1-x429.google.com with SMTP id l1so570405wry.12 for ; Thu, 02 Mar 2023 14:41:41 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id j14-20020a5d564e000000b002cde25fba30sm523767wrw.1.2023.03.02.14.41.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vZWv5g94w5/z2ukq0a5DPi6E7jJ1PV3zxu20I2knB1k=; b=a0ZDSzlUaRF4M94Ty2bola16cPNLoxshrxMrFJ1TVyi1dxY7NZDrJCV0dOBQLg648f fcecZU2AVR6QArRjpgFkZj4Cm032673VZVsEgz+UGbYn4NOU7gjcpWI1NbQn1eX9kcq0 DmePMI8pznNPOZ4NzeFrYAVYsYJFIngEDSV5YXn5r4ZVxg5XKnz+DUwP0kdShnOi7m8h da9WM78d8vrBGhKVW+uIRP/iJjrLL9A3Qj8Iero0eCJKbnOuKB6MeDM61ovN49zPdMPh ST25gkFx1YHHazsS64+vG9Fu7ieDNIs1hsIm8mI+dVcy1gxVLLi4PTp+YAb9OMkHkqtl 5wWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vZWv5g94w5/z2ukq0a5DPi6E7jJ1PV3zxu20I2knB1k=; b=qtEzTI9jyitrU0wfIXa/JfH1xwG9PxWfoblJlc1v+2MZiOimz/otAtHlagwtYj+HmL /CJTeUvQa9Y9GO5AOTrzViND1/E6l8eqxq8DnZDpta/b3HfiVzDUQLHi21ajrHspmDxI ednu1Nlfvqk9MjNnMREUFrqgE6VS47BCBHT/WYuZ1LobfNIP5ixhlGLoLE9h2Eq63nsO 2WGE7c+5fb4ezFkQf5Z0ifT2445pbDGzvylxT8+nknDdkPShccWApJvLtxsqC+guAo6H 7pmLHFJ4ebCDGjxZYw8LNeywR1tRjXSYP2WDUNLO+NSAaptv/rxwvFmpgDkK2P70CSzj UmWg== X-Gm-Message-State: AO0yUKXz2NzD8Z9e4pH9g4oyPYDEJ/UrXl/8HMPdfH+G7Dy+g8rmMoxV Ww5I7DZR3ZUo0JG8yMR2IVxcj5s41QJAi+nW X-Google-Smtp-Source: AK7set+0YZ/011TnW1nK9J4+AwDPwJsneU7pqGZJ6HPu/u9dBm7pQiGxCU5qJmMQnuKRm8jl01Ir9g== X-Received: by 2002:adf:ef84:0:b0:2ca:5c9a:a548 with SMTP id d4-20020adfef84000000b002ca5c9aa548mr9383787wro.60.1677796900014; Thu, 02 Mar 2023 14:41:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-block@nongnu.org Subject: [PATCH v3 05/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa Date: Thu, 2 Mar 2023 23:40:45 +0100 Message-Id: <20230302224058.43315-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796990285100005 Rename ide_init_ioport() as ide_bus_init_ioport_isa() to make explicit it expects an ISA device. Move the declaration to "hw/ide/isa.h" where it belongs. Message-Id: <20230215161641.32663-13-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/ide/ioport.c | 4 +++- hw/ide/isa.c | 2 +- hw/ide/piix.c | 5 +++-- include/hw/ide/internal.h | 1 - include/hw/ide/isa.h | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index e2ecc6230c..d869f8018a 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "hw/isa/isa.h" +#include "hw/ide/isa.h" #include "hw/ide/internal.h" #include "trace.h" =20 @@ -40,7 +41,8 @@ static const MemoryRegionPortio ide_portio2_list[] =3D { PORTIO_END_OF_LIST(), }; =20 -int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) +int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, + int iobase, int iobase2) { int ret; =20 diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 95053e026f..6eed16bf87 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -71,7 +71,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **e= rrp) ISAIDEState *s =3D ISA_IDE(dev); =20 ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2); - ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2); + ide_bus_init_ioport_isa(&s->bus, isadev, s->iobase, s->iobase2); ide_bus_init_output_irq(&s->bus, isa_get_irq(isadev, s->irqnum)); vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s); ide_bus_register_restart_cb(&s->bus); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 7cb96ef67f..cb527553e2 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -33,6 +33,7 @@ #include "hw/pci/pci.h" #include "hw/ide/piix.h" #include "hw/ide/pci.h" +#include "hw/ide/isa.h" #include "trace.h" =20 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size) @@ -142,8 +143,8 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned = i, Error **errp) =20 qemu_irq irq_out =3D d->isa_irq[i] ? : isa_get_irq(NULL, port_info[i].= isairq); ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret =3D ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, - port_info[i].iobase2); + ret =3D ide_bus_init_ioport_isa(&d->bus[i], NULL, port_info[i].iobase, + port_info[i].iobase2); if (ret) { error_setg_errno(errp, -ret, "Failed to realize %s port %u", object_get_typename(OBJECT(d)), i); diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index d9f1f77dd5..d3b7fdc504 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -618,7 +618,6 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDED= riveKind kind, int chs_trans, Error **errp); void ide_exit(IDEState *s); void ide_bus_init_output_irq(IDEBus *bus, qemu_irq irq_out); -int ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); void ide_bus_set_irq(IDEBus *bus); void ide_bus_register_restart_cb(IDEBus *bus); =20 diff --git a/include/hw/ide/isa.h b/include/hw/ide/isa.h index 1cd0ff1fa6..7f7a850265 100644 --- a/include/hw/ide/isa.h +++ b/include/hw/ide/isa.h @@ -10,11 +10,14 @@ #define HW_IDE_ISA_H =20 #include "qom/object.h" +#include "hw/ide/internal.h" =20 #define TYPE_ISA_IDE "isa-ide" OBJECT_DECLARE_SIMPLE_TYPE(ISAIDEState, ISA_IDE) =20 ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int irqnum, DriveInfo *hd0, DriveInfo *hd1); +int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *isa, + int iobase, int iobase2); =20 #endif --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796957; cv=none; d=zohomail.com; s=zohoarc; b=iEB7t5cCcO7I6RbCbqB1X3wmKHsTZTDoDJJP1/GS0CxQfsYBufIYrXynIFCdfWQqthN5cv2+/F64Id82sWmMCCft/84sstvkB1RItP8TAUIxLOnmmWxJBb7Sy6XQabLyhF67kvplicFYJ0pteArnNSVKq6x4XknjNQmTOqEKdzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796957; h=Content-Type:Content-Transfer-Encoding:Cc: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=DSE7g2BGvjGKtD0MrBQHAr8f/88wxlLX0Z9UtPjGoiE=; b=S57iKcslxGHFfgImR4AmDt3U30f2fzSX5HMRj+uVKNl4nT+cnDW4brA79ezXeNTC4XZGSbSxHTYc8QdBvDyQ/JrjlD4p0+DqIB/rHct1YTxsJfNtJTgHUS5bDqlBZpRt8VF8XJx0Odit74jlZXyTclKVRlWfLavFlBGVaVmXgEE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796957354580.8725522362458; Thu, 2 Mar 2023 14:42:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcW-0007GD-Jy; Thu, 02 Mar 2023 17:41:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcV-0007FA-Hp for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:51 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrcS-0008U5-PA for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:51 -0500 Received: by mail-wm1-x333.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so2819510wmb.5 for ; Thu, 02 Mar 2023 14:41:48 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id h12-20020a05600c314c00b003dfee43863fsm4595726wmo.26.2023.03.02.14.41.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796907; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DSE7g2BGvjGKtD0MrBQHAr8f/88wxlLX0Z9UtPjGoiE=; b=x8OyNtl42W3kRLnt0EIbxe7d6QFch/H29Le8lQ3VDmQbDCIPzgZi5WK1sz9gSEZjJq mUVK6QIzmWi7VVP8qjpa3uECzIZFbaHUndVa+HXNQazZixFa5gn2oZgqhU4eOb8M3Pz1 /o5Of5vmRfv+RdRbP1KvV7Ej78bnLZfzW4v5Cq+jBa5XwUbeMzNXFlyagATVmykvipw0 9aV0G7m3Ka8XHGcPG/MkSN7CO9k9A17QR42bdRVpGewQ/+O9zcXRM9iP4f7mp5cCVUhC QuASqTcAKk1eK+whJ/Fg4VqUCV2fBuYP5Dvso4cDkSIQiXO/dFtkolnTZCNxvc9fzv2H j6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796907; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DSE7g2BGvjGKtD0MrBQHAr8f/88wxlLX0Z9UtPjGoiE=; b=h9VXD7eAbj/lw7T4DP/B1DmJl/zDEagNQ+OQV6d5lthDoEALttfmtlBQjlMkOyl3yY fE7OU4ZVkbhCrCGrE0f+ctgCiEGSHrgk19ghK2dv+FRlmkAk7W0z+aZLtAe5Qk0NDVoY ULrb3K3sUU4H04EVLjDioBdHaBU/ooJqnMwUinjOaUfzensiIRtd4lFIpk+xkPdg0bfG 4gisOst0p7cCNzvm1Lp6vqkBba99LlpWDOBFQjLPdetcAr37aZwBa2MzzliFf/FKjIcG gL/vrw0o6wPAkh1n1fX68GPlmef2IgGr56qNn4dZrzvhGENEDZXf8Ol2oZK81MQ99VM5 UnRA== X-Gm-Message-State: AO0yUKVQYrCMAtax1+RGNoBe6/vAg8gAmkRzsOqQYooo/ytDnkuK7S/t pKYJu4VUZTX3YN6OsCqTWHx/2U9165TXlenE X-Google-Smtp-Source: AK7set/Pe0tWpwEmAhuXUa++sIw0dBHE7X1ZbUblKTXsZJ76QFcTcF24giJac6BUF25mGMU3OPdRGA== X-Received: by 2002:a05:600c:3583:b0:3eb:399d:ab1d with SMTP id p3-20020a05600c358300b003eb399dab1dmr8994045wmq.16.1677796907307; Thu, 02 Mar 2023 14:41:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org Subject: [PATCH v3 06/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization Date: Thu, 2 Mar 2023 23:40:46 +0100 Message-Id: <20230302224058.43315-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796958130100001 Ensure both IDE output IRQ lines are wired. We can remove the last use of isa_get_irq(NULL). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/ide/piix.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index cb527553e2..91424e5249 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -134,14 +134,17 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigne= d i, Error **errp) static const struct { int iobase; int iobase2; - int isairq; } port_info[] =3D { - {0x1f0, 0x3f6, 14}, - {0x170, 0x376, 15}, + {0x1f0, 0x3f6}, + {0x170, 0x376}, }; int ret; =20 - qemu_irq irq_out =3D d->isa_irq[i] ? : isa_get_irq(NULL, port_info[i].= isairq); + if (!d->isa_irq[i]) { + error_setg(errp, "output IDE IRQ %u not connected", i); + return false; + } + ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); ret =3D ide_bus_init_ioport_isa(&d->bus[i], NULL, port_info[i].iobase, port_info[i].iobase2); @@ -150,7 +153,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned = i, Error **errp) object_get_typename(OBJECT(d)), i); return false; } - ide_bus_init_output_irq(&d->bus[i], irq_out); + ide_bus_init_output_irq(&d->bus[i], d->isa_irq[i]); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus =3D &d->bus[i]; --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797036; cv=none; d=zohomail.com; s=zohoarc; b=d2UC3FMLJVEDNlc0s3pNDWPCmP4/dQvYYZaKnon8jiloyLomRortFZWeHHBmaszICeuhqkBvKVYe44amK10kLwv8eflPJ8SANp4rp8VIcl2zxmX1lg1w9eQKSF4JftSTljii7VqCTrhADPJf4zlOLqzngdvf6iaxCecrgUQ0+YI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797036; h=Content-Type:Content-Transfer-Encoding:Cc: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=WBH0OC00WXelyQU0Dru5HltuKOYgUwSjsFr5h9b93CI=; b=CYlypoFWS6exDf4F/F8UwsJQHa68fHc1mnjQzeQTtFh3E1HmwLPTplL6plMwGGh54ZfynU8kHrvMNc8p8zGezqBxUeJlijkJY2PN3488wi1YPInVNc2TxvfXjXd3x+4PklESHPanYF2inO3Extxm1Dt5m3q45VFOr4Z+8y9qMv8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16777970361160.0655706531828173; Thu, 2 Mar 2023 14:43:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcc-0007St-67; Thu, 02 Mar 2023 17:41:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcb-0007R5-EA for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:57 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrcZ-0008VE-Rv for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:41:57 -0500 Received: by mail-wm1-x32a.google.com with SMTP id o38-20020a05600c512600b003e8320d1c11so2650160wms.1 for ; Thu, 02 Mar 2023 14:41:55 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id he11-20020a05600c540b00b003daf7721bb3sm4397190wmb.12.2023.03.02.14.41.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WBH0OC00WXelyQU0Dru5HltuKOYgUwSjsFr5h9b93CI=; b=rZvVoTx7mcGvLx5x4cGyfQyxRwvVXY/carR2VREyOo3wVQgHk27crXiiT/wIPyRrYU Y3pZRYeGvFcRQcLyAVgIek6tGqjydvyRrlLwM+rXzGhQm3eo+7ssqhJyHv3TDsWpaeVL 6SuGNnFgQjT+kH3nANQN7QBLq0wfWNCgrevj8nogbRUNBMZLUN8Sn/bvnbT0mAyvEBIz 0EpNWeLktE5hKDFT0MQcDILMTagM0bHgb77+ZmQWC4C4yQi6NU1BUYeH39MdnNs4phMI 59iH7DZILzpx3CjPifQ/QSgU+G+xGEHY4nxum2qV3wsKfRZN3KhzYtZf8D/iGLFI4xgu jWTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WBH0OC00WXelyQU0Dru5HltuKOYgUwSjsFr5h9b93CI=; b=fqdUBaArJFV3buzf6IErOicJI4tzHjJ9TFq3ogM73r270N1U7JJFBcG+L11gr4vkeb /11tpBZoOrnqx1az4EfwDy4Nls3Vu8gtr64JQ4USpPG+x0YB3Eqmv+V/IeRV3YUsVapV IwnhfV2+9sBgbUpGWy1PBpCYw6qPcbz7lbOw9/U7KRpqtEhiM0rY6l26BKeT0ZPJb/tI 1Trdt1fU0MgiEup6qossZIysSudcYjZhlbR0WDNuBXcfcgUVaWT+gXqSts8lGnc9mx2Y qdkbgImnUekLif4+QuAHWXxZ5NfKim7hR0LLfDCFJO495VX5llcBc1lb5c88901U0dE8 mxLQ== X-Gm-Message-State: AO0yUKVTIeKzwv44fCwAkwR1T0loihf0IDGtukX5gSOd4wc+v6En8LZL mLgjB5krGwAltGcf8YTLIvQzOoPz2TN1/RwU X-Google-Smtp-Source: AK7set94qLUEx9Gbp86qYgJQCmMrt2N3vWoo7zk8lwHQ77DHP9x2SEq+jr1UuNIZgrB7nwuUjUMXHQ== X-Received: by 2002:a05:600c:1c8e:b0:3e0:98c:dd93 with SMTP id k14-20020a05600c1c8e00b003e0098cdd93mr8804092wms.29.1677796914201; Thu, 02 Mar 2023 14:41:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 07/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq() Date: Thu, 2 Mar 2023 23:40:47 +0100 Message-Id: <20230302224058.43315-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797036523100001 Last commit removed the last use of isa_get_irq(NULL). Add an assertion to ensure we won't use that hack again. Deprecate in favor of the BUS API: isa_bus_get_irq(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/isa/isa-bus.c | 6 +++--- include/hw/isa/isa.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index a289eccfb1..081bac18ee 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -85,10 +85,10 @@ qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum) * This function is only for special cases such as the 'ferr', and * temporary use for normal devices until they are converted to qdev. */ -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum) { - assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) =3D=3D isabus= ); - return isa_bus_get_irq(isabus, isairq); + assert(dev); + return isa_bus_get_irq(ISA_BUS(qdev_get_parent_bus(DEVICE(dev))), irqn= um); } =20 void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 40d6224a4e..75fb620782 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -87,7 +87,8 @@ ISADevice *isa_create_simple(ISABus *bus, const char *nam= e); =20 ISADevice *isa_vga_init(ISABus *bus); =20 -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); +/* isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */ +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); MemoryRegion *isa_address_space(ISADevice *dev); MemoryRegion *isa_address_space_io(ISADevice *dev); --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796948; cv=none; d=zohomail.com; s=zohoarc; b=Wyf+9JgFR/AvNqOPsrnXmKx3vVPayQhQXtDVQkHiX9fVUgK1gmwg9bBPxVLHC32yU4/1w/J/ErLXPiTJcSps+TD0suBHYF/BNT1o8gYZRzsc3scqEI+evwU3QjUiJAVcdjrRiRnPmWiqA0s3/XM3G9Gz+ASNkrLKzyiv+EHA0a0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796948; h=Content-Type:Content-Transfer-Encoding:Cc: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=3AoU626teyyuqy/kOKhaATOA10AmPEd2CLo0HeKY7iM=; b=WGgib90zuLxkXg9RrQuibrE5618z2EJQbge4E1pGZ//q/GquA63RO10UCMZNthtL+1hb8wrpFHvZKwqzvGSuBidLfRyOVo1WWJjIMRZVg6PppXNF+G4jPGAd7j2NyeLUyZ1eMBbDRxn8alNVY+pKI/ilHeKMTWKwQNO143sehSU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796948246467.41824642986217; Thu, 2 Mar 2023 14:42:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcn-0007bK-4F; Thu, 02 Mar 2023 17:42:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrck-0007YM-Dm for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:06 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrch-0008WJ-8c for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:05 -0500 Received: by mail-wm1-x334.google.com with SMTP id j3so580307wms.2 for ; Thu, 02 Mar 2023 14:42:02 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id g12-20020a05600c310c00b003dc49e0132asm4955231wmo.1.2023.03.02.14.41.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3AoU626teyyuqy/kOKhaATOA10AmPEd2CLo0HeKY7iM=; b=AvtpbScbEToTeZttg2AmvmKP8tEir63YdYgxtnadOqpZXqEJLmnnU6nr3PyWAvDLLc YZJ10TM1jrBSwVGMMkT3vAA5v8O1bc3fk6DN0Y9fvGqGV1aM7HQT//yDqqFxjQ+9XQ1Y u8MMGpShwf6fR+hvmQsisPdViffVDm/ni4wA4tlSOFZfjrRBbJwdk8NNeJ6hxBisoz/3 gQ83QP+ESO9earPBETvudL7W/B+eH7DdOMrdI9QXBJfTHV62fvAI29A65z/Rn9OYhlCc CuvZJxjfLzxpSoOeeFEa+M/tJrgC2wmoYe+R7iB19ikSftaw4lIssuwc4ZaC+YKY12gt 4txw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3AoU626teyyuqy/kOKhaATOA10AmPEd2CLo0HeKY7iM=; b=2/fRgbvkx7xB1k/lWON8fwLA8P6HLpC9XbhDwFT/R6R0dn2h0PffE4Ej4eucYgztDL mV6MarDdiDdsRNM8BXYOymqvNl1vf6q7YGHOMNoe8JexkTawnfJjw+PXQO2drRuh910N uFOt6dR3oF8bqiBIE3t2SYRGpUufnzwnpa0cWCBZOKpj+T5zi0Z2/jeO6nK6WTP9mU9L apN3SSCHonM00zOGoIoPppiCbb0DBWhcLiGcl4/9nKN+ujKxsaIZ8p/llk5GzcmnG2S4 FyrWxzrgh2GLO/qO439o+PEwTJB8+5bSfWsCMoVk+lZrFXC7jmtQqedYv/eKU5Kh5mgE PdFg== X-Gm-Message-State: AO0yUKWPAub+2W4HehiTDfbomJOGHthabCU+l4gwniOA7wMJtH7zN1dq iYz15Iv4tT0WmW+SoEaj7OvVax1ZNoxkhs6r X-Google-Smtp-Source: AK7set8ZzvM1oxwciMrSCJi/O5P01GnKohqIBPNIvwAPR01kZOMh6P906R3XRXtDd0KaUdw8Vn/xUQ== X-Received: by 2002:a05:600c:a293:b0:3eb:3e24:59e2 with SMTP id hu19-20020a05600ca29300b003eb3e2459e2mr8719217wmb.25.1677796921709; Thu, 02 Mar 2023 14:42:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Richard Henderson , qemu-block@nongnu.org Subject: [PATCH v3 08/18] hw/ide: Introduce generic ide_init_ioport() Date: Thu, 2 Mar 2023 23:40:48 +0100 Message-Id: <20230302224058.43315-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796950085100007 Add ide_init_ioport() which is not restricted to the ISA bus. (Next commit will use it for a PCI device). Inspired-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/ide/ioport.c | 12 ++++++++++-- include/hw/ide/internal.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index d869f8018a..ed7957dbae 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -46,8 +46,6 @@ int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, { int ret; =20 - /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA - bridge has been setup properly to always register with ISA. */ ret =3D isa_register_portio_list(dev, &bus->portio_list, iobase, ide_portio_list, bus, "ide"); =20 @@ -58,3 +56,13 @@ int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, =20 return ret; } + +void ide_bus_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2) +{ + portio_list_init(&bus->portio_list, owner, ide_portio_list, bus, "ide"= ); + portio_list_add(&bus->portio_list, io, iobase); + + portio_list_init(&bus->portio2_list, owner, ide_portio2_list, bus, "id= e"); + portio_list_add(&bus->portio_list, io, iobase2); +} diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index d3b7fdc504..6967ca13e0 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -617,6 +617,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDED= riveKind kind, uint32_t cylinders, uint32_t heads, uint32_t secs, int chs_trans, Error **errp); void ide_exit(IDEState *s); +void ide_bus_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2); void ide_bus_init_output_irq(IDEBus *bus, qemu_irq irq_out); void ide_bus_set_irq(IDEBus *bus); void ide_bus_register_restart_cb(IDEBus *bus); --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796963; cv=none; d=zohomail.com; s=zohoarc; b=QNnoy/9KLxvi4lu0IrP8KB44O5/0MP3Ykl41a4Q3nYtaWJjTGbzk3e/9g9u5EIbLRTs+NNqK/heA9mWwKjnWQvM6HISJOYiRDHooykElboSaJRgReWlfe/mqfYM2D/R1YCtQ7VWS5ZFeVq7LwDaSLA0RssC3RadX6sE0+bdT9i4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796963; h=Content-Type:Content-Transfer-Encoding:Cc: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=H5itDKkjjwbFDWZM5dfCKNestHYP2geb5DKzbrDRTD4=; b=XaqLVKDiyq9Xs8o8mdF8CPEdO0DKztS38xW9xxN6fdKgPR5KvOMoOS372X9Ic4aS/qsY8GXq8f7Ett2uNca8BbALWn60kW9X5+BIwU2teBB6EKVXpjr8ixY+FsLPcF+o6CU4V/sBNJLfLqlyk9hrTFdfelhdlfnWnwLdwN9qb1o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796963081202.66804059060235; Thu, 2 Mar 2023 14:42:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcs-0007nF-IX; Thu, 02 Mar 2023 17:42:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcq-0007fg-Ah for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:12 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrco-00006N-KZ for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:11 -0500 Received: by mail-wr1-x431.google.com with SMTP id v16so661070wrn.0 for ; Thu, 02 Mar 2023 14:42:10 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id q10-20020a5d658a000000b002c70851fdd8sm475179wru.75.2023.03.02.14.42.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H5itDKkjjwbFDWZM5dfCKNestHYP2geb5DKzbrDRTD4=; b=PAVWdoThX6qssLgvIeIXrd8xehaHHU8GzYhQJpTra3qrcajjrG2kbnzHyXnVE/5hCX s1++DlVlg7ThRO/dfTlDYDNhcUpABbIRkbsBig1rbNe9ZNbk3LKMtqN+fm/3z0pN9tH4 Q1HvfC7B4exa8BptZ49b0OPsGc9mZaX9vYEFxKbSwYblrT0JzAPG/otw5kKsNCw0YBM6 Qb5CUe3jpI/NcW/5GDoKOklqwe//Z/3i8dQgl6pvq87RcotLvnCaKnOEJJbBh20stWZM AeM0J61wMeL3F1tKPZOljMeXGnQF0hadKQARCN5bNm2/Hxb3c84gqFHw/wJPOTfL55gI f6Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H5itDKkjjwbFDWZM5dfCKNestHYP2geb5DKzbrDRTD4=; b=AtwP7caMjKTaABQHlPyg29QC5J6jyegwS0YGpAOtLVJGV2rBPysk85S3vvxwZkcF5t wBwsvGeJT8oZSa5n7hmUvFWwH9lVO2SXRlLULQQ0EdBD/8B2/J/SXnI7tBwOVTqAxfbT btUjtZP2ZJ0Ip6nKhwijfI0m3r3w5/lv8OV20XBOX9B6kyTqcHVYSJfQvKw7kimzr2XO SmPSBkB8k/udbtLCykQ00M+21KnWP7rbQboRJTREFouVysd47NzxCUwxAzHQT3AVuQFZ lukV/kjRDqOeu7VQSwmL2xh2vmNLbRQv33xitHrOEo0xCtV7M4E+nGa1jeWdIikxQQ8b VrEA== X-Gm-Message-State: AO0yUKV/idhatNvC3bfhAo+tqFj1gjNFIDwb3VQ4eeOWIBthCGPelmqw xn6Dvb1nWRGtgHj/ExEv437LFiajgOCqYflg X-Google-Smtp-Source: AK7set8aUpYmZiiff4/AJuQlo0g5YPDCTYDKU8A1XYvLyrsz6NK8lsm4jN3WtAkt+u7TFZqWo5dq0Q== X-Received: by 2002:a5d:4fc6:0:b0:2c7:1e3b:2d46 with SMTP id h6-20020a5d4fc6000000b002c71e3b2d46mr7575295wrw.17.1677796929195; Thu, 02 Mar 2023 14:42:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org Subject: [PATCH v3 09/18] hw/ide/piix: Use generic ide_bus_init_ioport() Date: Thu, 2 Mar 2023 23:40:49 +0100 Message-Id: <20230302224058.43315-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796964134100001 TYPE_PIIX3_IDE is a PCI function inheriting from QOM TYPE_PCI_DEVICE. To be able to call the ISA specific ide_init_ioport_isa(), we call this function passing a NULL ISADevice argument. Remove this hack by calling the recently added generic ide_init_ioport(), which doesn't expect any ISADevice. Inspired-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/ide/piix.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 91424e5249..2136895401 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -138,7 +138,6 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned = i, Error **errp) {0x1f0, 0x3f6}, {0x170, 0x376}, }; - int ret; =20 if (!d->isa_irq[i]) { error_setg(errp, "output IDE IRQ %u not connected", i); @@ -146,13 +145,9 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned= i, Error **errp) } =20 ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret =3D ide_bus_init_ioport_isa(&d->bus[i], NULL, port_info[i].iobase, - port_info[i].iobase2); - if (ret) { - error_setg_errno(errp, -ret, "Failed to realize %s port %u", - object_get_typename(OBJECT(d)), i); - return false; - } + ide_bus_init_ioport(&d->bus[i], OBJECT(d), + pci_address_space_io(PCI_DEVICE(d)), + port_info[i].iobase, port_info[i].iobase2); ide_bus_init_output_irq(&d->bus[i], d->isa_irq[i]); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797041; cv=none; d=zohomail.com; s=zohoarc; b=FEUfn8hmCOL6yTaUwb88imvS4Lm283A9PyIQaZr5Ad3375+rllCgj1sBJ8M7gKN1yVQ62NSXJDhebGKQkTLSZc53NS03zit6JDGzfC2+Sj8BuoFLlHQuWqj8/a+6G0O2voT7ycPk3Thgajoz/CQpYVb4+PWjlDhUIpw00LQAfXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797041; h=Content-Type:Content-Transfer-Encoding:Cc: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=uZKWKOH8CoWlg9l+QWicKQtR++JaD+yXwzgRvDSnsXc=; b=UzdSju8wjQlU9hjztF4KIs3A4LQjXSs2Ow3GKRUPbKr5zQVRXjSXOqlEzSgoMcl8EXznGEEopQ8lvVNsQMKfMVNiW4cbkxuYJDizOc/aoKHFl+i2aIjzdj4e/Vq5sTNhBg/ExYHsJZyZJJE5SvU8x5mrSwajfVqyyiCOmDLyvyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677797041338836.332048668486; Thu, 2 Mar 2023 14:44:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrcy-00087U-R9; Thu, 02 Mar 2023 17:42:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrcx-00085f-Nw for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:19 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrcw-00008u-6Q for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:19 -0500 Received: by mail-wr1-x432.google.com with SMTP id f11so589859wrv.8 for ; Thu, 02 Mar 2023 14:42:17 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id j2-20020a5d6042000000b002c70d269b4esm464219wrt.91.2023.03.02.14.42.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uZKWKOH8CoWlg9l+QWicKQtR++JaD+yXwzgRvDSnsXc=; b=E2opBkC2OPOkkNFS0K7TUoEqmxa19CAMemYoqOFRucWvymzrZmWHHBj/pwQ9GNniCY 93vB2w42/Rjoz5neMjSmBgGFeixhfjIsWQ9WBsVJXQTEsqn1Zr8OV9zJOT/ubHW/rE/A cYGODGRzESDdXDO426XHvOVNSm6gFXjpHmvP0E6rX1PHofLomAwGMgkkv1PodA0uvIJN TOtYoT4PPYp14zYwGgZF1OTaf2qYogmoFT95ZttuKA+a5Bx7/HSU6tA/vkUGeZ57KWeH 5yhNatwUF1wjya/8DJn3MnL6/L8rdzICrKVRrBSlmShmk3M4aiOijm3Cif8Vi9YpwcF0 87zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uZKWKOH8CoWlg9l+QWicKQtR++JaD+yXwzgRvDSnsXc=; b=YQXDtLgWSLKLUSGn8jvZn7zBxk1YfG4izx6CCghHgucrPskKfT3AjEO3zDNPZQRJib BvMwnXxrXOjH/U1fTCWAThuguFWPwD6iJrtOhJLK9awzpuLsAm+C946d6fwu6jdqhwbb CbAJdqHxWm/47+8e3eUhQccWHW3RQ/VSRfQyL//3olqjy/xxlKZhUvzERXt03ocOnoaG Cv2pCvaiO1XAGlGGpuwzPCWP9xPsOCddbvQUdytfrUOr22pRBvU9TVvpr8hYGVAbBgoY WDEKQ5A+XIHRUA/mw9tR6TNh35mAY8k7nnJYBwRUBXDgRGfNGgGE8DfBvn1yoPoxFTuX zhCQ== X-Gm-Message-State: AO0yUKVdHXXSsOOWQsgSWOVNSC4Cy5YAvBBMViNM8D0jFO2B/+fzoobH ROYCdQgncH4KRZmF9t2XyC4jeFjPmeK8YK9u X-Google-Smtp-Source: AK7set911OSldM2bKaKenSRl6GWBG5WDW7kZ2LtTcbOmPK0FR7zm+PPory4yW2Q3Sg4ZkLSSwEalNw== X-Received: by 2002:a5d:6084:0:b0:2ca:e856:5a4 with SMTP id w4-20020a5d6084000000b002cae85605a4mr2581542wrt.26.1677796936316; Thu, 02 Mar 2023 14:42:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 10/18] hw/isa: Ensure isa_register_portio_list() do not get NULL ISA device Date: Thu, 2 Mar 2023 23:40:50 +0100 Message-Id: <20230302224058.43315-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797042544100001 Previous commit removed the single call to isa_register_portio_list() with dev=3DNULL. To be sure we won't reintroduce such weird (ab)use, assert dev is non-NULL. We can now calls isa_address_space_io() to get the device I/O region. Note we can then remove the NULL check in isa_init_ioport() because it is only called in 2 places (and is static to this file): - isa_register_ioport() which first calls isa_address_space_io(), itself asserting dev is not NULL. - isa_register_portio_list() which also asserts dev is not NULL since the previous commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/isa/isa-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 081bac18ee..9c8224afa5 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -113,7 +113,7 @@ IsaDma *isa_bus_get_dma(ISABus *bus, int nchan) =20 static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) { - if (dev && (dev->ioport_id =3D=3D 0 || ioport < dev->ioport_id)) { + if (dev->ioport_id =3D=3D 0 || ioport < dev->ioport_id) { dev->ioport_id =3D ioport; } } @@ -129,6 +129,7 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *pio_start, void *opaque, const char *name) { + assert(dev); assert(piolist && !piolist->owner); =20 if (!isabus) { --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797090; cv=none; d=zohomail.com; s=zohoarc; b=UfHgAoOTodqRzrCLr0oSpSjoAe8W5dhMjEzwHyTWfwOtMaDnpsbRiqWH8veBarNvwT+4urgZmQxImIlfhpdh72SlpcNYy/7UFbysWDeEvwt3SLxRbQpPbYhwWVuWMMfcxRp/OnzxCn0Nxy0XyyTFiq5w3SSUos1LrtuTJ6PJhgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797090; h=Content-Type:Content-Transfer-Encoding:Cc: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=8TfkteHyoZIi6Uoo7SJxMZBpIZcoshRx7ee998udL3k=; b=nku0J7CUAQW8OsSwimx0uTWSGwKXyyGKQWCBNu040q9siKT73NLlpETRbYCXjirzdVjYjwl0D7hjLkaDBIyaiP5M8NgMW4EBrABmBimKx86ua9Z4/CGAXoz8L3UaCfPeN3zQTfD06IdxgGj3e8uyCeLHHun9c7KkNtF/DR8lpLs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16777970899951021.5639749751831; Thu, 2 Mar 2023 14:44:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrd6-0008Jd-Bj; Thu, 02 Mar 2023 17:42:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrd4-0008GB-QK for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:26 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrd3-0000AQ-2O for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:26 -0500 Received: by mail-wr1-x42a.google.com with SMTP id g3so603618wri.6 for ; Thu, 02 Mar 2023 14:42:24 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id k4-20020adfd844000000b002c57384dfe0sm463992wrl.113.2023.03.02.14.42.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8TfkteHyoZIi6Uoo7SJxMZBpIZcoshRx7ee998udL3k=; b=tsalF1xjU8yaQUVbgPYKOG+z4qPNySKgIHG0bmWLVnTDLSHPvzBOJtnBwdZe3A9/am OPstSrie/iQOcv7Z6p+kcNIdpAi0muFIwkbRI0FZPTgTaqFYVsoFyhheHOBJ2aqr9K5y nG+VYRHOL5LHTOgvoVtiWrQzRCf04vMM/FgufJ6FOgpve2/XdVCdRJHnIkUT8j/xNEAN 6QO1A+4DOqPYNB8YKtfObO4B8uVa36Xbfqe7gyuoWqRdDweBEdzqYBmqrOcF//r8omzp l4XqJK3tJ631oRqIQK+gr3JXD3s7Z17BQSYthpYCrioyKY+ELrFP4NIYPbVzR/JJgwRt so3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8TfkteHyoZIi6Uoo7SJxMZBpIZcoshRx7ee998udL3k=; b=1tg/mdwIjMe/aoRNUdUYc4hK2T/MQB+rmmNIvIBmxTavtNujqnqrWuhwW7RLcQ9D4E kYXMfiHITyni5HPTBDO8a6QwR+NHMdvEUEJi2wZxtZ4Bt+qjF7S3kbJ3f0z6R9Afv24o bt2Xb2RiEYEfji5sTN7dqfHSZEYA0jdAjfDFPoDGiUSEwtZznwTT6Ow/2TPeWM1DLnQO xYyxvCSTYEqoYswyZuLgoZNDRVwMgO6oNt6vyKt2FoHtRJ8Yu7itgBJgm5XwetdkcKvz joAoeORaXVVuyTlO9OYVpclDXufsvEj7VWGhZoSYhhRjTLddU2krAkzglFsUjoMpXdUA cnEg== X-Gm-Message-State: AO0yUKUJAz8t6lWAq/uKuO/OFIbQMSchFHryN/ZfW4IyfTp40GPpi4Xh 81TWB2zlxqNGB0c7fWtN0mGcTAM+w6ADvOYl X-Google-Smtp-Source: AK7set+XWCn3rgfEs4Rkx7tGvgHmBbCcyQDQAqYlpOdz30OqxNB9rP4MdRwLCjS9pd9G/bzw3UY5/g== X-Received: by 2002:adf:db49:0:b0:2c5:54a7:3630 with SMTP id f9-20020adfdb49000000b002c554a73630mr9366567wrj.46.1677796943323; Thu, 02 Mar 2023 14:42:23 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 11/18] hw/isa: Simplify isa_address_space[_io]() Date: Thu, 2 Mar 2023 23:40:51 +0100 Message-Id: <20230302224058.43315-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797090703100001 We don't have any caller passing a NULL device argument, so we can simplify, avoiding to access the global 'isabus'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/isa/isa-bus.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 9c8224afa5..3036341d3b 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -252,20 +252,14 @@ static char *isabus_get_fw_dev_path(DeviceState *dev) =20 MemoryRegion *isa_address_space(ISADevice *dev) { - if (dev) { - return isa_bus_from_device(dev)->address_space; - } - - return isabus->address_space; + assert(dev); + return isa_bus_from_device(dev)->address_space; } =20 MemoryRegion *isa_address_space_io(ISADevice *dev) { - if (dev) { - return isa_bus_from_device(dev)->address_space_io; - } - - return isabus->address_space_io; + assert(dev); + return isa_bus_from_device(dev)->address_space_io; } =20 type_init(isabus_register_types) --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796967; cv=none; d=zohomail.com; s=zohoarc; b=a8ZDMhplnfqbcizSNhL5RU4HGOqvFgTUMYIMCf2Q4F93YfcEkTMXTbeDamKAnQLWJP+na4jGU/V1K4RoyPCF8Bpxr2Pe0y0PPBZAglJyhW++F0/fv23Mkem5gkXzo+p5EbOnB0BVI5cerKYXsYjvHFInBnx3UUOQFbegeHFb2ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796967; h=Content-Type:Content-Transfer-Encoding:Cc: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=8Q+kjUrDqzW8TbJSLEkGuQbfUY5rqxaKrpCoB8EhM+g=; b=O9jOdQzP2OM/cWa/kCM2W79xaDIMKM+IRxkSLOzCeMhBN+legP8gjBKzmLpjBkZ0D+i00WiEPsJF3bN/50wKft01tKoD3PsMwIs86/InKaEJDKrIw1ChyoZ0WOg/gM5M8jg4xxErtSMUVgpZQdgTtN2wrIH7Sx8BIAnsd65WxhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796967737589.8134574461989; Thu, 2 Mar 2023 14:42:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrdF-0000In-7m; Thu, 02 Mar 2023 17:42:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdB-0000AR-GY for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:33 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrd9-0000C4-Sw for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:33 -0500 Received: by mail-wr1-x42a.google.com with SMTP id l1so571996wry.12 for ; Thu, 02 Mar 2023 14:42:31 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id f9-20020adfdb49000000b002c59c6abc10sm477084wrj.115.2023.03.02.14.42.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Q+kjUrDqzW8TbJSLEkGuQbfUY5rqxaKrpCoB8EhM+g=; b=CFRn4QrCQP0ephMH8ZlvYYKoKbL14Qc29VFGAImPEw132JYZxrCwN7w1a3fmjIEY7E /UDQZTCWy3hkOZgi1p/2n0LGTCNyCEuiev8sDfsfVVMO9Cr/dDvviXWMkWL7bFot6heJ /veZ1pza6Ze2Zn+xQk8/xqeLk2X1X479RQZuKNXggfsONg1LVDwwIUXMaLqodO2t5LhJ pWNvW3EV9lCVb1YTAYDN+G4omdniDQin+20LuHIcl5mD+me7TanIHfljWmO87n7zaxiK DLXDERXF/9qhSnSSj0AgZszw/T6UQe7cvMrf3Hy/kZ0SB2NnUsCe6QfBA1lzgswABxKz NTsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Q+kjUrDqzW8TbJSLEkGuQbfUY5rqxaKrpCoB8EhM+g=; b=4Ypr5yDSs8pUULrIOj9PEx+Sky9tWW8MniF1BbNKaoGH2ANeASbQP6IU0JJH1gZZW6 yUbBkEd/KeyjY6GcfAcgM6XQZzbp/6SzoeZnMhq6Tr2kvfDaQsrPrBSLxNCeTM0QIAdc p3r4PpBHXYtJnf4slnIrkAsp2G4biJobFR3ohOPtR3wWhbfQf9znL63mdqlHlsCIYTBI 4eIUMpCtE/RGiYX2Dhoj/1y57hguk7MSWLB3vLnFKnnON7VBOYG5vGGfkdm968P67q8b zP0Gwdi+QW22RB/k0Wk2In4z95+C4WaHu2GzKuqG3lehceDJZgEOpQ3Jsdzy/+Y4HR1K cSKQ== X-Gm-Message-State: AO0yUKUmNoOLlrDgQTiDDK6BLM2M7a8RoJ46ANeRuSkc05h3I+8HqYiN GPaw3wq1y4io+Lxq9dF8lso3sYFFT4QZP+ZB X-Google-Smtp-Source: AK7set+ff+wqRGtCwcgrZobmTeyHPBJruQ3rkkuesD2kSX6/ISuPlKNd749tRXKOFmc6vFwcyQx9oA== X-Received: by 2002:adf:e5c1:0:b0:2c5:5d15:4e25 with SMTP id a1-20020adfe5c1000000b002c55d154e25mr8535246wrn.16.1677796950390; Thu, 02 Mar 2023 14:42:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 12/18] hw/isa: Reduce 'isabus' singleton scope to isa_bus_new() Date: Thu, 2 Mar 2023 23:40:52 +0100 Message-Id: <20230302224058.43315-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796968234100001 Previous commit ensured when entering isa_register_portio_list(), 'dev' is not NULL. Being a TYPE_ISA_DEVICE, the device must sit on a ISA bus. This means isa_bus_new() as already been called and 'isabus' can not be NULL. Simplify by removing the 'isabus' NULL check in isa_register_portio_list(). 'isabus' is now only used in isa_bus_new(). Reduce its scope by only declaring it the function using it (this will allows us to create multiple ISA buses later). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/isa/isa-bus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 3036341d3b..8e3ca3785e 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -25,8 +25,6 @@ #include "sysemu/sysemu.h" #include "hw/isa/isa.h" =20 -static ISABus *isabus; - static char *isabus_get_fw_dev_path(DeviceState *dev); =20 static void isa_bus_class_init(ObjectClass *klass, void *data) @@ -52,6 +50,8 @@ static const TypeInfo isa_bus_info =3D { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space, MemoryRegion *address_space_io, Error **errp) { + static ISABus *isabus; + if (isabus) { error_setg(errp, "Can't create a second ISA bus"); return NULL; @@ -132,10 +132,6 @@ int isa_register_portio_list(ISADevice *dev, assert(dev); assert(piolist && !piolist->owner); =20 - if (!isabus) { - return -ENODEV; - } - /* START is how we should treat DEV, regardless of the actual contents of the portio array. This is how the old code actually handled e.g. the FDC device. */ --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797068; cv=none; d=zohomail.com; s=zohoarc; b=QSvQzUXtlsRx8FRAXNRZx/AKyfU/rzQyLw1ErWJjFY1YznENpWJUco2Il7hsKy8CjYIOlaR2PXFJYcd8+g7+N+67VAQjXZM71O+8SrYtiOVVC6J1wwohApYrSeLXavOuh8OQ6TTISQAn7/hlmPSMYURUAG9icnAN+1PNU3ZL760= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797068; h=Content-Type:Content-Transfer-Encoding:Cc: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=RidLNtwIoGn7ttcFWACRZC3LbU/oAHGplGzZSNvavi4=; b=YKDpQZx1cuyVqjaero0eGhmCZHSskEgEojp3h5T8vUGU2A8Aj0ue/6Y36/P4h58o+1dLiHeWYX65eCBuA0VQJqpG/qjrxAqmSVdNDIjOmAlp3tkC9cq/xvhAdkjWRjhHr9l77ufJ/HX6bTN2kO2Y8SWpP0m3MAculH4MQRGXZL8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677797068551516.9142857534505; Thu, 2 Mar 2023 14:44:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrdN-0000WH-1B; Thu, 02 Mar 2023 17:42:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdK-0000L6-97 for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:42 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdH-0000DJ-U4 for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:42 -0500 Received: by mail-wr1-x436.google.com with SMTP id bx12so578545wrb.11 for ; Thu, 02 Mar 2023 14:42:39 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id e17-20020a5d4e91000000b002c559626a50sm532985wru.13.2023.03.02.14.42.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RidLNtwIoGn7ttcFWACRZC3LbU/oAHGplGzZSNvavi4=; b=B3Z2GZWF65YZNhmwCw6QzT+ty56a8uyLILDtPxnhdNSQ8I2n5QJ2Y+7wbhDIZX/Vgj 1StwQJNzCNtgbAA7cgATHTt61ZpCmRG4O/ruUbl3x5WDwIzwouz6Gjsq30tgBXP0rJha ghw2wBo5LuS5P0RmtR5pO0jDeHeaV70Ey0DDvuGNCHB+doJVV0CNdamhyOHRCF6Fd9KJ 4GXN74WZipb9fqK3J0zXJ8W082WKtJJr0VAQRwRnxxzFOFHDiHWJg3Svoaur+uleCfJV 6eDq7m6V80mZXmSFb8/nf0QdNAR9Prd0qCj85i1V5z7Jzg8xHfyad/gmUxJEYUf6lLxQ P+qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RidLNtwIoGn7ttcFWACRZC3LbU/oAHGplGzZSNvavi4=; b=ab76N21mRLJh4jn4KO8eSfYCdMj3zp2sGcgWzLpWSb8eDvgDiTJg7PAiBuxZ/cSIzG xJBA/jpDCKQ/wzSCZ1yakCcgllQZHdXzzRG41wP70ndA7LwqbF3lYvG8c/wHaXSeAQj5 d3oa+cZF+Px9L/3QWgnps0BU7Bd9c7XtfyQJHl/kTKwbaC4dJP6pRBda9r9UKfdjz4RN 3ZCecXsV5tcDXrz0G2+ods+zgbuPiyi0Zr5C1a8Lr9CKeiREjv79GEra31r13iymW2D9 NRAAthYr9u58hBsixGiE3TFvRSWPoCq1UiCciqC8ULz+/mgLyhINZkRCCng2UBWqJ6EZ 49pQ== X-Gm-Message-State: AO0yUKWSVH3KNlnPgtHmDjpYxtjgTkaYi+JyKY7uaVg/0Aeb+rXqsMaH SNgPzNVDRTwhEsQULaIhjP5zjJG+hNoJqyev X-Google-Smtp-Source: AK7set97gNA8pCbGhtrXeRiPllBW/plNbpaC2ZB8wZ036Ojn4gZMRyk1hGlFrElr2a9STTkqO2SmZw== X-Received: by 2002:a5d:4c52:0:b0:2cd:ceab:df1a with SMTP id n18-20020a5d4c52000000b002cdceabdf1amr2248260wrt.32.1677796958300; Thu, 02 Mar 2023 14:42:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gerd Hoffmann , Paolo Bonzini , Peter Xu , David Hildenbrand Subject: [PATCH v3 13/18] exec/ioport: Factor portio_list_register_flush_coalesced() out Date: Thu, 2 Mar 2023 23:40:53 +0100 Message-Id: <20230302224058.43315-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797070597100003 We always follow the same pattern when registering coalesced portio: - portio_list_init() - portio_list_set_flush_coalesced() - portio_list_add() Factor these 3 operations in a single helper named portio_list_register_flush_coalesced(). Drop portio_list_set_flush_coalesced() which is now inlined. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230207234615.77300-2-philmd@linaro.org> Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/display/qxl.c | 7 +++---- hw/display/vga.c | 5 ++--- include/exec/ioport.h | 5 ++++- softmmu/ioport.c | 27 ++++++++++++++++++++++----- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index ec712d3ca2..2ecaa0643f 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2224,10 +2224,9 @@ static void qxl_realize_primary(PCIDevice *dev, Erro= r **errp) } vga_init(vga, OBJECT(dev), pci_address_space(dev), pci_address_space_io(dev), false); - portio_list_init(&qxl->vga_port_list, OBJECT(dev), qxl_vga_portio_list, - vga, "vga"); - portio_list_set_flush_coalesced(&qxl->vga_port_list); - portio_list_add(&qxl->vga_port_list, pci_address_space_io(dev), 0x3b0); + portio_list_register_flush_coalesced(&qxl->vga_port_list, OBJECT(dev), + qxl_vga_portio_list, vga, "vga", + pci_address_space_io(dev), 0x3b0); qxl->have_vga =3D true; =20 vga->con =3D graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl); diff --git a/hw/display/vga.c b/hw/display/vga.c index 7a5fdff649..98d644922e 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2309,9 +2309,8 @@ void vga_init(VGACommonState *s, Object *obj, MemoryR= egion *address_space, 1); memory_region_set_coalescing(vga_io_memory); if (init_vga_ports) { - portio_list_init(&s->vga_port_list, obj, vga_ports, s, "vga"); - portio_list_set_flush_coalesced(&s->vga_port_list); - portio_list_add(&s->vga_port_list, address_space_io, 0x3b0); + portio_list_register_flush_coalesced(&s->vga_port_list, obj, vga_p= orts, + s, "vga", address_space_io, 0= x3b0); } if (vbe_ports) { portio_list_init(&s->vbe_port_list, obj, vbe_ports, s, "vbe"); diff --git a/include/exec/ioport.h b/include/exec/ioport.h index e34f668998..eb9882a3ee 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -65,7 +65,10 @@ typedef struct PortioList { void portio_list_init(PortioList *piolist, Object *owner, const struct MemoryRegionPortio *callbacks, void *opaque, const char *name); -void portio_list_set_flush_coalesced(PortioList *piolist); +void portio_list_register_flush_coalesced(PortioList *piolist, Object *own= er, + const MemoryRegionPortio *callba= cks, + void *opaque, const char *name, + MemoryRegion *mr, uint32_t offse= t); void portio_list_destroy(PortioList *piolist); void portio_list_add(PortioList *piolist, struct MemoryRegion *address_space, diff --git a/softmmu/ioport.c b/softmmu/ioport.c index cb8adb0b93..be0c920c5c 100644 --- a/softmmu/ioport.c +++ b/softmmu/ioport.c @@ -124,6 +124,7 @@ void portio_list_init(PortioList *piolist, ++n; } =20 + assert(owner); piolist->ports =3D callbacks; piolist->nr =3D 0; piolist->regions =3D g_new0(MemoryRegion *, n); @@ -134,11 +135,6 @@ void portio_list_init(PortioList *piolist, piolist->flush_coalesced_mmio =3D false; } =20 -void portio_list_set_flush_coalesced(PortioList *piolist) -{ - piolist->flush_coalesced_mmio =3D true; -} - void portio_list_destroy(PortioList *piolist) { MemoryRegionPortioList *mrpio; @@ -297,3 +293,24 @@ void portio_list_del(PortioList *piolist) memory_region_del_subregion(piolist->address_space, &mrpio->mr); } } + +static void do_portio_list_register(PortioList *piolist, Object *owner, + const MemoryRegionPortio *callbacks, + void *opaque, const char *name, + MemoryRegion *mr, uint32_t offset, + bool flush_coalesced_mmio) +{ + assert(piolist && !piolist->owner); + portio_list_init(piolist, owner, callbacks, opaque, name); + piolist->flush_coalesced_mmio =3D flush_coalesced_mmio; + portio_list_add(piolist, mr, offset); +} + +void portio_list_register_flush_coalesced(PortioList *piolist, Object *own= er, + const MemoryRegionPortio *callba= cks, + void *opaque, const char *name, + MemoryRegion *mr, uint32_t offse= t) +{ + do_portio_list_register(piolist, owner, callbacks, + opaque, name, mr, offset, true); +} --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677796978; cv=none; d=zohomail.com; s=zohoarc; b=eb+otzBMMNW8FgI3u3qquO2TQm1OBEPJhBc0eERRIFHVMvLXhqqXe0J+ZRGVDMRbDJBxcqSPr5R7+VkqWVum2aH6Z3Z+QHJvOhiHP5MotQ0Ef7kMu+7j8NghuzdU9MSdWAqXKwbEBhG1Mq3nJ5n29aj8bSectd3FT6wfGc8gk20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677796978; h=Content-Type:Content-Transfer-Encoding:Cc: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=fK7g34mJx6gNikGMTsffAMBcXAjcREVS1r1srhHHzWw=; b=atCSTHXUc72KFw4CQ+joUl1KaYS7N2Mpgn++0qYAMB7VbCF8/uB4UyomB5wYnOVblX5MXaX7tAodFP6J8c0v3AoVFJHX3Xj9OGDmK1wF3kbA+W30wKhLjYGTr9wtc1zMcb8hkHWK7KTIrIlF0/3icu8zc9o7SXddWZjnHADIPx4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677796978004692.2189661629816; Thu, 2 Mar 2023 14:42:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrdT-00013w-Q3; Thu, 02 Mar 2023 17:42:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdS-0000uz-AE for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:50 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdQ-0000Ec-58 for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:50 -0500 Received: by mail-wm1-x332.google.com with SMTP id r19-20020a05600c459300b003eb3e2a5e7bso313062wmo.0 for ; Thu, 02 Mar 2023 14:42:47 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id p20-20020a05600c205400b003e8dcc67bdesm3967320wmg.30.2023.03.02.14.42.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fK7g34mJx6gNikGMTsffAMBcXAjcREVS1r1srhHHzWw=; b=Gd1XxVlQ07E87l2OZMVtr1TVfbvkYIypzLnuaJd/X8JWol3BTy6uFEAGHBSD7qlnfu WbtgGIVFx47u1J4R8A/QSyI/sigbA1XKLZWspwh3YCcn37Lih2gTCUjTB0spaEvCmYDy vj6n+vmfUzo5xPbNQsK25lN9sQQf7+br/PKvscR3FgNVKwaGX5Moj4D2cOCa7qS+Q18+ AeNqSsQIe055aKSQbwulcsOsTt27jdHz9nrBNONutLI7eUJqeJ7UXEi6aS0nYS4HpJxd xm/LVARyS7uAjf0IdU7I4hBIx7Mpx9x8pte++HER4BcnGwjUYDF47whJ729e8oqEh0Dh dEDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fK7g34mJx6gNikGMTsffAMBcXAjcREVS1r1srhHHzWw=; b=rmov1EErMcYxkhFpobsTOJp5bR+y3bQx5kcYRMRYpSdVN1mADRfNUvrr+MFmB0V0qK U6V0erg5xd9TTW4+VqBgRLiX9FnlGxCpSGVT//Dv1ppqNZzaAZ+MJDAnvVLS+vC07lTu 4rScXV5zD3bg6GlqIwRYR9yV5mIypWOz8KQSDyTREZ2QFlkABI3gatvVrVwGKDRU+lA8 iQI3rgKeDndmOl7hwFMWyzaR7p4DJ4cTveF23Bv3M1MYHHI8/rtkMPWoQlC6/4Z82VsH lTtK+VWUAGO1sM/YXpdHskemPEc9C8BjX2ngPQSuNHb5TPYO80vcI2q5cpPpPF3POd2d yq6Q== X-Gm-Message-State: AO0yUKUko6WJ7zWU9zq6DdBateeBq/EEBgCiNofv4zcdw9QHggmb3fQG k031Ak/jRQh/UKE4P1wfWrVAMk4wIMr42KFV X-Google-Smtp-Source: AK7set92ay8YYa8ki9PgExPvXTvaQs/6rznBXucVxslxNd9sRiFYtFH8ZQ352hYHzoWNsulJDaMlXQ== X-Received: by 2002:a05:600c:a29e:b0:3eb:4150:a476 with SMTP id hu30-20020a05600ca29e00b003eb4150a476mr8352027wmb.0.1677796966220; Thu, 02 Mar 2023 14:42:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gerd Hoffmann , "Michael S. Tsirkin" , Paolo Bonzini , Peter Xu , David Hildenbrand , qemu-block@nongnu.org Subject: [PATCH v3 14/18] exec/ioport: Factor portio_list_register() out Date: Thu, 2 Mar 2023 23:40:54 +0100 Message-Id: <20230302224058.43315-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677796980255100003 We always follow the same pattern when registering non-coalesced portio: - portio_list_init() - portio_list_add() Factor these 2 operations in a single helper named portio_list_register(). Since both calls become local to ioport.c, reduce their scope by declaring them static. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230207234615.77300-3-philmd@linaro.org> Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/audio/adlib.c | 4 ++-- hw/display/vga.c | 4 ++-- hw/dma/i82374.c | 7 +++---- hw/ide/ioport.c | 9 ++++----- hw/isa/isa-bus.c | 5 ++--- hw/watchdog/wdt_ib700.c | 4 ++-- include/exec/ioport.h | 10 ++++------ softmmu/ioport.c | 21 ++++++++++++++------- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 5f979b1487..cc03c99306 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -291,8 +291,8 @@ static void adlib_realizefn (DeviceState *dev, Error **= errp) =20 adlib_portio_list[0].offset =3D s->port; adlib_portio_list[1].offset =3D s->port + 8; - portio_list_init (&s->port_list, OBJECT(s), adlib_portio_list, s, "adl= ib"); - portio_list_add (&s->port_list, isa_address_space_io(&s->parent_obj), = 0); + portio_list_register(&s->port_list, OBJECT(s), adlib_portio_list, s, + "adlib", isa_address_space_io(&s->parent_obj), 0); } =20 static Property adlib_properties[] =3D { diff --git a/hw/display/vga.c b/hw/display/vga.c index 98d644922e..aa899fddc3 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2313,7 +2313,7 @@ void vga_init(VGACommonState *s, Object *obj, MemoryR= egion *address_space, s, "vga", address_space_io, 0= x3b0); } if (vbe_ports) { - portio_list_init(&s->vbe_port_list, obj, vbe_ports, s, "vbe"); - portio_list_add(&s->vbe_port_list, address_space_io, 0x1ce); + portio_list_register(&s->vbe_port_list, obj, vbe_ports, s, + "vbe", address_space_io, 0x1ce); } } diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 63734c22c9..aeca0e8323 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -131,10 +131,9 @@ static void i82374_realize(DeviceState *dev, Error **e= rrp) } i8257_dma_init(isa_bus, true); =20 - portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, - "i82374"); - portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), - s->iobase); + portio_list_register(&s->port_list, OBJECT(s), i82374_portio_list, s, + "i82374", isa_address_space_io(&s->parent_obj), + s->iobase); =20 memset(s->commands, 0, sizeof(s->commands)); } diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index ed7957dbae..7a6f29955f 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -60,9 +60,8 @@ int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, void ide_bus_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, int iobase, int iobase2) { - portio_list_init(&bus->portio_list, owner, ide_portio_list, bus, "ide"= ); - portio_list_add(&bus->portio_list, io, iobase); - - portio_list_init(&bus->portio2_list, owner, ide_portio2_list, bus, "id= e"); - portio_list_add(&bus->portio_list, io, iobase2); + portio_list_register(&bus->portio_list, owner, ide_portio_list, + bus, "ide", io, iobase); + portio_list_register(&bus->portio2_list, owner, ide_portio2_list, + bus, "ide", io, iobase2); } diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 8e3ca3785e..087293108e 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -130,15 +130,14 @@ int isa_register_portio_list(ISADevice *dev, void *opaque, const char *name) { assert(dev); - assert(piolist && !piolist->owner); =20 /* START is how we should treat DEV, regardless of the actual contents of the portio array. This is how the old code actually handled e.g. the FDC device. */ isa_init_ioport(dev, start); =20 - portio_list_init(piolist, OBJECT(dev), pio_start, opaque, name); - portio_list_add(piolist, isa_address_space_io(dev), start); + portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name, + isa_address_space_io(dev), start); =20 return 0; } diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c index b116c3a3aa..ac4f0be7d8 100644 --- a/hw/watchdog/wdt_ib700.c +++ b/hw/watchdog/wdt_ib700.c @@ -115,8 +115,8 @@ static void wdt_ib700_realize(DeviceState *dev, Error *= *errp) =20 s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, ib700_timer_expired, s); =20 - portio_list_init(&s->port_list, OBJECT(s), wdt_portio_list, s, "ib700"= ); - portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), 0= ); + portio_list_register(&s->port_list, OBJECT(s), wdt_portio_list, s, + "ib700", isa_address_space_io(&s->parent_obj), 0); } =20 static void wdt_ib700_reset(DeviceState *dev) diff --git a/include/exec/ioport.h b/include/exec/ioport.h index eb9882a3ee..ca44f269ea 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -62,17 +62,15 @@ typedef struct PortioList { bool flush_coalesced_mmio; } PortioList; =20 -void portio_list_init(PortioList *piolist, Object *owner, - const struct MemoryRegionPortio *callbacks, - void *opaque, const char *name); +void portio_list_register(PortioList *piolist, Object *owner, + const MemoryRegionPortio *callbacks, + void *opaque, const char *name, + MemoryRegion *mr, uint32_t offset); void portio_list_register_flush_coalesced(PortioList *piolist, Object *own= er, const MemoryRegionPortio *callba= cks, void *opaque, const char *name, MemoryRegion *mr, uint32_t offse= t); void portio_list_destroy(PortioList *piolist); -void portio_list_add(PortioList *piolist, - struct MemoryRegion *address_space, - uint32_t addr); void portio_list_del(PortioList *piolist); =20 #endif /* IOPORT_H */ diff --git a/softmmu/ioport.c b/softmmu/ioport.c index be0c920c5c..42d43f8b27 100644 --- a/softmmu/ioport.c +++ b/softmmu/ioport.c @@ -113,10 +113,9 @@ uint32_t cpu_inl(uint32_t addr) return val; } =20 -void portio_list_init(PortioList *piolist, - Object *owner, - const MemoryRegionPortio *callbacks, - void *opaque, const char *name) +static void portio_list_init(PortioList *piolist, Object *owner, + const MemoryRegionPortio *callbacks, + void *opaque, const char *name) { unsigned n =3D 0; =20 @@ -246,9 +245,8 @@ static void portio_list_add_1(PortioList *piolist, ++piolist->nr; } =20 -void portio_list_add(PortioList *piolist, - MemoryRegion *address_space, - uint32_t start) +static void portio_list_add(PortioList *piolist, MemoryRegion *address_spa= ce, + uint32_t start) { const MemoryRegionPortio *pio, *pio_start =3D piolist->ports; unsigned int off_low, off_high, off_last, count; @@ -314,3 +312,12 @@ void portio_list_register_flush_coalesced(PortioList *= piolist, Object *owner, do_portio_list_register(piolist, owner, callbacks, opaque, name, mr, offset, true); } + +void portio_list_register(PortioList *piolist, Object *owner, + const MemoryRegionPortio *callbacks, + void *opaque, const char *name, + MemoryRegion *mr, uint32_t offset) +{ + do_portio_list_register(piolist, owner, callbacks, + opaque, name, mr, offset, false); +} --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797054; cv=none; d=zohomail.com; s=zohoarc; b=Y4o5PFrkbQV8Y4jZkaq1m1VSP+aO7TA4B/Rv1qfMMLXf9IJImsSc8qIrlf1SUr1tmIGeYhx0DCRDKMMCyL4ettUY3peW569MyGkJ46dz08qSFR2lVnM8UE9fbYzmiRAX5KN4S58wQBr/h1Y9yqJqQeJcHsKCIcTQk8BIy9qajP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797054; h=Content-Type:Content-Transfer-Encoding:Cc: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=Bd1OtqBygG3Ey4k52ycKQXbZ8TYrh9zI9oYB+ByJfKQ=; b=nakYsD/1UbA27MkALcsjb9+ZeRDWXSy5sbPiLI6uRjfr71yDJFobmNBpscNeDVGLYTlecoCs8bWGrnQ0Z7H4Dj640lC2QuIyeIKFuPOHyg7OsVGlYNfueegzSMzR5cfC6SuwXBLcruftLZVqKWh4/G9GIwkUNWyg5xVM4yoj9/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16777970542431008.3550569062029; Thu, 2 Mar 2023 14:44:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrdY-0001Pi-SE; Thu, 02 Mar 2023 17:42:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdX-0001LR-QZ for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:55 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdW-0000Ea-7D for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:42:55 -0500 Received: by mail-wm1-x32e.google.com with SMTP id p16so560253wmq.5 for ; Thu, 02 Mar 2023 14:42:53 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id k8-20020a5d66c8000000b002c573a6216fsm500468wrw.37.2023.03.02.14.42.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bd1OtqBygG3Ey4k52ycKQXbZ8TYrh9zI9oYB+ByJfKQ=; b=CrJZMr7NS+K1QFqpo31b6xY5hqthq8dEBov+MA1lV2MpErknHKeDWvcWwB+0go9Mtx 9SdneTw2a3YbL0Km/+r3ve0MLPsYkdX3tDY3Zu+PfJnJm/WebLC4OV+EwYEBbeSK9qxy 3HsNloyEwb2rGPIFbRqX63jngRYf5nowJnSjXwZYoHMIJRrrZn5AbRzWHzbxCi5y5UAj VLH295r57xm5jSiMhzBpJzmZcuR3XJk9SITV2TC9M3o2i+PMeziwpFoVovFwYLJ7hGsR bEJaXbu/lfuZj9Xa86LkuOUzxIHU48swjyo4DBdfNRH7db2MuOiybI/5B/g5cQF8b0bg yPZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bd1OtqBygG3Ey4k52ycKQXbZ8TYrh9zI9oYB+ByJfKQ=; b=duFopnm0f0/nB6kyPJYdhLa43WiyknQV6uP68LsJKT3LvdcuRyQ4Yh3rpL9sAxfvrs HfqGRFGRngupHTW9XmAOefqPxWhX/Eo4Dqah8aHjpXoBDE5tu/z63rynJndJG6YJ3wdO CPk2CyfsP834zj1AmZ5KxPM8HfjgBf7XsFPFFsthF1/1klt2yqzh3S3z56czpP1LbuPL wNXBX/9KSErFQYDNWAtdXueJq16UiyzSVolL8WPjl4IzE0PnWpO7+QmCv+oLeAzPTbJp RXaEdPUDq8/5xPRdNYrDHni9DMKsKhWpO+uqO35DU0nuNCdl1e1kXV4zocOvsc7t2pYE +C8Q== X-Gm-Message-State: AO0yUKXv6m51Y4A21slNWTUMCGDoqj1Z+8Hgmd9OeJsfi2a7NNFmI4wQ 1P/+x1q4xsslsJBejpRCy1vJB2REDLxYFVG9 X-Google-Smtp-Source: AK7set+4wGgqRXa9ikkWTvI3IuwHWQK+z9OdJ2hJcOAMKxaAK5M1h8NbHimtPCF1N7wKZUe1jqRhow== X-Received: by 2002:a05:600c:181d:b0:3ea:f6c4:5f2a with SMTP id n29-20020a05600c181d00b003eaf6c45f2amr8904936wmp.17.1677796973389; Thu, 02 Mar 2023 14:42:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v3 15/18] hw/southbridge/piix: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Date: Thu, 2 Mar 2023 23:40:55 +0100 Message-Id: <20230302224058.43315-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797054725100001 Manually convert to OBJECT_DECLARE_SIMPLE_TYPE() macro, similarly to automatic conversion from commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- include/hw/southbridge/piix.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 0bf48e936d..a58bf13a41 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -29,7 +29,7 @@ #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ #define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */ =20 -struct PIIXState { +struct PIIX3State { PCIDevice dev; =20 /* @@ -57,14 +57,12 @@ struct PIIXState { /* IO memory region for Reset Control Register (PIIX_RCR_IOPORT) */ MemoryRegion rcr_mem; }; -typedef struct PIIXState PIIX3State; =20 #define TYPE_PIIX3_PCI_DEVICE "pci-piix3" -DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, - TYPE_PIIX3_PCI_DEVICE) - #define TYPE_PIIX3_DEVICE "PIIX3" #define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" #define TYPE_PIIX4_PCI_DEVICE "piix4-isa" =20 +OBJECT_DECLARE_SIMPLE_TYPE(PIIX3State, PIIX3_PCI_DEVICE) + #endif --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797062; cv=none; d=zohomail.com; s=zohoarc; b=c1XrKdw4dbZIyeTeik0xGC3wdrddC5rDZABt/fSQ20UFA7uFQYCZanMzeHsGY/5rvvPMLDvlG2sEC8orrt+9jblpLOhFkC3fSLdM9vZg63uy/dMc6nKYidWpvs+lfnnoVPproOCEVDTdwsJYddctDQwJ/bj3NasqiEjOylvvWF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797062; h=Content-Type:Content-Transfer-Encoding:Cc: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=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=mq7GeDmBKEJNNo99jF75jaS9oqIlXCvJBBxfhnVrZmVj7I3x9DEAJde9miEz1gWVmbL/G/oe7wkkJsWoPlZFlVjDQvyWs1Z2fpCwDFPh0bgAU7x1XwxF6Wa7qnalKHg/tWXNg+ZBnf4Klm6gdAW6fJX4ZNeGZMqis91l9Tvptk4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677797062963444.348987000408; Thu, 2 Mar 2023 14:44:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrdh-0001kv-Hc; Thu, 02 Mar 2023 17:43:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrde-0001gE-Qg for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:02 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdd-0000EZ-6l for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:02 -0500 Received: by mail-wm1-x330.google.com with SMTP id j3so581404wms.2 for ; Thu, 02 Mar 2023 14:43:00 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id p21-20020a05600c431500b003daf672a616sm719382wme.22.2023.03.02.14.42.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=h4Knyj0Z8KTC4eV7VdLnn//y14JwUcX97mrkVBCnvrPzpEOHB1aKjYljpr1NJXF9hk kVK1E1sj4Tyhv0DoIdeVK6m4aNUCa7vmdzWdWadYCUpg29DMmynTW6y337ROV0Uf7v2s 2q1iVCVnNvePBisQfuthkddW8khK//3wPdseVSfVNLFB1FmcSEKA3LRxyXGw4Bh/6Yr5 GUu26AVdnNiUZRl8jUu9nV0PUUNlNOoJEzJYIXQJeiLlrFrI7jFdP3N9WnSFq1LmctW4 PIC6xxJmurjAIMbmIJt+m0+luNXX16UxtoATp569jG3eoK1eh2FcboEJWlIeZaAWPhty kwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=OorIkeXApoO64NBvwlO0BpcecJqCkoEBL+y+gAeGYsPA75Dqe9KSbzWOo3/E4uliIW P+/IsMc5YdBhVOZLTogKvEzkzG8gKwr5iSsCUHIkbLeYifPhKCAc04BIgoKU23WcZ7JE olRr2a9hzNWBAeJTIXiw6e3QLcQ104sXuOVZYUvuZqMgwRuRS7lJRdQaW/rG2QoGEXgS WldnoPKsWFl1YDr7V5V+PMgIjBq9z3+8L4uL3+8FprVR8GyTkXxmbpSQOpXp1x7E7T/C YKHiEvMNez9FCYOQyBw2l5+LVjQWNtU1coLIQARYNA2c1pEB1SxeJbfhjWi0ztqZFfus DzhA== X-Gm-Message-State: AO0yUKUqaX/CRg/o265NLVpgyS4tGe4G1yAo3idR7YhNYR4UzIUXOu/O TmoCWgp0nfjwkrdNQhJ3oQm4kqdzrrgseQTZ X-Google-Smtp-Source: AK7set/a5oV4t7DqaYekSgx5/4yd5r8jZ0HDP5xQZ979b3ZNUsFI/COYk7vjjm2Ckg5ZuuKuK3zOlA== X-Received: by 2002:a05:600c:1708:b0:3ea:c100:f18d with SMTP id c8-20020a05600c170800b003eac100f18dmr8587990wmn.9.1677796980304; Thu, 02 Mar 2023 14:43:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v3 16/18] hw/isa/piix: Batch register QOM types using DEFINE_TYPES() macro Date: Thu, 2 Mar 2023 23:40:56 +0100 Message-Id: <20230302224058.43315-17-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797064560100003 See rationale in commit 38b5d79b2e ("qom: add helper macro DEFINE_TYPES()"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Michael S. Tsirkin --- hw/isa/piix3.c | 53 +++++++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index a9cb39bf21..0ee94a2313 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -346,19 +346,6 @@ static void pci_piix3_class_init(ObjectClass *klass, v= oid *data) adevc->build_dev_aml =3D build_pci_isa_aml; } =20 -static const TypeInfo piix3_pci_type_info =3D { - .name =3D TYPE_PIIX3_PCI_DEVICE, - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PIIX3State), - .abstract =3D true, - .class_init =3D pci_piix3_class_init, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { TYPE_ACPI_DEV_AML_IF }, - { }, - }, -}; - static void piix3_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); @@ -382,12 +369,6 @@ static void piix3_class_init(ObjectClass *klass, void = *data) k->realize =3D piix3_realize; } =20 -static const TypeInfo piix3_info =3D { - .name =3D TYPE_PIIX3_DEVICE, - .parent =3D TYPE_PIIX3_PCI_DEVICE, - .class_init =3D piix3_class_init, -}; - static void piix3_xen_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); @@ -416,17 +397,27 @@ static void piix3_xen_class_init(ObjectClass *klass, = void *data) k->realize =3D piix3_xen_realize; } =20 -static const TypeInfo piix3_xen_info =3D { - .name =3D TYPE_PIIX3_XEN_DEVICE, - .parent =3D TYPE_PIIX3_PCI_DEVICE, - .class_init =3D piix3_xen_class_init, +static const TypeInfo piix_isa_types[] =3D { + { + .name =3D TYPE_PIIX3_PCI_DEVICE, + .parent =3D TYPE_PCI_DEVICE, + .instance_size =3D sizeof(PIIX3State), + .class_init =3D pci_piix3_class_init, + .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, + }, { + .name =3D TYPE_PIIX3_DEVICE, + .parent =3D TYPE_PIIX3_PCI_DEVICE, + .class_init =3D piix3_class_init, + }, { + .name =3D TYPE_PIIX3_XEN_DEVICE, + .parent =3D TYPE_PIIX3_PCI_DEVICE, + .class_init =3D piix3_xen_class_init, + } }; =20 -static void piix3_register_types(void) -{ - type_register_static(&piix3_pci_type_info); - type_register_static(&piix3_info); - type_register_static(&piix3_xen_info); -} - -type_init(piix3_register_types) +DEFINE_TYPES(piix_isa_types) --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797105; cv=none; d=zohomail.com; s=zohoarc; b=Bt/Y34BAqsz9i09irCYWJu7AOkNpqqj2GMptNRQJ+1j9u8ZwkdxJfA2Vn4pBfagvbJVF5NOTZr5vQWfpbaAX5AGCucoFRHOxHkqjffLqjMkG/hZqlzgsZiJ4GqKZWlvRiSkxczggweL/r6CnAAodARrRvLa1vWI2Y+f9IvOIrZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797105; h=Content-Type:Content-Transfer-Encoding:Cc: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=lCQQownvKCVofCZuEa1Oy69oYC3998RQioNT+3DKDLE=; b=M2qDOMcKH89FGnDTXKGAcnZbwGLuqt+yDK5kITgUgc2JZr6sGaIQaPt6SQk/J5Jetj6k2ukA0guldvHnEyXuIKDWur5A52FwMOjHRfJ5TeJ3ZWcgclDe9cA0LALKCoJa7FQCLAsH10kNIORJrV3Ugr9QmZANoFdV7ZnNjgTLDqo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677797105758595.2766698057716; Thu, 2 Mar 2023 14:45:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXrds-0002Nh-EQ; Thu, 02 Mar 2023 17:43:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdn-0002FP-Rd for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:12 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdl-0000Ea-SK for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:11 -0500 Received: by mail-wm1-x32e.google.com with SMTP id p16so560576wmq.5 for ; Thu, 02 Mar 2023 14:43:09 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id h9-20020a5d5049000000b002c54d8b89efsm511156wrt.26.2023.03.02.14.43.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lCQQownvKCVofCZuEa1Oy69oYC3998RQioNT+3DKDLE=; b=X230GNs6TA/wXFb+OGBc8RQbVeviM+3I4GAiwsKtGhv7ul2+Td+pcVGXsAB9iaHYDk l16CHZlGSvMqjr6auJSu1URzjv5MzO+vERWRorZlP4Q4b+GC/eTCl1RV+vhLZtVHBXzX ISBd1An18H3YjjgmleKfyuZs+dSsBR4RuTDgk/DNBQbrJXGhpQolrlLolDYz3v6dNoz9 Q57Qg4ItS9f0faVoWieM8BVaJwxzwemZ48o8mZivD97/TC1uDRM6ka65Dlx5bcFFVkML 3NDnksqQQ1RYC1uGaZcVU65yyNBIc7WWRSNatARsHKWlHEzRtUQAa1uNmzR6D/Ybh2Gl hWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lCQQownvKCVofCZuEa1Oy69oYC3998RQioNT+3DKDLE=; b=tL91EUPTw60qB6W7euN9p3B8D6vZoojkX1t4Ru8DfiWF+1aRcPiWrtOqhXA0pS05w7 vbu0caQByzWBthvELljkVRzur/MgLgkCl19Oot7NBu5XNdmcF7ZcMASje8NqoCFrPxE8 w9UhsTCzdv5qrPlJHMhH8x/+8R555h2mC5VsqmEQEUeWCqJIhG4kAtb+9t9WdMBpdYd5 4XuscjSKQ0IBUfz6pUMFvGBpFkR2vdfFoO3dNvZveEc0dVatWMkijs33ySJpeoX1Upr4 aELaJPLrYSPCD3QKi9gp1dXd8lExd31ljYJnNXHPp0so5TYk20sLCfj5pZZdmQKolBEt K9dQ== X-Gm-Message-State: AO0yUKV6gBJ/fdMLtOwkyaKSvkV4Q9mcywSCyrOI+9sPMd9oPvvDpPdY WwWt6ycAprlTfcZJVpXC1gKMS3inslXnXUXW X-Google-Smtp-Source: AK7set+qVc5pgspySjAMDEJ4RrC6OcXwmBOJ+aldd16JLs46rGwiV/ODqVtZ7vXFF5ldFP62f4uzeQ== X-Received: by 2002:a05:600c:450d:b0:3eb:3945:d3f9 with SMTP id t13-20020a05600c450d00b003eb3945d3f9mr9625867wmo.4.1677796988825; Thu, 02 Mar 2023 14:43:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Aurelien Jarno Subject: [PATCH v3 17/18] hw/isa/piix: Unify QOM type name of PIIX ISA function Date: Thu, 2 Mar 2023 23:40:57 +0100 Message-Id: <20230302224058.43315-18-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797106780100001 Mechanical change doing: $ sed -i -e 's/PIIX4_PCI_DEVICE/PIIX4_ISA/g' $(git grep -l PIIX4_PCI_DEVI= CE) $ sed -i -e 's/PIIX3_XEN_DEVICE/PIIX3_ISA_XEN/g' $(git grep -l PIIX3_XEN_= DEVICE) $ sed -i -e 's/PIIX3_DEVICE/PIIX3_ISA/g' $(git grep -l PIIX3_DEVICE) $ sed -i -e 's/PIIX3_PCI_DEVICE/PIIX_ISA/g' $(git grep -l PIIX3_PCI_DEVIC= E) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 5 ++--- hw/isa/piix3.c | 20 ++++++++++---------- hw/isa/piix4.c | 10 +++++----- hw/mips/malta.c | 2 +- include/hw/southbridge/piix.h | 10 +++++----- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1e90b9ff0d..c887b27009 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -221,8 +221,7 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PIIX3State *piix3; PCIDevice *pci_dev; - const char *type =3D xen_enabled() ? TYPE_PIIX3_XEN_DEVICE - : TYPE_PIIX3_DEVICE; + const char *type =3D xen_enabled() ? TYPE_PIIX3_ISA_XEN : TYPE_PII= X3_ISA; =20 pci_bus =3D i440fx_init(pci_type, i440fx_host, @@ -236,7 +235,7 @@ static void pc_init1(MachineState *machine, pcms->bus =3D pci_bus; =20 pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, typ= e); - piix3 =3D PIIX3_PCI_DEVICE(pci_dev); + piix3 =3D PIIX3_ISA(pci_dev); piix3->pic =3D x86ms->gsi; piix3_devfn =3D piix3->dev.devfn; isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 0ee94a2313..38e0c269ae 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -112,7 +112,7 @@ static void piix3_write_config(PCIDevice *dev, { pci_default_write_config(dev, address, val, len); if (ranges_overlap(address, len, PIIX_PIRQCA, 4)) { - PIIX3State *piix3 =3D PIIX3_PCI_DEVICE(dev); + PIIX3State *piix3 =3D PIIX3_ISA(dev); int pic_irq; =20 pci_bus_fire_intx_routing_notifier(pci_get_bus(&piix3->dev)); @@ -145,7 +145,7 @@ static void piix3_write_config_xen(PCIDevice *dev, =20 static void piix3_reset(DeviceState *dev) { - PIIX3State *d =3D PIIX3_PCI_DEVICE(dev); + PIIX3State *d =3D PIIX3_ISA(dev); uint8_t *pci_conf =3D d->dev.config; =20 pci_conf[0x04] =3D 0x07; /* master, memory and I/O */ @@ -286,7 +286,7 @@ static const MemoryRegionOps rcr_ops =3D { =20 static void pci_piix3_realize(PCIDevice *dev, Error **errp) { - PIIX3State *d =3D PIIX3_PCI_DEVICE(dev); + PIIX3State *d =3D PIIX3_ISA(dev); ISABus *isa_bus; =20 isa_bus =3D isa_bus_new(DEVICE(d), pci_address_space(dev), @@ -349,7 +349,7 @@ static void pci_piix3_class_init(ObjectClass *klass, vo= id *data) static void piix3_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); - PIIX3State *piix3 =3D PIIX3_PCI_DEVICE(dev); + PIIX3State *piix3 =3D PIIX3_ISA(dev); PCIBus *pci_bus =3D pci_get_bus(dev); =20 pci_piix3_realize(dev, errp); @@ -372,7 +372,7 @@ static void piix3_class_init(ObjectClass *klass, void *= data) static void piix3_xen_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); - PIIX3State *piix3 =3D PIIX3_PCI_DEVICE(dev); + PIIX3State *piix3 =3D PIIX3_ISA(dev); PCIBus *pci_bus =3D pci_get_bus(dev); =20 pci_piix3_realize(dev, errp); @@ -399,7 +399,7 @@ static void piix3_xen_class_init(ObjectClass *klass, vo= id *data) =20 static const TypeInfo piix_isa_types[] =3D { { - .name =3D TYPE_PIIX3_PCI_DEVICE, + .name =3D TYPE_PIIX_ISA, .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PIIX3State), .class_init =3D pci_piix3_class_init, @@ -410,12 +410,12 @@ static const TypeInfo piix_isa_types[] =3D { { }, }, }, { - .name =3D TYPE_PIIX3_DEVICE, - .parent =3D TYPE_PIIX3_PCI_DEVICE, + .name =3D TYPE_PIIX3_ISA, + .parent =3D TYPE_PIIX_ISA, .class_init =3D piix3_class_init, }, { - .name =3D TYPE_PIIX3_XEN_DEVICE, - .parent =3D TYPE_PIIX3_PCI_DEVICE, + .name =3D TYPE_PIIX3_ISA_XEN, + .parent =3D TYPE_PIIX_ISA, .class_init =3D piix3_xen_class_init, } }; diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 702b458a3e..90e19a4c37 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -56,7 +56,7 @@ struct PIIX4State { uint8_t rcr; }; =20 -OBJECT_DECLARE_SIMPLE_TYPE(PIIX4State, PIIX4_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PIIX4State, PIIX4_ISA) =20 static void piix4_set_irq(void *opaque, int irq_num, int level) { @@ -81,7 +81,7 @@ static void piix4_set_irq(void *opaque, int irq_num, int = level) =20 static void piix4_isa_reset(DeviceState *dev) { - PIIX4State *d =3D PIIX4_PCI_DEVICE(dev); + PIIX4State *d =3D PIIX4_ISA(dev); uint8_t *pci_conf =3D d->dev.config; =20 pci_conf[0x04] =3D 0x07; // master, memory and I/O @@ -186,7 +186,7 @@ static const MemoryRegionOps piix4_rcr_ops =3D { =20 static void piix4_realize(PCIDevice *dev, Error **errp) { - PIIX4State *s =3D PIIX4_PCI_DEVICE(dev); + PIIX4State *s =3D PIIX4_ISA(dev); PCIBus *pci_bus =3D pci_get_bus(dev); ISABus *isa_bus; qemu_irq *i8259_out_irq; @@ -253,7 +253,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) =20 static void piix4_init(Object *obj) { - PIIX4State *s =3D PIIX4_PCI_DEVICE(obj); + PIIX4State *s =3D PIIX4_ISA(obj); =20 object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); object_initialize_child(obj, "ide", &s->ide, TYPE_PIIX4_IDE); @@ -285,7 +285,7 @@ static void piix4_class_init(ObjectClass *klass, void *= data) } =20 static const TypeInfo piix4_info =3D { - .name =3D TYPE_PIIX4_PCI_DEVICE, + .name =3D TYPE_PIIX4_ISA, .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PIIX4State), .instance_init =3D piix4_init, diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ec172b111a..5aefeba581 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1255,7 +1255,7 @@ void mips_malta_init(MachineState *machine) =20 /* Southbridge */ piix4 =3D pci_create_simple_multifunction(pci_bus, PIIX4_PCI_DEVFN, tr= ue, - TYPE_PIIX4_PCI_DEVICE); + TYPE_PIIX4_ISA); isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix4), "isa.0")); =20 dev =3D DEVICE(object_resolve_path_component(OBJECT(piix4), "ide")); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index a58bf13a41..71a82ef266 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -58,11 +58,11 @@ struct PIIX3State { MemoryRegion rcr_mem; }; =20 -#define TYPE_PIIX3_PCI_DEVICE "pci-piix3" -#define TYPE_PIIX3_DEVICE "PIIX3" -#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" -#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" +#define TYPE_PIIX_ISA "pci-piix3" +#define TYPE_PIIX3_ISA "PIIX3" +#define TYPE_PIIX3_ISA_XEN "PIIX3-xen" +#define TYPE_PIIX4_ISA "piix4-isa" =20 -OBJECT_DECLARE_SIMPLE_TYPE(PIIX3State, PIIX3_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PIIX3State, PIIX3_ISA) =20 #endif --=20 2.38.1 From nobody Mon May 6 02:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677797064; cv=none; d=zohomail.com; s=zohoarc; b=ktFhHKqEc0RXlpkKrri/Eu7tqNyISzfiAy5GuOakG7TG100yZCmmU1qb+mpfNgFxF5bSQsCJHmxrwjoRQviP+ko1IuuRjUqnEn3kkP73tmF/1oxdr7WwAMriYJPkpxc44UcHP9gvUH2E/nhLWv/OgFqQxQyfPNuWbx2DENxQqJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677797064; h=Content-Type:Content-Transfer-Encoding:Cc: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=76WGhaMeuPYXbX/pWJbcrHLrwrtrG1g1D4hmZur00GA=; b=lm3xDiB78GRPoTui3Cx+iCrHnVfJHKZyxiajCsfRUpNCDO2/kb/SDBn6wDSkr+dF0gUk/BXu9MmOWWdw2zCtHTvT4JsO6snqT6ReWs007IqmTioZsC3KZovjIfsN+NmCki7BfpbwXXd84kSxTfac5AcncRJ9/IA66gUzSTvpg3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677797064015871.2623505884266; Thu, 2 Mar 2023 14:44:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXre5-0002vr-2C; Thu, 02 Mar 2023 17:43:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXrdw-0002kR-VR for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:21 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdt-0000Mb-OQ for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:20 -0500 Received: by mail-wr1-x430.google.com with SMTP id l25so618876wrb.3 for ; Thu, 02 Mar 2023 14:43:17 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id e15-20020a5d594f000000b002c56046a3b5sm481652wri.53.2023.03.02.14.43.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=76WGhaMeuPYXbX/pWJbcrHLrwrtrG1g1D4hmZur00GA=; b=iZ+l7xfL/1aNIR07/GVT61XLdWOjC9vj9inShnVEGcn2SL8TMzabaUo+q9kls+6Yor upoRAiiycnbd+h8MZJQQAR9Pu0iTaEccnMBa3T4BFoenT+FB7tYJr7Pa86EPOYhs/gh0 TZTsoFy6IYnJC0352DUKIVKExKJijx4G231iO87Ik+yqxrF18FZeFXoMiyWKo0v3q1nf 6P8uLflQcn2DqZRh47b5iE+Nawc5bjSX6One1SHOAE/FDtDQGDSC+3XRSYC8LrdPbSIN aubb0gL2IHevP8Mml1072IZAgnBK/L7zDERaAMkiI+h/BY+knaFBPUDhYGlWC+0esbpH G1Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=76WGhaMeuPYXbX/pWJbcrHLrwrtrG1g1D4hmZur00GA=; b=MOgC3xKq5rZprR6IK1g36e7553diQ6C6WxbbYqTMX4KbFi4T/RCQkGoj2Z9+oS5YYz S3ydfqvh0bJFzIoQyr5yMCGnZGGd5AwAkN8Qgq79fzxHRsHnj8AzDPYt5dNZDbtJqYBx VnT+4PsRo3nd49PTmwQkT97xO9xC0WRHj7gBeVEQhl4MWNmoPO3YXn6AKLmTH9zcAp5/ VA8fGAweB2P6yTzHxhemvArX2c8j0FIYXLyfo2eEfeG41Xo5ERwRrGlmrMRZqS9odOiz OeLrTgRH8T2YqcYmJcic4fOGqRN/Xe2ataXi59BFYi5V7kEcM48HBfaPIoQqR87uNj/n ajxQ== X-Gm-Message-State: AO0yUKU1r8G+ODG649qOoXO4zgwbitj8FOI+TesB9OdFkWqARS9uHdqG qai/QV5As+Yp4HoX69onxnAJE4uTPz9PzIdQ X-Google-Smtp-Source: AK7set/IJYEjq/epgGkE/m9+5/R30RsFhzIsMKPihePS9U+Gd/Zr1KhBpK7/C9/vZr3J5ViJs4g0ng== X-Received: by 2002:adf:f604:0:b0:2cd:8237:345b with SMTP id t4-20020adff604000000b002cd8237345bmr2131316wrp.9.1677796996311; Thu, 02 Mar 2023 14:43:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Aurelien Jarno , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v3 18/18] hw/isa/piix: Unify PIIX-ISA QOM type names using qdev aliases Date: Thu, 2 Mar 2023 23:40:58 +0100 Message-Id: <20230302224058.43315-19-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677797064652100005 Unify PIIX ISA (PCI function #0) as: pci-piix3 -> piix-isa (abstract base class) PIIX3 -> piix3-isa (PIIX3 implementation) PIIX3-xen -> piix3-isa-xen (PIIX3 implementation with Xen extensions) piix4-isa -> piix4-isa (PIIX4 implementation) Alias previous names in the QDevAlias table. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- include/hw/southbridge/piix.h | 6 +++--- softmmu/qdev-monitor.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 71a82ef266..cce65e8f44 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -58,9 +58,9 @@ struct PIIX3State { MemoryRegion rcr_mem; }; =20 -#define TYPE_PIIX_ISA "pci-piix3" -#define TYPE_PIIX3_ISA "PIIX3" -#define TYPE_PIIX3_ISA_XEN "PIIX3-xen" +#define TYPE_PIIX_ISA "piix-isa" +#define TYPE_PIIX3_ISA "piix3-isa" +#define TYPE_PIIX3_ISA_XEN "piix3-isa-xen" #define TYPE_PIIX4_ISA "piix4-isa" =20 OBJECT_DECLARE_SIMPLE_TYPE(PIIX3State, PIIX3_ISA) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index b8d2c4dadd..820e7f52ad 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -72,6 +72,9 @@ static const QDevAlias qdev_alias_table[] =3D { { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, + { "piix-isa", "pci-piix3" }, + { "piix3-isa", "PIIX3" }, + { "piix3-isa-xen", "PIIX3-xen" }, { "virtio-9p-device", "virtio-9p", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW }, { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI }, --=20 2.38.1