[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c
From: |
Eduardo Habkost |
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 |
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
- [Qemu-devel] [PATCH 0/2] target-i386: move CPU object creation to cpu.c (v2),
Eduardo Habkost <=