From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c (v2)
Date: Wed, 12 Dec 2012 16:16:21 -0200 [thread overview]
Message-ID: <1355336183-18858-1-git-send-email-ehabkost@redhat.com> (raw)
This small series moves the X86CPU object creation to the cpu.c code, as the
object creation will depend on the CPU class lookup, that will be done inside
cpu.c.
I expect this to make the x86 CPU subclass work simpler. Maybe it will help
simplify some of the CPU properties work, too.
This version is simply a rebase of v1 on top of Igor's series:
Subject: [Qemu-devel] [PATCH 0/6] x86 CPU cleanup (wave 2)
Git branch for testing:
git://github.com/ehabkost/qemu-hacks.git cpu-x86-create.v2
https://github.com/ehabkost/qemu-hacks/tree/cpu-x86-create.v2
As Igor have suggested instead moving cpu_x86_init() to cpu.c, I will try to
explain the rationale, here:
The CPU creation consists of multiple steps:
1) Splitting cpu_model string into CPU model name and feature string;
2) Choosing the CPU model class;
3) Creating CPU object;
4) Parsing feature string;
5) cpu_x86_realize()
And:
* cpu_x86_register() already does steps 1 and 4.
* cpu_x86_init() does steps 2, 3, and 5
* We need to separate step 5 from the rest, as step 5 will eventually
become the realize() method of the CPU object.
To accomplish that, the first patch in this series simply moves 3 lines of code
(steps 2 and 3) from cpu_x86_init() to cpu_x86_register(), and renames
cpu_x86_register() to cpu_x86_create(), so now:
* cpu_x86_create() does steps 1 to 4
* cpu_x86_init() simply become a trivial wrapper to call cpu_x86_create()
(steps 1-4) and cpu_x86_realize() (step 5)
Eduardo Habkost (2):
target-i386: move CPU object creation to cpu.c
target-i386: make cpu_x86_create() get Error argument
target-i386/cpu.c | 22 ++++++++++++++++++----
target-i386/cpu.h | 2 +-
target-i386/helper.c | 26 ++++++++++++++------------
3 files changed, 33 insertions(+), 17 deletions(-)
--
1.7.11.7
next reply other threads:[~2012-12-12 18:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 18:16 Eduardo Habkost [this message]
2012-12-12 18:16 ` [Qemu-devel] [PATCH 1/2] target-i386: move CPU object creation to cpu.c Eduardo Habkost
2012-12-14 10:26 ` Igor Mammedov
2012-12-14 12:42 ` Eduardo Habkost
2012-12-12 18:16 ` [Qemu-devel] [PATCH 2/2] target-i386: make cpu_x86_create() get Error argument Eduardo Habkost
2012-12-14 10:18 ` Igor Mammedov
2012-12-14 12:38 ` Eduardo Habkost
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=1355336183-18858-1-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=imammedo@redhat.com \
--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).