From nobody Thu May 9 23:53:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) client-ip=209.85.218.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1620705991; cv=none; d=zohomail.com; s=zohoarc; b=ANFqVTdE5fCEM1FALkmf2Avocz+dMZq1B8Jt6ePDnLBK9OrnnliNWswG+kVAJCN1ywN6nr4jY1U3AOuueyvAJJn+T1auUYrJfuswKISm5Hgk1aOFgapflxt4Zho8RZZrge0qsysGLO0xv/YYj2Qzv4vQOzLDR6KHEtIkPzZcktI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620705991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vTOhIEGU5UoKl+u/lDdl0FTttUH09wWLJNYzcl7Zsfg=; b=h+ihK6owiIHOypOC7hjQivBkB4FnKE8QgvaAzyE6YqlEWAJnXQowHPKBfVN/IckaR2zAll2mr6TJkr8oD7qsQ5frYZJh0smunI0hgOQFoma2boN4mgswhtSBHR7JqlimumtWVCY9C/7jxolp2YSMFAlSqbgTSTamG9lazNwOYog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.zohomail.com with SMTPS id 162070599146814.805350977578769; Mon, 10 May 2021 21:06:31 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id b25so27642226eju.5 for ; Mon, 10 May 2021 21:06:30 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id w6sm7668282edc.25.2021.05.10.21.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 21:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vTOhIEGU5UoKl+u/lDdl0FTttUH09wWLJNYzcl7Zsfg=; b=dHpTl3xAYidxrCUoyx6Ajsu//Xa2dKaEYXs5yoMyWbGwS5hjzfd9WDllcq0HTzDThn cp7gbHdO5w5Qp/12BUx/58ilasNm2HxZMHy7u8SBH6e3xoY0laBlv3TxKypHq7BNYTgQ ywcBuTyikZgVB3vQ56fC8P72TQuCWQ15+/dcSTIu5pUHQVQq7cYQYfbXbItxtD9thGzc S87SUDP92gKm3qUylBqLU2trdctUz3QN0ju1nAz8pZhH3O5WfNCyd4PJqI8Lzo0GBv3I gH2MGd2d/Umvm3fM20fo0KAu1cQ0g7691C4h94gsmwej74IPlSi+1JksLfpBHHULXJiB yemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vTOhIEGU5UoKl+u/lDdl0FTttUH09wWLJNYzcl7Zsfg=; b=JH7yttIRWwoeHSnt0PsXCUJ/zZt42hCZjMM23wO+tMqH7PxqCB7o/mgfRYwrqa7N26 EBwXyRtKu2lgeGPeWe8PLwbas1eGmN2owknhJ6LT1+Y+6Sp3AORnEtqPrrN2aVub1/sU 1XZVDeoFS4Of0XeZLw3sIJ7zA1NFSr2WaZeOqfPqoUl2PzQuuIxZ1ZV3UqQ8CXIpRUZb Bth/B0MaGxq4xdrU1ejVh67mUaUuBaIhuoA6JAFD/TaEE1+VAneEmZf4X7eR9apNCqsQ jV7ankIfy0hhMNYi0M6m5E2D1ah2QxuKWbuUL7aJDzyvMwcKZC7I0AfRd19UkwDHpDTg T8nA== X-Gm-Message-State: AOAM531Isq+A/seY5xGt4r8Ge6RGQKsgGXLUI4lUafpsZY1RmXtGUHBB DN9rLkT1nZpG6km28yzF99w= X-Google-Smtp-Source: ABdhPJzRpRzy0BHkYJ/K5GzCNL7y+GeYrU41iS4lJ3ebUKAjPf6W2T/9XG8wjPvdOKll9PZ0XspbvQ== X-Received: by 2002:a17:906:91d3:: with SMTP id b19mr29404573ejx.242.1620705989724; Mon, 10 May 2021 21:06:29 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , BALATON Zoltan , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , David Gibson , Jiaxun Yang , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 1/4] hw/isa/i82378: Name output IRQ as 'intr' Date: Tue, 11 May 2021 06:06:18 +0200 Message-Id: <20210511040621.2736981-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210511040621.2736981-1-f4bug@amsat.org> References: <20210511040621.2736981-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Named IRQs are easier to understand in the monitor. Name the single output interrupt as 'intr'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/i82378.c | 2 +- hw/ppc/prep.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 2a2ff05b937..fd296c8ed7a 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -113,7 +113,7 @@ static void i82378_init(Object *obj) DeviceState *dev =3D DEVICE(obj); I82378State *s =3D I82378(obj); =20 - qdev_init_gpio_out(dev, s->out, 1); + qdev_init_gpio_out_named(dev, s->out, "intr", 1); qdev_init_gpio_in(dev, i82378_request_pic_irq, 16); } =20 diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index acfc2a91d8e..f19ec612956 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -280,8 +280,8 @@ static void ibm_40p_init(MachineState *machine) =20 /* PCI -> ISA bridge */ i82378_dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(11, 0), "i8= 2378")); - qdev_connect_gpio_out(i82378_dev, 0, - cpu->env.irq_inputs[PPC6xx_INPUT_INT]); + qdev_connect_gpio_out_named(i82378_dev, "intr", 0, + cpu->env.irq_inputs[PPC6xx_INPUT_INT]); sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(i82378_dev, 15)); isa_bus =3D ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0")); =20 --=20 2.26.3 From nobody Thu May 9 23:53:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.41 as permitted sender) client-ip=209.85.208.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1620705997; cv=none; d=zohomail.com; s=zohoarc; b=MUiCtM7sl5QhRa9yFU/EiveSHSsJ5iBr1meoiWiB49axCSHfO0elCitabPF8g2UZRoPSmyGncGq6sW5lhV80kU48fpNlypbodu72AAEmH1FB88Zc0GzvHt9BG+DB/QtlIMo0RKnUNjuXcRv2c5f4JpLgt9Q/PDVzZQkezHn0R/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620705997; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=10h0MBG9bZSfI53ifYB8yD5uFgIe2ZaP7erN0xjXxEE=; b=cXWx89TmFHofTV5HY4C46juF7HVPlqP2KffqBRvz588PTviV4dXwQUFieesyEee25+FzfNP25ljM4l2n+TlwFJ7mHvu3w0aovh2Lip4gRRz0+Rk2bThdG1r9JfaHoJSAa4HXAbCIVr2vR+mzCKBMa4utZCIZfKTjDIJ065EGjaM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mx.zohomail.com with SMTPS id 1620705997262651.2778371839464; Mon, 10 May 2021 21:06:37 -0700 (PDT) Received: by mail-ed1-f41.google.com with SMTP id l7so21225257edb.1 for ; Mon, 10 May 2021 21:06:36 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id d25sm12999974edx.58.2021.05.10.21.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 21:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=10h0MBG9bZSfI53ifYB8yD5uFgIe2ZaP7erN0xjXxEE=; b=CGUuM//f6+iWk388KAg/gx+HmNgbFcePTd7nZxfkCVan6FwD0AszV6la2ABTP3WuwY /cjA5IvfLVtomt0SAz3QmUY6IiUGQwDEgAV+vX3qL2WEpMdDhcSjLPopKcLBuXpejgQ/ /U1GYpl+aWW8sj2K9oXA7P8xULbui1whJlCLBtYN3eGxFe60jYwRkDaXVn3ALyLiLSzq 0g0EdPWYJbXsfRfXc9fbyPLayvldQbCXmhTG8BGu4RUfxelQniTc7KyhtmYupko8W5Y1 6PhHjW0Fz/A93bRXRP4hGAx2YdoPiw5xCLF1VypdP2uuG8iShoX/hhXaPceeFJdJ/QHu y5mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=10h0MBG9bZSfI53ifYB8yD5uFgIe2ZaP7erN0xjXxEE=; b=GJpxMX62M29tIpZuUsa3KgUvHcaPl0eIJzyMeMNABaPfvHK8GaDxr39XCOuADs/rOw lF00qr4sFVc4nW2agRnEiL/gmEiddoE/G+jhuP+T8o9C1eNUFeLQ3dNQJavWol69wS/X iLTn3vrn+zaqQxpJSUat7aHJl1vvIrtdvuBjQOqrJMvAiXgMzW6S8Rwpt/ynNBCmktfh XFYafFvsWXe/f7GyusaKbY7HlFKSUiTbiaIM5IHHuAkk/lLUXDWEs7bHzaeQNLE7kpau P88SwFghAA2p86pMZJa4jnB1m9VDJdEz1Iix5bJrk0luWJNnrpq6vMpYLIDtQJvFUJra tXTA== X-Gm-Message-State: AOAM531CXXsLaq2kAfI/gEBQPCtxIzgEQ4YJqqXCFhV8dWcsi/Ur8Lm/ I7rOMPOZKmi6BUDpLcXw2p8= X-Google-Smtp-Source: ABdhPJynCUt57CHteG5qMjhwTKUWeu/MJt+mhwMnV3V3O0FzPMAkJ/u3OUPQ2cVyRPCwDXaCP7f1mQ== X-Received: by 2002:a50:ab06:: with SMTP id s6mr24925372edc.100.1620705995454; Mon, 10 May 2021 21:06:35 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , BALATON Zoltan , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , David Gibson , Jiaxun Yang , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 2/4] hw/isa/i82378: Simplify removing unuseful qemu_allocate_irqs() call Date: Tue, 11 May 2021 06:06:19 +0200 Message-Id: <20210511040621.2736981-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210511040621.2736981-1-f4bug@amsat.org> References: <20210511040621.2736981-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) When the i82378 model was added in commit a04ff940974 ("prep: Add i82378 PCI-to-ISA bridge emulation") the i8259 model was not yet QOM'ified. This happened later in commit 747c70af78f ("i8259: Convert to qdev"). Instead of creating an input IRQ with qemu_allocate_irqs() to pass it as output IRQ of the PIC, with its handler simply dispatching into the "intr" output IRQ, we can now simplify and directly connect the PIC to the "intr" named output. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/i82378.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index fd296c8ed7a..817eca47053 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -47,12 +47,6 @@ static const VMStateDescription vmstate_i82378 =3D { }, }; =20 -static void i82378_request_out0_irq(void *opaque, int irq, int level) -{ - I82378State *s =3D opaque; - qemu_set_irq(s->out[0], level); -} - static void i82378_request_pic_irq(void *opaque, int irq, int level) { DeviceState *dev =3D opaque; @@ -94,8 +88,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp) */ =20 /* 2 82C59 (irq) */ - s->i8259 =3D i8259_init(isabus, - qemu_allocate_irq(i82378_request_out0_irq, s, 0)= ); + s->i8259 =3D i8259_init(isabus, s->out[0]); isa_bus_irqs(isabus, s->i8259); =20 /* 1 82C54 (pit) */ --=20 2.26.3 From nobody Thu May 9 23:53:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.45 as permitted sender) client-ip=209.85.208.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1620706005; cv=none; d=zohomail.com; s=zohoarc; b=T/jKj0y+3NMQAF8rtdxJn5JC8mAqw5v+5z8WCt0pB0tS1ZsYlE6o/uqhpcpwnBuPqwQcJBATkayrc0aKuUapohME9W2MlocTAFfCemo8ssdbWaLsodBtWz/0e0I4OhRlPnNBgJ/phWREuDTAbnPuhIKfb1LFr5Xa6Pbm0G564XA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620706005; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hns+6A5PyzY0RjxyiODZSOeQ1IcjbT0qFjGtVPHu0KY=; b=C2Y5D2Kb+mOkCPwbUBrylI8F4I20Ak4VOxJ5pF16dJJlnPA5QTP2Wrpj6+56Hh4kRnHavR4f60rh1rYyRFetgdvSG5T7xLhtYGFCsrFo8UmfiuCp0a/sMsWO+EZE+nl6svfa6u7DD0G1P9kVmhUGppnJQH9ry6LJGFOz6by75kM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by mx.zohomail.com with SMTPS id 1620706005086266.1684940913834; Mon, 10 May 2021 21:06:45 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id n25so21205813edr.5 for ; Mon, 10 May 2021 21:06:44 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id n21sm10601825ejx.74.2021.05.10.21.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 21:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hns+6A5PyzY0RjxyiODZSOeQ1IcjbT0qFjGtVPHu0KY=; b=owJ3kv4wAoJ7sVpZlOtpHZ6ym6KtQ6mpbg5WRBmFAw1cfERfzbj4oVBgSwmOzwJt56 vHfZbsmbEFOGzLqnSPzArYXMLvvp+JNmN8o/0s9i2g15DPdigYYAwxi7vUtZPaEC8i26 4T8bLj6VjVBdvBj4CoNJq9z+r+j4BPKlPUUw4cyNzVgYmruedomhkrVHTd0lp1tRAmLF 0Mo9bcsrid/9e+LvJ4IoX23nnjhQTyjfku1ccMJMqJOQS0oMho3lUxDswhRTZrfu7aGb VQ2DsxGi6mc9lKZ3oDqMU7P3yQOjJg2etQmD37LuGSRYSbiX7I1U9rgNH9/Vr3XRtsIX lGkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hns+6A5PyzY0RjxyiODZSOeQ1IcjbT0qFjGtVPHu0KY=; b=FetGY1gjmk55f4TmKNxnLeb2rzVVbDJNbtC0Dh5oM0iGyfF79223NxgrA4WfBErmuy CBG3PSc52xbHIXAaCRa+BKXQKsGd/YbJAMdqWG5kf+/ueDM4XsTFEjm5f745l4lSdukd l7YURfZ9HSFPkVXx4TRQovb6zgH6r3L1xrPhuOdBBTwzvBGnlacXFWDYyerwLGOeDqhh Xoou8lvpZwd1gEnaTKc5+U9xZQrvXl0ZsIQlWqFy8XwaRKQ9di73G3qiM3Po2n9ZwmSd HHXWAFTI2BKb4oNM7VM+QlVbOerczn3Z09NZKhJQkMlKZD/hB3Xdljguh9thWzAPPk+j WaDQ== X-Gm-Message-State: AOAM5336Tjl0vKXVns7BIaEFcUYAR6sv/VWgaVgqr0cov8OD6sKNlw8d bYOdTnN7KWbaw2joGnlHlk0= X-Google-Smtp-Source: ABdhPJyVAnueCpOEJA5/6jR99YSb5iuVPDLCVGLCZ/+L+doPz4ZPTKnrMYqCS1NIxP/veStUNE9DRw== X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr33688077edx.319.1620706003287; Mon, 10 May 2021 21:06:43 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , BALATON Zoltan , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , David Gibson , Jiaxun Yang , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 3/4] hw/isa/i82378: Rename output IRQ variable Date: Tue, 11 May 2021 06:06:20 +0200 Message-Id: <20210511040621.2736981-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210511040621.2736981-1-f4bug@amsat.org> References: <20210511040621.2736981-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The i82378 has 2 output IRQs: "INT" and "NMI". We do not model the NMI, so simplify I82378State by removing the unused IRQ. To avoid keeping an array of one element, remove the array and rename the variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/i82378.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 817eca47053..164d6c65f64 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -32,7 +32,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(I82378State, I82378) struct I82378State { PCIDevice parent_obj; =20 - qemu_irq out[2]; + qemu_irq intr; qemu_irq *i8259; MemoryRegion io; }; @@ -88,7 +88,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp) */ =20 /* 2 82C59 (irq) */ - s->i8259 =3D i8259_init(isabus, s->out[0]); + s->i8259 =3D i8259_init(isabus, s->intr); isa_bus_irqs(isabus, s->i8259); =20 /* 1 82C54 (pit) */ @@ -106,7 +106,7 @@ static void i82378_init(Object *obj) DeviceState *dev =3D DEVICE(obj); I82378State *s =3D I82378(obj); =20 - qdev_init_gpio_out_named(dev, s->out, "intr", 1); + qdev_init_gpio_out_named(dev, &s->intr, "intr", 1); qdev_init_gpio_in(dev, i82378_request_pic_irq, 16); } =20 --=20 2.26.3 From nobody Thu May 9 23:53:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) client-ip=209.85.218.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1620706010; cv=none; d=zohomail.com; s=zohoarc; b=DPzHNe+4VZvbbph+xBkIN36u5GXaF8CzLn1oMnxRjlE0uLQLBDZdxDrFtsVGCADpUfBRlhheOza9N4LN68TskWruCdiEnK+uel7rfdV3EKWDDzrU1zDJoR1EjRsFBor0/Dahiq3cvjfKu1i0s5W77eBC0i3GSCLs6RexGDbf3xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620706010; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gLqOqZ9/hNVipazCBPM8wCatNmUEkk15tp7chFUl0Jg=; b=BLtKBeTGDmLjKcbE9QV3YTxi4bRTrq4IjdqPrjh1Hjhu8QtjprWJE3/JbrIy0NQPosJfD8vlcCHFub3BaQO39wHeYiK3CJIlNOTftGWf1yYShXOuS7yfgfxbbtbVejWnNEsZ2/snsa5K1HCuLObPwrEbSbp3Etexky5fThWRuec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mx.zohomail.com with SMTPS id 1620706010520564.4068367305831; Mon, 10 May 2021 21:06:50 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id t4so27759515ejo.0 for ; Mon, 10 May 2021 21:06:49 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id a24sm13380584edr.74.2021.05.10.21.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 21:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gLqOqZ9/hNVipazCBPM8wCatNmUEkk15tp7chFUl0Jg=; b=UQAMwbCP7+T+EnFzUnwkvL7/cR8cW7w7k4/L6KqF7VwlYIheEkDSjn8a7rbF3AKwF2 T86v0JEFRfiipHfGDv4/rf6Bs5vO5FnAwheyFwhHcdI5Tsf78kLswFD6wolU8wHRu8wI baBzSZLmTNkKkTvK7HdppOFXKR7ztdy/Fe2OypNxU3+phCprX8d6ELrUEqrEA34j4tP9 8HlCaov1B3tS8aSp6hRncxoDY/zO9RN1mTjqQAxJQVREqvNnkSsmRY4WEyJrivXPtvUD g/jLd5gdMKoh7gyEEGlqNoMACkaqpsCQwznhXRzjXsEa7nYueC4QooBWIHVNcE4ff/k6 WYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gLqOqZ9/hNVipazCBPM8wCatNmUEkk15tp7chFUl0Jg=; b=AbyiHfpemjBNdrjC5T08lsxco2b50g4DDq8zQwsKg2xGUcHbY+LkP7zKGC8tOvjGLT n/wsTMQHIGteyWu/xOjD7XELbe/uyr3LqzewIRxepcNOjiLn83mS4QfjHssBcZCndYi2 Zf3Cki5u8jd42nYWvXdxoy1KJfsfWYasHaweXsGUz4MpJaStyAC2288qs9YI2VjBIyJF kEFbJ6TAWo+IyN4SkpXCPhwwpVzm/mhs8TU4L8Laog4XZaDFk01F+3gjyNeSgDbDaKm6 bQfYkyet0qLPbeWyVYsImvS9m1go3RFcDR7q3fyvqYpsXm1oDIy3RnQDQJLP33tHClq9 LKTg== X-Gm-Message-State: AOAM531Ta1k64083bfO/wE0Pxk6qaiNt8DlPuulvAjuYgzskZ9uYOdvZ De/0+Lr967PuKGaQnFtcJ70= X-Google-Smtp-Source: ABdhPJxJ+7S64RfbRelSEWDQMfKj5Bs6NFybyZYbMhL8q/AvHd1OEkHrAAg/8aP0lSDcrnIBguKUrQ== X-Received: by 2002:a17:907:2cc1:: with SMTP id hg1mr29978183ejc.453.1620706008834; Mon, 10 May 2021 21:06:48 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , BALATON Zoltan , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , David Gibson , Jiaxun Yang , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 4/4] hw/isa/piix4: Fix leak removing unuseful qemu_allocate_irqs() call Date: Tue, 11 May 2021 06:06:21 +0200 Message-Id: <20210511040621.2736981-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210511040621.2736981-1-f4bug@amsat.org> References: <20210511040621.2736981-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) We locally create an input IRQ with qemu_allocate_irqs() to pass it as output IRQ of the PIC, but its handler simply dispatch into another of our output IRQ ("intr" output). Simplify by directly connecting the PIC output to our "intr" output. This fixes when using QEMU built with --enable-sanitizers: =3D=3D338425=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x5641b361e1df in malloc (qemu-system-mips+0x1b201df) #1 0x7f995e683958 in g_malloc (/lib64/libglib-2.0.so.0+0x58958) #2 0x5641b5558e36 in qemu_allocate_irqs hw/core/irq.c:66:12 #3 0x5641b4161817 in piix4_realize hw/isa/piix4.c:171:21 #4 0x5641b42f077a in pci_qdev_realize hw/pci/pci.c:2114:9 #5 0x5641b554c802 in device_set_realized hw/core/qdev.c:761:13 #6 0x5641b5578458 in property_set_bool qom/object.c:2257:5 #7 0x5641b55709e2 in object_property_set qom/object.c:1402:5 #8 0x5641b55861c9 in object_property_set_qobject qom/qom-qobject.c:28:10 #9 0x5641b5571831 in object_property_set_bool qom/object.c:1472:15 #10 0x5641b55410fd in qdev_realize hw/core/qdev.c:389:12 Fixes: 078778c5a55 ("piix4: Add an i8259 Interrupt Controller as specified = in datasheet") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix4.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 0fe7b69bc4c..a16f7a3ef94 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -115,12 +115,6 @@ static const VMStateDescription vmstate_piix4 =3D { } }; =20 -static void piix4_request_i8259_irq(void *opaque, int irq, int level) -{ - PIIX4State *s =3D opaque; - qemu_set_irq(s->cpu_intr, level); -} - static void piix4_set_i8259_irq(void *opaque, int irq, int level) { PIIX4State *s =3D opaque; @@ -161,7 +155,6 @@ static void piix4_realize(PCIDevice *dev, Error **errp) { PIIX4State *s =3D PIIX4_PCI_DEVICE(dev); ISABus *isa_bus; - qemu_irq *i8259_out_irq; =20 isa_bus =3D isa_bus_new(DEVICE(dev), pci_address_space(dev), pci_address_space_io(dev), errp); @@ -180,8 +173,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) PIIX_RCR_IOPORT, &s->rcr_mem, 1); =20 /* initialize i8259 pic */ - i8259_out_irq =3D qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); - s->isa =3D i8259_init(isa_bus, *i8259_out_irq); + s->isa =3D i8259_init(isa_bus, s->cpu_intr); =20 /* initialize ISA irqs */ isa_bus_irqs(isa_bus, s->isa); --=20 2.26.3