qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c
@ 2012-12-11  0:30 Eduardo Habkost
  2012-12-11  0:30 ` [Qemu-devel] [PATCH 1/2] " Eduardo Habkost
  2012-12-11  0:30 ` [Qemu-devel] [PATCH 2/2] target-i386: make cpu_x86_create() get Error argument Eduardo Habkost
  0 siblings, 2 replies; 9+ messages in thread
From: Eduardo Habkost @ 2012-12-11  0:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Igor Mammedov, Andreas Färber

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.

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    | 23 ++++++++++++++++++-----
 target-i386/cpu.h    |  2 +-
 target-i386/helper.c | 26 ++++++++++++++------------
 3 files changed, 33 insertions(+), 18 deletions(-)

-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c (v2)
@ 2012-12-12 18:16 Eduardo Habkost
  2012-12-12 18:16 ` [Qemu-devel] [PATCH 2/2] target-i386: make cpu_x86_create() get Error argument Eduardo Habkost
  0 siblings, 1 reply; 9+ messages in thread
From: Eduardo Habkost @ 2012-12-12 18:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Igor Mammedov, Andreas Färber

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

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

end of thread, other threads:[~2012-12-14 12:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11  0:30 [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c Eduardo Habkost
2012-12-11  0:30 ` [Qemu-devel] [PATCH 1/2] " Eduardo Habkost
2012-12-11 13:21   ` Eduardo Habkost
2012-12-11 13:33   ` Igor Mammedov
2012-12-11 13:46     ` Eduardo Habkost
2012-12-11  0:30 ` [Qemu-devel] [PATCH 2/2] target-i386: make cpu_x86_create() get Error argument Eduardo Habkost
  -- strict thread matches above, loose matches on Subject: below --
2012-12-12 18:16 [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c (v2) 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

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).