From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570713605; cv=none; d=zoho.com; s=zohoarc; b=IH16UAik0Uc/KiPqP9eEcS8XLflTjatBne+gedYVcA5Fnv8vwScVPbssxWYpSYPF+sFE97+n3w708wAzlsvRXPQeK8DkUonVWP/Wow6nqtudHo5ePKBendWZQ0MkGcf4gpD4Rw1b+Ku0OVuYABErjzNQmKE8NFNe0aTO8SmS1RI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570713605; 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=6f3veFybJCek5QThzD5hWRpThS8W3xiH10dhJyGoM58=; b=B8z4nLa1q6vVnKAF2Wyktwtgwd/qC6cuGWOdhUSA86PUxdbfGwufC1+IiCuE5u3mOKttqje4V9bG9UJovcUCOK7abuwiWwfLaFOSbRV98dsqOPS8bGXFIMNZGyegipLix1czYV4qp3clAmAuY+YxhnH3KmFLzVLRLGJ0AlMvkGc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570713605072616.8293061616372; Thu, 10 Oct 2019 06:20:05 -0700 (PDT) Received: from localhost ([::1]:39370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYMN-0002xs-Ss for importer@patchew.org; Thu, 10 Oct 2019 09:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40395) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYIY-0007jR-D4 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYIX-0001we-6Z for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYIM-0001sH-6q; Thu, 10 Oct 2019 09:15:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C46F3091D70; Thu, 10 Oct 2019 13:15:52 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18889600C4; Thu, 10 Oct 2019 13:15:45 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 1/8] hw/acpi/piix4: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:20 +0200 Message-Id: <20191010131527.32513-2-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 10 Oct 2019 13:15:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The PIIX4/PM is a PCI device within the PIIX4 chipset, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Igor Mammedov Reviewed-by: Li Qiang Reviewed-by: Michael S. Tsirkin Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/piix4.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 5742c3df87..4e079b39bd 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -27,7 +27,6 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "hw/acpi/acpi.h" -#include "sysemu/reset.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "qapi/error.h" @@ -344,9 +343,9 @@ static const VMStateDescription vmstate_acpi =3D { } }; =20 -static void piix4_reset(void *opaque) +static void piix4_pm_reset(DeviceState *dev) { - PIIX4PMState *s =3D opaque; + PIIX4PMState *s =3D PIIX4_PM(dev); PCIDevice *d =3D PCI_DEVICE(s); uint8_t *pci_conf =3D d->config; =20 @@ -542,7 +541,6 @@ static void piix4_pm_realize(PCIDevice *dev, Error **er= rp) =20 s->machine_ready.notify =3D piix4_pm_machine_ready; qemu_add_machine_init_done_notifier(&s->machine_ready); - qemu_register_reset(piix4_reset, s); =20 piix4_acpi_system_hot_add_init(pci_address_space_io(dev), pci_get_bus(dev), s); @@ -692,6 +690,7 @@ static void piix4_pm_class_init(ObjectClass *klass, voi= d *data) k->device_id =3D PCI_DEVICE_ID_INTEL_82371AB_3; k->revision =3D 0x03; k->class_id =3D PCI_CLASS_BRIDGE_OTHER; + dc->reset =3D piix4_pm_reset; dc->desc =3D "PM"; dc->vmsd =3D &vmstate_acpi; dc->props =3D piix4_pm_properties; --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570713941; cv=none; d=zoho.com; s=zohoarc; b=RS+uW/R3z3Gu4IJcguVNMxe1OmVD5BlSXLl68LUxMeW5cfjzUgK3yDzm+ktw0UE4N7FdcPNO2/9N8QKlglPNjXIEfn5/JceWJ+1WKTd4LWnoJnEl0kHDad8HSQyNM7P4gkAI5FEwp1IarPfssEBesWrnOhVipq3cUWlJUpSF7SQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570713941; 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=Lt3BlfszPKhdObFiu+znH1KadBX+IZ8Nnr9aNd/bIrI=; b=fgNQli8218eisTo98OofyrTnR8ihRyadgvxpctGH8gcib/Ilvm1/24ouGB6ctc6KlXELNSuTjwQbpESMck9uAIoDfZVhCo8MW2bP5hjcsdsMrfcsbrmtPl4iOvGj3Vo95SKf47LvQxsR84pOGRlGZ7nxwi4dgoYIsh7SAzor1J4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570713941953335.8590661722898; Thu, 10 Oct 2019 06:25:41 -0700 (PDT) Received: from localhost ([::1]:39478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYRo-0002y5-9h for importer@patchew.org; Thu, 10 Oct 2019 09:25:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40452) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYIm-000847-QP for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYIk-00020n-4A for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYIf-0001zD-Qq; Thu, 10 Oct 2019 09:16:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAC193065603; Thu, 10 Oct 2019 13:16:12 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE5BD600C4; Thu, 10 Oct 2019 13:15:52 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 2/8] hw/isa/piix4: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:21 +0200 Message-Id: <20191010131527.32513-3-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 10 Oct 2019 13:16:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The PIIX4/ISA is a PCI device within the PIIX4 chipset, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix4.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 3294056cd5..890d999abf 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -28,7 +28,6 @@ #include "hw/isa/isa.h" #include "hw/sysbus.h" #include "migration/vmstate.h" -#include "sysemu/reset.h" =20 PCIDevice *piix4_dev; =20 @@ -40,9 +39,9 @@ typedef struct PIIX4State { #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) =20 -static void piix4_reset(void *opaque) +static void piix4_isa_reset(DeviceState *dev) { - PIIX4State *d =3D opaque; + PIIX4State *d =3D PIIX4_PCI_DEVICE(dev); uint8_t *pci_conf =3D d->dev.config; =20 pci_conf[0x04] =3D 0x07; // master, memory and I/O @@ -97,7 +96,6 @@ static void piix4_realize(PCIDevice *dev, Error **errp) return; } piix4_dev =3D &d->dev; - qemu_register_reset(piix4_reset, d); } =20 int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) @@ -118,6 +116,7 @@ static void piix4_class_init(ObjectClass *klass, void *= data) k->vendor_id =3D PCI_VENDOR_ID_INTEL; k->device_id =3D PCI_DEVICE_ID_INTEL_82371AB_0; k->class_id =3D PCI_CLASS_BRIDGE_ISA; + dc->reset =3D piix4_isa_reset; dc->desc =3D "ISA bridge"; dc->vmsd =3D &vmstate_piix4; /* --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570714088; cv=none; d=zoho.com; s=zohoarc; b=lOU1gktp3q1H1TNa0qZkFIzCivMu7c2Ggz3M+/hIV7lyKX75LXDvCokDjBK4BUDtnJLk7gzziTLdtEMmtvftNDDV8J7v8TlQgDhG/1fPgdowJpsA68pOYjVxJAb8P8CjIakAW15PJ4+vir4PQkC+8hSXybsBJMWfWj5Ey9wYIDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570714088; 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=BlpXGMJgm9AYzn+Z+5JIGHke9H+8v+/QP8gxuh2SmeY=; b=al5TbGLUJrq219fobsgSjt3HndAgCajAFHHjdK+nRP6DvGFpY3Iw4bLV7O6DmYBzVyAgKva+Qhin88Oh5kdUOC0kh+prGqDboIhfLk0TvEWZ/Dzco3PVVwIHIXrQmMRZXSllDo0OVPIVLSEh62dzGyXBN7bmJgE9NoiXejfUOaY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570714088595207.67867062228265; Thu, 10 Oct 2019 06:28:08 -0700 (PDT) Received: from localhost ([::1]:39510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYUA-0006Ua-Tj for importer@patchew.org; Thu, 10 Oct 2019 09:28:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40514) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYJ6-0000JB-PT for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYJ5-0002By-Fu for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYJ0-0002A2-Tm; Thu, 10 Oct 2019 09:16:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF56A8D5D84; Thu, 10 Oct 2019 13:16:33 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EA79600C4; Thu, 10 Oct 2019 13:16:13 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 3/8] hw/ide/piix: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:22 +0200 Message-Id: <20191010131527.32513-4-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 10 Oct 2019 13:16:34 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The PIIX/IDE is a PCI device within a PIIX chipset, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Li Qiang --- v3: Also convert PIIX4 (Li Qiang) --- hw/ide/piix.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index fba6bc8bff..db313dd3b1 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -30,7 +30,6 @@ #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/dma.h" -#include "sysemu/reset.h" =20 #include "hw/ide/pci.h" #include "trace.h" @@ -103,9 +102,9 @@ static void bmdma_setup_bar(PCIIDEState *d) } } =20 -static void piix3_reset(void *opaque) +static void piix_ide_reset(DeviceState *dev) { - PCIIDEState *d =3D opaque; + PCIIDEState *d =3D PCI_IDE(dev); PCIDevice *pd =3D PCI_DEVICE(d); uint8_t *pci_conf =3D pd->config; int i; @@ -154,8 +153,6 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error = **errp) =20 pci_conf[PCI_CLASS_PROG] =3D 0x80; // legacy ATA mode =20 - qemu_register_reset(piix3_reset, d); - bmdma_setup_bar(d); pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar); =20 @@ -247,6 +244,7 @@ static void piix3_ide_class_init(ObjectClass *klass, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 + dc->reset =3D piix_ide_reset; k->realize =3D pci_piix_ide_realize; k->exit =3D pci_piix_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_INTEL; @@ -273,6 +271,7 @@ static void piix4_ide_class_init(ObjectClass *klass, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 + dc->reset =3D piix_ide_reset; k->realize =3D pci_piix_ide_realize; k->exit =3D pci_piix_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_INTEL; --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570713805; cv=none; d=zoho.com; s=zohoarc; b=B2Q/pPxzZ0i3VA0pOsY8lb2eywh6A30dhhB38u7PTXbda6LWOv3Rr98E5bPplnYDUkzdNqlsFvPlT+FS2fwMNtDgWzR15MBjvukZE7O6rYALMwoYCjAsbhQaWqgMMSH3fAGwGIFcsiZmGB60Zh158mU/814XgHfp9P/OJbb+a4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570713805; 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=D5FXIWhaVIx4CNQx8TAUCptfFwEckphvDdLlQQbJW64=; b=oTw35syA9yQ3x0C87bE6zzANjxahx/PYqEQNT2UDxqLsHzccHQLUWicGUZMbTLuOHD8GMx2jhJMBRPZT2S1TgA/AdY/fWWZSNs0s1RMuoxpZCs0MbTHP6S6Jirs0eqtPK39cdUjNHrHg6Bi0yyeFTWCYh+Hq49Li9c1i/e165nA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570713805503679.3906810967546; Thu, 10 Oct 2019 06:23:25 -0700 (PDT) Received: from localhost ([::1]:39418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYPb-0007Vh-VL for importer@patchew.org; Thu, 10 Oct 2019 09:23:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40572) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYJG-0000iM-Hn for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYJF-0002HZ-FD for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:16:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54536) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYJ9-0002Dh-Il; Thu, 10 Oct 2019 09:16:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE3773084249; Thu, 10 Oct 2019 13:16:42 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B76B7600C4; Thu, 10 Oct 2019 13:16:34 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 4/8] hw/ide/sii3112: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:23 +0200 Message-Id: <20191010131527.32513-5-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 10 Oct 2019 13:16:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The SiI3112A SATA controller is a PCI device, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/sii3112.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 2181260531..06605d7af2 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" #include "hw/ide/pci.h" #include "qemu/module.h" -#include "sysemu/reset.h" #include "trace.h" =20 #define TYPE_SII3112_PCI "sii3112" @@ -237,9 +236,9 @@ static void sii3112_set_irq(void *opaque, int channel, = int level) sii3112_update_irq(s); } =20 -static void sii3112_reset(void *opaque) +static void sii3112_reset(DeviceState *dev) { - SiI3112PCIState *s =3D opaque; + SiI3112PCIState *s =3D SII3112_PCI(dev); int i; =20 for (i =3D 0; i < 2; i++) { @@ -290,7 +289,6 @@ static void sii3112_pci_realize(PCIDevice *dev, Error *= *errp) s->bmdma[i].bus =3D &s->bus[i]; ide_register_restart_cb(&s->bus[i]); } - qemu_register_reset(sii3112_reset, s); } =20 static void sii3112_pci_class_init(ObjectClass *klass, void *data) @@ -303,6 +301,7 @@ static void sii3112_pci_class_init(ObjectClass *klass, = void *data) pd->class_id =3D PCI_CLASS_STORAGE_RAID; pd->revision =3D 1; pd->realize =3D sii3112_pci_realize; + dc->reset =3D sii3112_reset; dc->desc =3D "SiI3112A SATA controller"; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570714378; cv=none; d=zoho.com; s=zohoarc; b=eVrA1PxuEuLRCAgfVXpgB5nloYz59FUlR8R/uewcTOAlOdHvYgb7kGc5dmK7J4+w6ao9a5pkmShcjMFvqrvB9lvkhPsfH8+SK0YMC7qXnVWp49sTk6VIzAq6sT/4mzcKESdctjt/MZ/iY7BP53YUoipJvGBuITDxDl+Vz3Yeqh0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570714378; 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=2ts7F2QF8kPMzpQEfnd1+3ebkf2x+anuumMELNS3ZZ8=; b=JnOfeIl1lBS8zFEvv+LM/p3yf9IWyOrDSRdnTKjmJS+TeZ5mzHu+touZ+sqUMLBNKJLzWqaURCHkPIm1wK9XidpaU/V/0OJh9yVYDqVykSiphrYgP+gG2S1PKHeuMm//xjH1vZ/NDN5aSb50v/gS9l7qLW3V0youRndGHXxkGM8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 157071437860591.80135539219589; Thu, 10 Oct 2019 06:32:58 -0700 (PDT) Received: from localhost ([::1]:39574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYYl-0002OC-Us for importer@patchew.org; Thu, 10 Oct 2019 09:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40675) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYJp-0001JP-0g for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYJn-0002Tq-Uk for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYJS-0002ND-ID; Thu, 10 Oct 2019 09:17:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E4238D5D84; Thu, 10 Oct 2019 13:17:01 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87F6B600C4; Thu, 10 Oct 2019 13:16:43 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 5/8] hw/ide/via82c: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:24 +0200 Message-Id: <20191010131527.32513-6-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 10 Oct 2019 13:17:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The VIA82C686B IDE controller is a PCI device, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/via.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index 7087dc676e..053622bd82 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -29,7 +29,6 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h" -#include "sysemu/reset.h" =20 #include "hw/ide/pci.h" #include "trace.h" @@ -120,10 +119,10 @@ static void via_ide_set_irq(void *opaque, int n, int = level) } } =20 -static void via_ide_reset(void *opaque) +static void via_ide_reset(DeviceState *dev) { - PCIIDEState *d =3D opaque; - PCIDevice *pd =3D PCI_DEVICE(d); + PCIIDEState *d =3D PCI_IDE(dev); + PCIDevice *pd =3D PCI_DEVICE(dev); uint8_t *pci_conf =3D pd->config; int i; =20 @@ -172,8 +171,6 @@ static void via_ide_realize(PCIDevice *dev, Error **err= p) pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); dev->wmask[PCI_INTERRUPT_LINE] =3D 0xf; =20 - qemu_register_reset(via_ide_reset, d); - memory_region_init_io(&d->data_bar[0], OBJECT(d), &pci_ide_data_le_ops, &d->bus[0], "via-ide0-data", 8); pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[0]); @@ -229,6 +226,7 @@ static void via_ide_class_init(ObjectClass *klass, void= *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 + dc->reset =3D via_ide_reset; k->realize =3D via_ide_realize; k->exit =3D via_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_VIA; --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570714558; cv=none; d=zoho.com; s=zohoarc; b=T62WlkTEsuvvDn3MSVCkxUBGH9OgYaHoWBe/ujdXfj4MEjgP+ix6dJT2YxNa1JEqXrLiqwOOEHBg79GToOjrgrkwseYWmCPacTLQ6CO0GnSzRqIy954iTS3swWRxM2bwMjdP2er6XmtPdvXIXSq6aiahsv/m3IrP7LVn0RaghxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570714558; 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=Lfx+rSrCn7dmMKSFfedUIEoKzK0fnhz01UWv/MjrHAE=; b=JdEdWgmN3bCqvDODqTwAYYBhB6gBRonaJJBcn3WgiWfFMJcFhGY2bbqV4tF+MbXekwUa3DkAzIlIVgUKi/PQbiC81RsmFi5frWWJufnYH7x2wLOaM9TOz5qKFyV59BhKAjxOzIz6ytjpo7vz/ZGnTaAzsE+GYowg0kd9Ijkdjtk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570714558689650.7485185880521; Thu, 10 Oct 2019 06:35:58 -0700 (PDT) Received: from localhost ([::1]:39630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYbj-0006Gu-1j for importer@patchew.org; Thu, 10 Oct 2019 09:35:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYKD-0001P5-7H for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYJx-0002a2-Ht for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46812) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYJn-0002Sn-0b; Thu, 10 Oct 2019 09:17:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43A5C307D989; Thu, 10 Oct 2019 13:17:21 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F756600F8; Thu, 10 Oct 2019 13:17:01 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 6/8] hw/isa/vt82c686: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:25 +0200 Message-Id: <20191010131527.32513-7-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 10 Oct 2019 13:17:21 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The VIA VT82C686 Southbridge is a PCI device, it will be reset when the PCI bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/vt82c686.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 50bd28fa82..616f67f347 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -23,7 +23,6 @@ #include "hw/isa/apm.h" #include "hw/acpi/acpi.h" #include "hw/i2c/pm_smbus.h" -#include "sysemu/reset.h" #include "qemu/module.h" #include "qemu/timer.h" #include "exec/address-spaces.h" @@ -116,11 +115,10 @@ static const MemoryRegionOps superio_ops =3D { }, }; =20 -static void vt82c686b_reset(void * opaque) +static void vt82c686b_isa_reset(DeviceState *dev) { - PCIDevice *d =3D opaque; - uint8_t *pci_conf =3D d->config; - VT82C686BState *vt82c =3D VT82C686B_DEVICE(d); + VT82C686BState *vt82c =3D VT82C686B_DEVICE(dev); + uint8_t *pci_conf =3D vt82c->dev.config; =20 pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMO= RY | @@ -476,8 +474,6 @@ static void vt82c686b_realize(PCIDevice *d, Error **err= p) * But we do not emulate a floppy, so just set it here. */ memory_region_add_subregion(isa_bus->address_space_io, 0x3f0, &vt82c->superio); - - qemu_register_reset(vt82c686b_reset, d); } =20 ISABus *vt82c686b_isa_init(PCIBus *bus, int devfn) @@ -501,6 +497,7 @@ static void via_class_init(ObjectClass *klass, void *da= ta) k->device_id =3D PCI_DEVICE_ID_VIA_ISA_BRIDGE; k->class_id =3D PCI_CLASS_BRIDGE_ISA; k->revision =3D 0x40; + dc->reset =3D vt82c686b_isa_reset; dc->desc =3D "ISA bridge"; dc->vmsd =3D &vmstate_via; /* --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570713669; cv=none; d=zoho.com; s=zohoarc; b=Xxt8tFJWcykbErGXxkSr882aAh0ir93lrOofA2vquroKqnx67sSngGr5SiRU5aN3xg+Gcolczkz4PMTwOYYhDzlcxp82L+yrMqiQ1jxtuJyn/nmykpwh7rpQbrmBiadlQiM962FWv6qHXAne61EjReiVkjQDUnRhCvRoSMnoYUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570713669; 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=hbvB7K6UKVysYOcknWadMnLtTxCVkXkQBfdY7Yelkng=; b=PSBVr5KyL5SStW+aXTHXgBco6zCmqUS5FdIb9og8HsS9KHnyOMAbZGHB4jlXNyDQ2Bv5cEj/jKs4+ydiXKNGMB6k1GOhccdwoeUI0i9INuAOwot+2L6rSC6BnrJ4KlPrlyCK8Jbfj9WWMhcxKW9a8HbtNPP5LY6x9AFAtehLzAo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570713669982629.1741453312973; Thu, 10 Oct 2019 06:21:09 -0700 (PDT) Received: from localhost ([::1]:39374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYNQ-0004DL-Aa for importer@patchew.org; Thu, 10 Oct 2019 09:21:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40788) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYKH-0001d3-Hp for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYKE-0002dt-OO for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:17:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39054) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYJs-0002Xy-TV; Thu, 10 Oct 2019 09:17:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB15A300BCE9; Thu, 10 Oct 2019 13:17:27 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5C71600C4; Thu, 10 Oct 2019 13:17:21 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 7/8] hw/input/lm832x: Convert reset handler to DeviceReset Date: Thu, 10 Oct 2019 15:15:26 +0200 Message-Id: <20191010131527.32513-8-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 10 Oct 2019 13:17:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The LM8323 key-scan controller is a I2C device, it will be reset when the I2C bus it stands on is reset. Convert its reset handler into a proper Device reset method. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lm832x.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index a37eb854b9..aa629ddbf1 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -24,7 +24,6 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "qemu/timer.h" -#include "sysemu/reset.h" #include "ui/console.h" =20 #define TYPE_LM8323 "lm8323" @@ -94,8 +93,10 @@ static void lm_kbd_gpio_update(LM823KbdState *s) { } =20 -static void lm_kbd_reset(LM823KbdState *s) +static void lm_kbd_reset(DeviceState *dev) { + LM823KbdState *s =3D LM8323(dev); + s->config =3D 0x80; s->status =3D INT_NOINIT; s->acttime =3D 125; @@ -273,7 +274,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int= byte, uint8_t value) =20 case LM832x_CMD_RESET: if (value =3D=3D 0xaa) - lm_kbd_reset(s); + lm_kbd_reset(DEVICE(s)); else lm_kbd_error(s, ERR_BADPAR); s->reg =3D LM832x_GENERAL_ERROR; @@ -476,10 +477,6 @@ static void lm8323_realize(DeviceState *dev, Error **e= rrp) s->pwm.tm[1] =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, lm_kbd_pwm1_tick, s); s->pwm.tm[2] =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, lm_kbd_pwm2_tick, s); qdev_init_gpio_out(dev, &s->nirq, 1); - - lm_kbd_reset(s); - - qemu_register_reset((void *) lm_kbd_reset, s); } =20 void lm832x_key_event(DeviceState *dev, int key, int state) @@ -507,6 +504,7 @@ static void lm8323_class_init(ObjectClass *klass, void = *data) DeviceClass *dc =3D DEVICE_CLASS(klass); I2CSlaveClass *k =3D I2C_SLAVE_CLASS(klass); =20 + dc->reset =3D lm_kbd_reset; dc->realize =3D lm8323_realize; k->event =3D lm_i2c_event; k->recv =3D lm_i2c_rx; --=20 2.21.0 From nobody Sun May 19 05:22:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570713826; cv=none; d=zoho.com; s=zohoarc; b=mpd0OnHuZ1hjQxtjFwpfauqKlEQT04HaqImHFxAYVsoWRSCZmAp//nQeW4ng7kVfjFHHnCDNdpVjKkSCFPkWx+irom01/rDYBe80LEp62UaFuBmc7GXuV8MHGdV7q/eSiqpXOM7b9+6gBRufixTqGGH02t3zqK7JBNdk5QrsccU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570713826; 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=g1CN3Ljl2ur4lmUrkVTih6yiU8zw+/IHSEn1ij5C+js=; b=WHFt56MsEn6o6V6d3mGxmaq10xU3hID+oemQj+Igb+1V0jUwXRyxHRsUn05J5Ix6UGVN4I5wJ0URJG/0Rs3lHxs3s/1UTpO9VukoPFjGOKlj1m6/7fbcoUicYEqIrn9aCkqGBLCpKu+o0JybkYf1QysJ0Rsdbo04+lB3mLya3cw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570713826179138.72567946507263; Thu, 10 Oct 2019 06:23:46 -0700 (PDT) Received: from localhost ([::1]:39426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYPw-00089N-G3 for importer@patchew.org; Thu, 10 Oct 2019 09:23:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40864) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIYKW-0001qf-EW for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:18:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIYKV-0002lA-Ce for qemu-devel@nongnu.org; Thu, 10 Oct 2019 09:18:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46904) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIYKD-0002c3-DV; Thu, 10 Oct 2019 09:17:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 35F26307D847; Thu, 10 Oct 2019 13:17:44 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9641A600C4; Thu, 10 Oct 2019 13:17:28 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Subject: [PATCH v3 8/8] hw/misc/vmcoreinfo: Add comment about reset handler Date: Thu, 10 Oct 2019 15:15:27 +0200 Message-Id: <20191010131527.32513-9-philmd@redhat.com> In-Reply-To: <20191010131527.32513-1-philmd@redhat.com> References: <20191010131527.32513-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 10 Oct 2019 13:17:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , qemu-block@nongnu.org, "Michael S. Tsirkin" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The VM coreinfo device does not sit on a bus, so it won't be reset automatically. This is why it calls qemu_register_reset(). Add a comment about it, so we don't convert its reset handler to a DeviceReset method. Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/vmcoreinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index 326a3ce8f4..a9d718fc23 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -61,6 +61,10 @@ static void vmcoreinfo_realize(DeviceState *dev, Error *= *errp) NULL, fw_cfg_vmci_write, s, &s->vmcoreinfo, sizeof(s->vmcoreinfo), false); =20 + /* + * This device requires to register a global reset because it is + * not plugged to a bus (which, as its QOM parent, would reset it). + */ qemu_register_reset(vmcoreinfo_reset, dev); vmcoreinfo_state =3D s; } --=20 2.21.0