On 06/08/2013 06:10 PM, Andreas Färber wrote:
Am 07.06.2013 19:28, schrieb Jason J. Herne:
From: "Jason J. Herne" <jjhe...@us.ibm.com>
In preparation for treating cpus as devices
CPUs *are* devices since multiple releases now, so this is badly put.
we need to separate machine
initialization into two stages:
1. Initialization that needs to be done before cpu devices can be created.
2. Initialization that requires cpu devices to already be created.
This is accomplished by creating an optional post-cpu initialization function
for QEMUMachine.
Whatever you are using it for, this sounds wrong to me.
The QEMUMachine->init() function (at least for S390) currently handles
several tasks. One of those tasks is the creation of cpus. If we are
switching to a new paradigm where QOM cpu devices are parsed and created
in main() then QEMUMachine->init() will happen either before or after
cpus are created. This change is meant to split QEMUMachine->init()
into two parts
1. Stuff that does not depend on cpu creation. Specifically, stuff that
might be a dependency of cpu create, like allocating ipi_states.
2. Stuff that does depend on cpu creation. Like
vm_s390_enable_css_support() which requires CPU 0 to exist.
Machine init is supposed to use less code and more QOM infrastructure,
with a future goal of replacing most code with a config file
instantiating and wiring up devices.
Duly noted. I can have another look at the code. Perhaps there is an
easy place I can move the ipi_state initialization. Also, perhaps there
is a way to remove the cpu-0 dependency from
vm_s390_enable_css_support(). Both of these changes would remove the
need for the post_cpu_init function.
And please don't forget to CC me on the next CPU series.
Sorry. I had meant to CC you originally.
--
-- Jason J. Herne (jjhe...@linux.vnet.ibm.com)