From: Laurent Vivier <lvivier@redhat.com>
To: qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Bharata B Rao <bharata@linux.vnet.ibm.com>,
Markus Armbruster <armbru@redhat.com>,
Matthew Rosato <mjrosato@linux.vnet.ibm.com>,
Laurent Vivier <lvivier@redhat.com>,
"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [Qemu-devel] [PATCH v2 07/20] target-cris: move cpu_exec_realize() to realize function
Date: Thu, 13 Oct 2016 18:24:49 +0200 [thread overview]
Message-ID: <1476375902-11715-8-git-send-email-lvivier@redhat.com> (raw)
In-Reply-To: <1476375902-11715-1-git-send-email-lvivier@redhat.com>
I've removed the cannot_destroy_with_object_finalize_yet field as
unsafe references have been moved to cpu_exec_realize().
(tested with QOM command provided by commit 4c315c27 with
"crisv17-cris-cpu")
CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
target-cris/cpu.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/target-cris/cpu.c b/target-cris/cpu.c
index e28abc1..d50ead5 100644
--- a/target-cris/cpu.c
+++ b/target-cris/cpu.c
@@ -142,6 +142,13 @@ static void cris_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
CRISCPUClass *ccc = CRIS_CPU_GET_CLASS(dev);
+ Error *local_err = NULL;
+
+ cpu_exec_realize(cs, &local_err);
+ if (local_err != NULL) {
+ error_propagate(errp, local_err);
+ return;
+ }
cpu_reset(cs);
qemu_init_vcpu(cs);
@@ -188,7 +195,6 @@ static void cris_cpu_initfn(Object *obj)
cs->env_ptr = env;
cpu_exec_init(cs);
- cpu_exec_realize(cs, &error_abort);
env->pregs[PR_VR] = ccc->vr;
@@ -327,13 +333,6 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data)
cc->gdb_stop_before_watchpoint = true;
cc->disas_set_info = cris_disas_set_info;
-
- /*
- * Reason: cris_cpu_initfn() calls cpu_exec_init(), which saves
- * the object in cpus -> dangling pointer after final
- * object_unref().
- */
- dc->cannot_destroy_with_object_finalize_yet = true;
}
static const TypeInfo cris_cpu_type_info = {
--
2.7.4
next prev parent reply other threads:[~2016-10-13 16:25 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 16:24 [Qemu-devel] [PATCH v2 00/20] Split cpu_exec_init() into an init and a realize part Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 01/20] exec: split cpu_exec_init() Laurent Vivier
2016-10-14 4:05 ` David Gibson
2016-10-14 7:56 ` Greg Kurz
2016-10-14 12:13 ` Laurent Vivier
2016-10-14 15:04 ` Greg Kurz
2016-10-14 13:55 ` Igor Mammedov
2016-10-14 13:57 ` Laurent Vivier
2016-10-14 14:11 ` Igor Mammedov
2016-10-14 14:13 ` Laurent Vivier
2016-10-14 14:26 ` Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 02/20] target-i386: move back cpu_exec_init() to init Laurent Vivier
2016-10-14 13:33 ` Eduardo Habkost
2016-10-14 13:34 ` Laurent Vivier
2016-10-14 13:48 ` Eduardo Habkost
2016-10-14 14:12 ` Laurent Vivier
2016-10-14 14:31 ` Eduardo Habkost
2016-10-14 14:33 ` Igor Mammedov
2016-10-14 14:43 ` Eduardo Habkost
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 03/20] target-ppc: " Laurent Vivier
2016-10-14 4:07 ` David Gibson
2016-10-14 7:12 ` Laurent Vivier
2016-10-14 14:49 ` Bharata B Rao
2016-10-14 17:26 ` Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 04/20] target-s390: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 05/20] target-arm: move cpu_exec_realize() to realize function Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 06/20] target-alpha: " Laurent Vivier
2016-10-13 16:24 ` Laurent Vivier [this message]
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 08/20] target-lm32: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 09/20] target-m68k: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 10/20] target-microblaze: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 11/20] target-mips: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 12/20] target-moxie: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 13/20] target-openrisc: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 14/20] target-sh4: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 15/20] target-sparc: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 16/20] target-tilegx: " Laurent Vivier
2016-10-13 16:24 ` [Qemu-devel] [PATCH v2 17/20] target-tricore: " Laurent Vivier
2016-10-13 16:25 ` [Qemu-devel] [PATCH v2 18/20] target-unicore32: " Laurent Vivier
2016-10-13 16:25 ` [Qemu-devel] [PATCH v2 19/20] target-xtensa: " Laurent Vivier
2016-10-13 16:25 ` [Qemu-devel] [PATCH v2 20/20] exec: move cpu_exec_init() to cpu_common_initfn() Laurent Vivier
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=1476375902-11715-8-git-send-email-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=armbru@redhat.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=edgar.iglesias@gmail.com \
--cc=ehabkost@redhat.com \
--cc=mjrosato@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).