Message ID | alpine.DEB.2.02.1305281358150.4799@kaball.uk.xensource.com |
---|---|
State | New |
Headers | show |
Il 28/05/2013 15:44, Stefano Stabellini ha scritto: > > I actually tested it and seems to work fine but I wouldn't want to paint > me into a corner by setting up a new use case that nobody else is > testing. > On the other hand I dislike having to create a "useless" x86 cpu, that > at the moment doesn't even work because cpu_x86_init seems to be broken > by the lack of the ICC bridge. > > Overall if the QEMU machine model supports it (and it looks like it > does), I would rather choose the "no cpu" option. I also prefer this. I wonder if this change would make xen_machine_pv.c work for any architecture rather than just i386, at least for xen_mode == XEN_ATTACH. Paolo
On Tue, 28 May 2013, Paolo Bonzini wrote: > Il 28/05/2013 15:44, Stefano Stabellini ha scritto: > > > > I actually tested it and seems to work fine but I wouldn't want to paint > > me into a corner by setting up a new use case that nobody else is > > testing. > > On the other hand I dislike having to create a "useless" x86 cpu, that > > at the moment doesn't even work because cpu_x86_init seems to be broken > > by the lack of the ICC bridge. > > > > Overall if the QEMU machine model supports it (and it looks like it > > does), I would rather choose the "no cpu" option. > > I also prefer this. I wonder if this change would make xen_machine_pv.c > work for any architecture rather than just i386, at least for xen_mode > == XEN_ATTACH. Right, that is might goal. I want to have xen_machine_pv on ARM.
diff --git a/hw/i386/xen_machine_pv.c b/hw/i386/xen_machine_pv.c index f829a52..260b211 100644 --- a/hw/i386/xen_machine_pv.c +++ b/hw/i386/xen_machine_pv.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ +#include "hw/cpu/icc_bus.h" #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/boards.h" @@ -35,10 +36,9 @@ static void xen_init_pv(QEMUMachineInitArgs *args) const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; - X86CPU *cpu; - CPUState *cs; DriveInfo *dinfo; int i; + DeviceState *icc_bridge; /* Initialize a dummy CPU */ if (cpu_model == NULL) { @@ -48,9 +48,10 @@ static void xen_init_pv(QEMUMachineInitArgs *args) cpu_model = "qemu32"; #endif } - cpu = cpu_x86_init(cpu_model); - cs = CPU(cpu); - cs->halted = 1; + icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); + object_property_add_child(qdev_get_machine(), "icc-bridge", + OBJECT(icc_bridge), NULL); + pc_cpus_init(cpu_model, icc_bridge); /* Initialize backend core & drivers */ if (xen_be_init() != 0) {