From nobody Sat Apr 20 11:57:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585084028; cv=none; d=zohomail.com; s=zohoarc; b=m2tL8r1QAwE2ehaSfshoBWQFBBmiHg3uCvMiqBPK/6P6ofUucvay4Fg5K57MCQ5K30QnOG2hdfFhrxPHzmn8F734omJXzqjP76o+t3ECfzmFZGSDg39N5K38lVI9l4YziTYtajAnILzCRjRQvGqjz6LLziLdPMNuDTXVDSgprYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585084028; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/PaVl/qSnU5x1y8yrybb65l7FtK22198lD0bNYcd+zE=; b=R6dWSBp4zmJAX7MAFx3ehS6FRqmCp9lF28932u5baZHdNp8uX6o4nh4Hj7VWWHHpRpCUxHDSUSYQUlxc1SfhWi8RiU1z4QdIz4Y5GyQT+mNYXJPLE3nzwN3DO8PL/952yn0xZScXvYMWDKhHfQ5poiMe8q8y3WpLjxgAnWrzlLc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585084028494888.7054831467842; Tue, 24 Mar 2020 14:07:08 -0700 (PDT) Received: from localhost ([::1]:55008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqlO-0000KO-TD for importer@patchew.org; Tue, 24 Mar 2020 17:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33961) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqjw-00073v-QS for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGqjv-0005Pl-SM for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:36 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48366 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGqjv-0005P8-Mz; Tue, 24 Mar 2020 17:05:35 -0400 Received: from host86-130-37-163.range86-130.btcentralplus.com ([86.130.37.163] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jGqkL-0001H4-02; Tue, 24 Mar 2020 21:06:04 +0000 From: Mark Cave-Ayland To: peter.maydell@linaro.org, jsnow@redhat.com, balaton@eik.bme.hu, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org Date: Tue, 24 Mar 2020 21:05:17 +0000 Message-Id: <20200324210519.2974-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> References: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.130.37.163 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH for-5.0 1/3] via-ide: don't use PCI level for legacy IRQs X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The PCI level calculation was accidentally left in when rebasing from a previous patchset. Since both IRQs are driven separately, the value being passed into the IRQ handler should be used directly. Signed-off-by: Mark Cave-Ayland --- hw/ide/via.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 8de4945cc1..2a55b7fbc6 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -112,7 +112,6 @@ static void via_ide_set_irq(void *opaque, int n, int le= vel) d->config[0x70 + n * 8] &=3D ~0x80; } =20 - level =3D (d->config[0x70] & 0x80) || (d->config[0x78] & 0x80); qemu_set_irq(isa_get_irq(NULL, 14 + n), level); } =20 --=20 2.20.1 From nobody Sat Apr 20 11:57:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585084149; cv=none; d=zohomail.com; s=zohoarc; b=FTHJYiorgEeJMf0U4CkgPM2IN8OXTB9QsgXWmpmiCGOXb0yDDrXRCAC7eJT48Tpf4sBKXwcVdBQZkgjkk65Wj4FpHikWpA/IoTBTDvmDlNldvmbPI7HUU9ht4jAZQzWA40p4dquo+rjgtgvZQ4W5nRkr/KnhCCKI6jVvUMH/jYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585084149; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7xNldLJfy4ycA2oKpKHbiUOGFXbYMmu6Fe3TST2gKTE=; b=MzHoIcouIOzZQKwuumzDoJso9dvCOU3UxuBD4aFK3RbneK/ocpEHbqdgHHDvD2OCFHZUrTdNi1pnYTE5Et+G9wJLzQEVjKDnCqXq27dhZwsCg/dClX8nd/uB9y2GsOogGXSzhxyt6objQzrLPB3eEXB4VsOiDkMVHexIjqKFXu4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585084149376291.0263257833301; Tue, 24 Mar 2020 14:09:09 -0700 (PDT) Received: from localhost ([::1]:55052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqnM-00048U-3Q for importer@patchew.org; Tue, 24 Mar 2020 17:09:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34026) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqk1-00078a-Nj for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGqjz-0005S9-KZ for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:41 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48378 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGqjz-0005Rb-Ee; Tue, 24 Mar 2020 17:05:39 -0400 Received: from host86-130-37-163.range86-130.btcentralplus.com ([86.130.37.163] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jGqkP-0001H4-1T; Tue, 24 Mar 2020 21:06:09 +0000 From: Mark Cave-Ayland To: peter.maydell@linaro.org, jsnow@redhat.com, balaton@eik.bme.hu, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org Date: Tue, 24 Mar 2020 21:05:18 +0000 Message-Id: <20200324210519.2974-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> References: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.130.37.163 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH for-5.0 2/3] via-ide: use qdev gpio rather than qemu_allocate_irqs() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This prevents the memory from qemu_allocate_irqs() from being leaked which can in some cases be spotted by Coverity (CID 1421984). Signed-off-by: Mark Cave-Ayland --- hw/ide/via.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 2a55b7fbc6..be09912b33 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -160,6 +160,7 @@ static void via_ide_reset(DeviceState *dev) static void via_ide_realize(PCIDevice *dev, Error **errp) { PCIIDEState *d =3D PCI_IDE(dev); + DeviceState *ds =3D DEVICE(dev); uint8_t *pci_conf =3D dev->config; int i; =20 @@ -187,9 +188,10 @@ static void via_ide_realize(PCIDevice *dev, Error **er= rp) bmdma_setup_bar(d); pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar); =20 + qdev_init_gpio_in(ds, via_ide_set_irq, 2); for (i =3D 0; i < 2; i++) { - ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ide_init2(&d->bus[i], qemu_allocate_irq(via_ide_set_irq, d, i)); + ide_bus_new(&d->bus[i], sizeof(d->bus[i]), ds, i, 2); + ide_init2(&d->bus[i], qdev_get_gpio_in(ds, i)); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus =3D &d->bus[i]; --=20 2.20.1 From nobody Sat Apr 20 11:57:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585084148; cv=none; d=zohomail.com; s=zohoarc; b=lUn+/Dc1B3mXjHHpkwuXreqxsKE+CglLpX+E4Y9dLCsLt2aD8a/lqpS6aMQeTnopbKTo/smik4p11DKjZy3cTht5kaT1y0xijdCGG0ayzhDrvSIpOHNTPOP6iC43Dz53iLdv4P1k6cngp5ZNSYXekF51h4vuTRZxOwEhsKAoVb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585084148; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+K73+Nk74zuAdZ+ygqwJJ0iQSbtvsLQ6wZGrr7y0bN0=; b=BdhZXQrhREQrRqgL+ravKqhQY6Jky9opZn7XmftQO1EmAiElUkKZEwcJJna7Ig6fxBROe9XKfzAOluFPsoV+jrv1faGyg7GUe2ZfrHvaSJfb/5z1xn9qzIr6A0+QcN3kSRPhITxo+6Ju/WanpdhD4WXMkNrHhKfvjwfKmaM7rcA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585084148396816.3057346380251; Tue, 24 Mar 2020 14:09:08 -0700 (PDT) Received: from localhost ([::1]:55050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqnL-00047Q-5O for importer@patchew.org; Tue, 24 Mar 2020 17:09:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGqk5-0007FW-96 for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGqk4-0005V8-9g for qemu-devel@nongnu.org; Tue, 24 Mar 2020 17:05:45 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48386 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGqk4-0005US-3n; Tue, 24 Mar 2020 17:05:44 -0400 Received: from host86-130-37-163.range86-130.btcentralplus.com ([86.130.37.163] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jGqkT-0001H4-V1; Tue, 24 Mar 2020 21:06:14 +0000 From: Mark Cave-Ayland To: peter.maydell@linaro.org, jsnow@redhat.com, balaton@eik.bme.hu, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org Date: Tue, 24 Mar 2020 21:05:19 +0000 Message-Id: <20200324210519.2974-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> References: <20200324210519.2974-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.130.37.163 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH for-5.0 3/3] cmd646-ide: use qdev gpio rather than qemu_allocate_irqs() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:41f::167 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This prevents the memory from qemu_allocate_irqs() from being leaked which can in some cases be spotted by Coverity (CID 1421984). Signed-off-by: Mark Cave-Ayland --- hw/ide/cmd646.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 699f25824d..c254631485 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -249,8 +249,8 @@ static void cmd646_pci_config_write(PCIDevice *d, uint3= 2_t addr, uint32_t val, static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp) { PCIIDEState *d =3D PCI_IDE(dev); + DeviceState *ds =3D DEVICE(dev); uint8_t *pci_conf =3D dev->config; - qemu_irq *irq; int i; =20 pci_conf[PCI_CLASS_PROG] =3D 0x8f; @@ -291,16 +291,15 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Er= ror **errp) /* TODO: RST# value should be 0 */ pci_conf[PCI_INTERRUPT_PIN] =3D 0x01; // interrupt on pin 1 =20 - irq =3D qemu_allocate_irqs(cmd646_set_irq, d, 2); + qdev_init_gpio_in(ds, cmd646_set_irq, 2); for (i =3D 0; i < 2; i++) { - ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(dev), i, 2); - ide_init2(&d->bus[i], irq[i]); + ide_bus_new(&d->bus[i], sizeof(d->bus[i]), ds, i, 2); + ide_init2(&d->bus[i], qdev_get_gpio_in(ds, i)); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus =3D &d->bus[i]; ide_register_restart_cb(&d->bus[i]); } - g_free(irq); } =20 static void pci_cmd646_ide_exitfn(PCIDevice *dev) --=20 2.20.1