All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 18/29] hw/arm: Convert TYPE_ARM_SMMUV3 to 3-phase reset
Date: Thu, 15 Dec 2022 12:49:58 +0000	[thread overview]
Message-ID: <20221215125009.980128-19-peter.maydell@linaro.org> (raw)
In-Reply-To: <20221215125009.980128-1-peter.maydell@linaro.org>

Convert the TYPE_ARM_SMMUV3 device to 3-phase reset.  The legacy
reset method doesn't do anything that's invalid in the hold phase, so
the conversion only requires changing it to a hold phase method, and
using the 3-phase versions of the "save the parent reset method and
chain to it" code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20221109161444.3397405-3-peter.maydell@linaro.org
---
 include/hw/arm/smmuv3.h |  2 +-
 hw/arm/smmuv3.c         | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
index c641e60735e..f1921fdf9e7 100644
--- a/include/hw/arm/smmuv3.h
+++ b/include/hw/arm/smmuv3.h
@@ -77,7 +77,7 @@ struct SMMUv3Class {
     /*< public >*/
 
     DeviceRealize parent_realize;
-    DeviceReset   parent_reset;
+    ResettablePhases parent_phases;
 };
 
 #define TYPE_ARM_SMMUV3   "arm-smmuv3"
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index daa80e9c7b6..955b89c8d59 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1431,12 +1431,14 @@ static void smmu_init_irq(SMMUv3State *s, SysBusDevice *dev)
     }
 }
 
-static void smmu_reset(DeviceState *dev)
+static void smmu_reset_hold(Object *obj)
 {
-    SMMUv3State *s = ARM_SMMUV3(dev);
+    SMMUv3State *s = ARM_SMMUV3(obj);
     SMMUv3Class *c = ARM_SMMUV3_GET_CLASS(s);
 
-    c->parent_reset(dev);
+    if (c->parent_phases.hold) {
+        c->parent_phases.hold(obj);
+    }
 
     smmuv3_init_regs(s);
 }
@@ -1520,10 +1522,12 @@ static void smmuv3_instance_init(Object *obj)
 static void smmuv3_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
     SMMUv3Class *c = ARM_SMMUV3_CLASS(klass);
 
     dc->vmsd = &vmstate_smmuv3;
-    device_class_set_parent_reset(dc, smmu_reset, &c->parent_reset);
+    resettable_class_set_parent_phases(rc, NULL, smmu_reset_hold, NULL,
+                                       &c->parent_phases);
     c->parent_realize = dc->realize;
     dc->realize = smmu_realize;
 }
-- 
2.25.1



  parent reply	other threads:[~2022-12-15 13:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 12:49 [PULL 00/29] target-arm queue Peter Maydell
2022-12-15 12:49 ` [PULL 01/29] hw/arm/virt: Introduce virt_set_high_memmap() helper Peter Maydell
2022-12-15 12:49 ` [PULL 02/29] hw/arm/virt: Rename variable size to region_size in virt_set_high_memmap() Peter Maydell
2022-12-15 12:49 ` [PULL 03/29] hw/arm/virt: Introduce variable region_base " Peter Maydell
2022-12-15 12:49 ` [PULL 04/29] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper Peter Maydell
2022-12-15 12:49 ` [PULL 05/29] hw/arm/virt: Improve high memory region address assignment Peter Maydell
2022-12-15 12:49 ` [PULL 06/29] hw/arm/virt: Add 'compact-highmem' property Peter Maydell
2022-12-15 12:49 ` [PULL 07/29] hw/arm/virt: Add properties to disable high memory regions Peter Maydell
2022-12-15 12:49 ` [PULL 08/29] hw/arm/virt: build SMBIOS 19 table Peter Maydell
2022-12-15 12:49 ` [PULL 09/29] target/arm: Add Cortex-A55 CPU Peter Maydell
2022-12-15 12:49 ` [PULL 10/29] hw/intc/arm_gicv3: Fix GICD_TYPER ITLinesNumber advertisement Peter Maydell
2022-12-15 12:49 ` [PULL 11/29] target/arm: Allow relevant HCR bits to be written for FEAT_EVT Peter Maydell
2022-12-15 12:49 ` [PULL 12/29] target/arm: Implement HCR_EL2.TTLBIS traps Peter Maydell
2022-12-15 12:49 ` [PULL 13/29] target/arm: Implement HCR_EL2.TTLBOS traps Peter Maydell
2022-12-15 12:49 ` [PULL 14/29] target/arm: Implement HCR_EL2.TICAB,TOCU traps Peter Maydell
2022-12-15 12:49 ` [PULL 15/29] target/arm: Implement HCR_EL2.TID4 traps Peter Maydell
2022-12-15 12:49 ` [PULL 16/29] target/arm: Report FEAT_EVT for TCG '-cpu max' Peter Maydell
2022-12-15 12:49 ` [PULL 17/29] hw/arm: Convert TYPE_ARM_SMMU to 3-phase reset Peter Maydell
2022-12-15 12:49 ` Peter Maydell [this message]
2022-12-15 12:49 ` [PULL 19/29] hw/intc: Convert TYPE_ARM_GIC_COMMON " Peter Maydell
2022-12-15 12:50 ` [PULL 20/29] hw/intc: Convert TYPE_ARM_GIC_KVM " Peter Maydell
2022-12-15 12:50 ` [PULL 21/29] hw/intc: Convert TYPE_ARM_GICV3_COMMON " Peter Maydell
2022-12-15 12:50 ` [PULL 22/29] hw/intc: Convert TYPE_KVM_ARM_GICV3 " Peter Maydell
2022-12-15 12:50 ` [PULL 23/29] hw/intc: Convert TYPE_ARM_GICV3_ITS_COMMON " Peter Maydell
2022-12-15 12:50 ` [PULL 24/29] hw/intc: Convert TYPE_ARM_GICV3_ITS " Peter Maydell
2022-12-15 12:50 ` [PULL 25/29] hw/intc: Convert TYPE_KVM_ARM_ITS " Peter Maydell
2022-12-15 12:50 ` [PULL 26/29] hw/arm/boot: set initrd with #address-cells type in fdt Peter Maydell
2022-12-15 12:50 ` [PULL 27/29] target/arm: align exposed ID registers with Linux Peter Maydell
2022-12-15 12:50 ` [PULL 28/29] hw/misc: Move some arm-related files from specific_ss into softmmu_ss Peter Maydell
2022-12-15 12:50 ` [PULL 29/29] target/arm: Restrict arm_cpu_exec_interrupt() to TCG accelerator Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221215125009.980128-19-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.