]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
qemu-xen: Fix PV segfault
authorIan Jackson <iwj@mariner.uk.xensource.com>
Wed, 2 Jul 2008 17:24:35 +0000 (18:24 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 2 Jul 2008 17:24:35 +0000 (18:24 +0100)
Create a dummy CPU during PV machine initialization. This avoids NULL
pointer accesses.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
hw/xen_machine_pv.c
i386-dm/helper2.c

index 0fec0aaeb63f1e939c00c2cab7ef66bf8cd43446..e51addb3023132ee570eaf54c2fe94e2541ba7f0 100644 (file)
@@ -45,13 +45,16 @@ static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size,
 {
     struct xenfb *xenfb;
     extern int domid;
-
+    CPUState *env;
 
 #ifndef CONFIG_STUBDOM
     /* Initialize tapdisk client */
     init_blktap();
 #endif
 
+    /* Initialize a dummy CPU */
+    env = cpu_init(NULL);
+
     /* Connect to text console */
     if (serial_hds[0]) {
         if (xencons_init(domid, serial_hds[0]) < 0) {
index 44bed2bf72ec107b90a47e08f2b4164b360ee3b5..6437c373d6f217b94207bb5fb61a2bca94452a8c 100644 (file)
@@ -112,6 +112,10 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
         return NULL;
     cpu_exec_init(env);
 
+    /* There is no shared_page for PV, we're done now */
+    if (shared_page == NULL)
+        return env;
+
     /* init various static tables */
     if (!inited) {
         inited = 1;