All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] arm: remove remaining cannot_destroy_with_object_finalize_yet
@ 2017-04-12 17:32 Laurent Vivier
  2017-04-13  7:06 ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2017-04-12 17:32 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Antony Pavlov, Beniamino Galvani,
	Markus Armbruster, qemu-devel, qemu-arm, Edgar E . Iglesias,
	Laurent Vivier

With commit ce5b1bbf624b ("exec: move cpu_exec_init() calls to
realize functions"), we can now remove all the
remaining cannot_destroy_with_object_finalize_yet as
unsafe references have been moved to cpu_exec_realizefn().
(tested with QOM command provided by commit 4c315c27).

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/arm/allwinner-a10.c | 6 ------
 hw/arm/bcm2836.c       | 6 ------
 hw/arm/digic.c         | 6 ------
 hw/arm/fsl-imx25.c     | 5 -----
 hw/arm/fsl-imx31.c     | 5 -----
 hw/arm/fsl-imx6.c      | 5 -----
 hw/arm/xlnx-zynqmp.c   | 6 ------
 7 files changed, 39 deletions(-)

diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index ca15d1c..f62a9a3 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -118,12 +118,6 @@ static void aw_a10_class_init(ObjectClass *oc, void *data)
     DeviceClass *dc = DEVICE_CLASS(oc);
 
     dc->realize = aw_a10_realize;
-
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
 }
 
 static const TypeInfo aw_a10_type_info = {
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 8451190..8c43291 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -160,12 +160,6 @@ static void bcm2836_class_init(ObjectClass *oc, void *data)
 
     dc->props = bcm2836_props;
     dc->realize = bcm2836_realize;
-
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
 }
 
 static const TypeInfo bcm2836_type_info = {
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index d60ea39..94f3263 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -101,12 +101,6 @@ static void digic_class_init(ObjectClass *oc, void *data)
     DeviceClass *dc = DEVICE_CLASS(oc);
 
     dc->realize = digic_realize;
-
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
 }
 
 static const TypeInfo digic_type_info = {
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index 2126f73..9056f27 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -290,11 +290,6 @@ static void fsl_imx25_class_init(ObjectClass *oc, void *data)
 
     dc->realize = fsl_imx25_realize;
 
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
     dc->desc = "i.MX25 SOC";
 }
 
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index dd1c713..d7e2d83 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -262,11 +262,6 @@ static void fsl_imx31_class_init(ObjectClass *oc, void *data)
 
     dc->realize = fsl_imx31_realize;
 
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
     dc->desc = "i.MX31 SOC";
 }
 
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 76dd8a4..6969e73 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -442,11 +442,6 @@ static void fsl_imx6_class_init(ObjectClass *oc, void *data)
 
     dc->realize = fsl_imx6_realize;
 
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
     dc->desc = "i.MX6 SOC";
 }
 
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index bc4e66b..4f67158 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -439,12 +439,6 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
 
     dc->props = xlnx_zynqmp_props;
     dc->realize = xlnx_zynqmp_realize;
-
-    /*
-     * Reason: creates an ARM CPU, thus use after free(), see
-     * arm_cpu_class_init()
-     */
-    dc->cannot_destroy_with_object_finalize_yet = true;
 }
 
 static const TypeInfo xlnx_zynqmp_type_info = {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] arm: remove remaining cannot_destroy_with_object_finalize_yet
  2017-04-12 17:32 [Qemu-devel] [PATCH] arm: remove remaining cannot_destroy_with_object_finalize_yet Laurent Vivier
@ 2017-04-13  7:06 ` Markus Armbruster
  2017-04-13  8:18   ` Laurent Vivier
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2017-04-13  7:06 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Peter Maydell, qemu-devel, Beniamino Galvani, qemu-arm,
	Antony Pavlov, Edgar E . Iglesias, Alistair Francis

Laurent Vivier <lvivier@redhat.com> writes:

> With commit ce5b1bbf624b ("exec: move cpu_exec_init() calls to
> realize functions"), we can now remove all the
> remaining cannot_destroy_with_object_finalize_yet as
> unsafe references have been moved to cpu_exec_realizefn().
> (tested with QOM command provided by commit 4c315c27).

Also tested with device-introspect-test :)

> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Thanks, Laurent!

Reviewed-by: Markus Armbruster <armbru@redhat.com>

Just three places marking broken devices left: versatile.c
("realview_pci" and "versatile_pci"), target/ppc/kvm.c (various ppc
CPUs).  Volunteers to fix them, so we can get rid of
cannot_destroy_with_object_finalize_yet?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] arm: remove remaining cannot_destroy_with_object_finalize_yet
  2017-04-13  7:06 ` Markus Armbruster
@ 2017-04-13  8:18   ` Laurent Vivier
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-04-13  8:18 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Peter Maydell, qemu-devel, Beniamino Galvani, qemu-arm,
	Antony Pavlov, Edgar E . Iglesias, Alistair Francis

On 13/04/2017 09:06, Markus Armbruster wrote:
> Laurent Vivier <lvivier@redhat.com> writes:
> 
>> With commit ce5b1bbf624b ("exec: move cpu_exec_init() calls to
>> realize functions"), we can now remove all the
>> remaining cannot_destroy_with_object_finalize_yet as
>> unsafe references have been moved to cpu_exec_realizefn().
>> (tested with QOM command provided by commit 4c315c27).
> 
> Also tested with device-introspect-test :)
> 
>> Suggested-by: Markus Armbruster <armbru@redhat.com>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> 
> Thanks, Laurent!
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 
> Just three places marking broken devices left: versatile.c
> ("realview_pci" and "versatile_pci"), target/ppc/kvm.c (various ppc
> CPUs).  Volunteers to fix them, so we can get rid of
> cannot_destroy_with_object_finalize_yet?
> 

I think I can have a look to these ones too.

Laurent

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-13  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 17:32 [Qemu-devel] [PATCH] arm: remove remaining cannot_destroy_with_object_finalize_yet Laurent Vivier
2017-04-13  7:06 ` Markus Armbruster
2017-04-13  8:18   ` Laurent Vivier

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.