From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PATCH 2/4] cpu: Clarify TODO comment in cpu_generic_new()
Date: Mon, 13 Feb 2017 14:28:17 +0000 [thread overview]
Message-ID: <1486996099-15820-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1486996099-15820-1-git-send-email-peter.maydell@linaro.org>
The TODO comment in cpu_generic_new() suggests that we want to
move to having all callers do the parse_features work by hand.
In fact the intention is that we would prefer to have this
happen automatically via machine core work or similar common
code changes. In the meantime boards should use the
cpu_generic_new() wrapper rather than calling parse_features
themselves, because this means we only need to change one
place in future if we change how parse_features gets called.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Change based on email conversation with Eduardo...hopefully
I have understood the intention here correctly.
---
qom/cpu.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/qom/cpu.c b/qom/cpu.c
index a783aec..eacce5e 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -80,8 +80,14 @@ CPUState *cpu_generic_new(const char *typename, const char *cpu_model)
cc = CPU_CLASS(oc);
featurestr = strtok(NULL, ",");
- /* TODO: all callers of cpu_generic_init() need to be converted to
- * call parse_features() only once, before calling cpu_generic_init().
+ /* TODO: we should really arrange to have parse_features() called
+ * only once, since it needs only to be called once per CPU class
+ * rather than once per instance of that class. Perhaps this would
+ * be done by changes to how machine core code works or by doing
+ * something in main(). In the meantime, board code should prefer
+ * to use this function rather than calling parse_features()
+ * manually, so that refactoring how we handle this is easier in
+ * future.
*/
cc->parse_features(object_class_get_name(oc), featurestr, &err);
g_free(str);
--
2.7.4
next prev parent reply other threads:[~2017-02-13 14:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 14:28 [Qemu-devel] [PATCH 0/4] cpu: Implement cpu_generic_new() Peter Maydell
2017-02-13 14:28 ` [Qemu-devel] [PATCH 1/4] cpu: add cpu_generic_new() Peter Maydell
2017-02-21 18:35 ` Eduardo Habkost
2017-02-13 14:28 ` Peter Maydell [this message]
2017-02-13 14:28 ` [Qemu-devel] [PATCH 3/4] hw/arm/integrator: Use new cpu_generic_new() Peter Maydell
2017-02-13 14:28 ` [Qemu-devel] [PATCH 4/4] hw/arm/virt: " Peter Maydell
2017-02-20 19:10 ` Igor Mammedov
2017-02-21 16:09 ` Eduardo Habkost
2017-02-16 16:40 ` [Qemu-devel] [Qemu-arm] [PATCH 0/4] cpu: Implement cpu_generic_new() Peter Maydell
2017-02-21 15:58 ` Eduardo Habkost
2017-02-21 17:48 ` Peter Maydell
2017-02-17 19:05 ` [Qemu-devel] " Igor Mammedov
2017-02-21 16:01 ` Eduardo Habkost
2017-06-26 13:28 ` [Qemu-devel] [Qemu-arm] " Alex Bennée
2017-06-27 2:33 ` Eduardo Habkost
2017-06-27 8:32 ` Igor Mammedov
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=1486996099-15820-3-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=ehabkost@redhat.com \
--cc=patches@linaro.org \
--cc=qemu-arm@nongnu.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).