[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/19] target-arm: move cpu_exec_realize() to re
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH 05/19] target-arm: move cpu_exec_realize() to realize function |
Date: |
Thu, 6 Oct 2016 16:06:03 +1100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Wed, Oct 05, 2016 at 09:38:39PM +0200, Laurent Vivier wrote:
> I've removed the cannot_destroy_with_object_finalize_yet field as
> cpu_exec_init() is not called by arm_cpu_initfn() anymore
I think this (and most of the similar commit messages following) needs
a slight reword. A function called 'cpu_exec_init()' is still called
from the initfn, it's just the unsafe things it used to do have been
moved to cpu_exec_realize().
> (tested with QOM command provided by commit 4c315c27 with
> "arm1026-arm-cpu")
>
> CC: Peter Maydell <address@hidden>
> CC: address@hidden
> Signed-off-by: Laurent Vivier <address@hidden>
> ---
> target-arm/cpu.c | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 5fda716..7920fb0 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -445,7 +445,6 @@ static void arm_cpu_initfn(Object *obj)
>
> cs->env_ptr = &cpu->env;
> cpu_exec_init(cs, &error_abort);
> - cpu_exec_realize(cs, &error_abort);
> cpu->cp_regs = g_hash_table_new_full(g_int_hash, g_int_equal,
> g_free, g_free);
>
> @@ -577,6 +576,13 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
> **errp)
> ARMCPU *cpu = ARM_CPU(dev);
> ARMCPUClass *acc = ARM_CPU_GET_CLASS(dev);
> CPUARMState *env = &cpu->env;
> + Error *local_err = NULL;
> +
> + cpu_exec_realize(cs, &local_err);
> + if (local_err != NULL) {
> + error_propagate(errp, local_err);
> + return;
> + }
>
> /* Some features automatically imply others: */
> if (arm_feature(env, ARM_FEATURE_V8)) {
> @@ -1534,17 +1540,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void
> *data)
> cc->debug_check_watchpoint = arm_debug_check_watchpoint;
>
> cc->disas_set_info = arm_disas_set_info;
> -
> - /*
> - * Reason: arm_cpu_initfn() calls cpu_exec_init(), which saves
> - * the object in cpus -> dangling pointer after final
> - * object_unref().
> - *
> - * Once this is fixed, the devices that create ARM CPUs should be
> - * updated not to set cannot_destroy_with_object_finalize_yet,
> - * unless they still screw up something else.
> - */
> - dc->cannot_destroy_with_object_finalize_yet = true;
> }
>
> static void cpu_register(const ARMCPUInfo *info)
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 01/19] exec: split cpu_exec_init(), (continued)
- [Qemu-devel] [PATCH 01/19] exec: split cpu_exec_init(), Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 02/19] target-i386: move back cpu_exec_init() to init, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 03/19] target-ppc: move back cpu_exec_init() to init, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 04/19] target-s390: move back cpu_exec_init() to init, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 05/19] target-arm: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- Re: [Qemu-devel] [PATCH 05/19] target-arm: move cpu_exec_realize() to realize function,
David Gibson <=
- [Qemu-devel] [PATCH 06/19] target-alpha: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 07/19] target-cris: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 08/19] target-lm32: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 09/19] target-m68k: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 10/19] target-microblaze: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 11/19] target-mips: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 12/19] target-moxie: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 13/19] target-openrisc: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 14/19] target-sh4: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 15/19] target-sparc: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05