All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	qemu-stable@nongnu.org, imammedo@redhat.com,
	anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH v2 3/3] xen_machine_pv: do not create a dummy CPU in machine->init
Date: Wed, 29 May 2013 12:34:31 +0100	[thread overview]
Message-ID: <1369827271-20921-3-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305291205540.4799@kaball.uk.xensource.com>

This fixes a regression introduced by:

commit 62fc403f11523169eb4264de31279745f48e3ecc
Author: Igor Mammedov <imammedo@redhat.com>
Date:   Mon Apr 29 18:54:13 2013 +0200

    target-i386: Attach ICC bus to CPU on its creation

    X86CPU should have parent bus so it could provide bus for child APIC.

The commit makes it mandatory to pass a valid ICC bus to cpu_x86_create,
but cpu_x86_init just passes NULL to it.
xen_machine_pv uses cpu_x86_init, therefore it has been broken.

This patch fixes the problem by removing the dummy CPU creation
altogether from xen_init_pv, relying on the fact that QEMU can now cope
with a machine without an emulated CPU.

This fix should be backported to QEMU 1.5.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: imammedo@redhat.com
CC: qemu-stable@nongnu.org
---
 hw/i386/xen_machine_pv.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/hw/i386/xen_machine_pv.c b/hw/i386/xen_machine_pv.c
index f829a52..9f2e291 100644
--- a/hw/i386/xen_machine_pv.c
+++ b/hw/i386/xen_machine_pv.c
@@ -23,7 +23,6 @@
  */
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/boards.h"
 #include "hw/xen/xen_backend.h"
 #include "xen_domainbuild.h"
@@ -31,27 +30,12 @@
 
 static void xen_init_pv(QEMUMachineInitArgs *args)
 {
-    const char *cpu_model = args->cpu_model;
     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;
 
-    /* Initialize a dummy CPU */
-    if (cpu_model == NULL) {
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
-    }
-    cpu = cpu_x86_init(cpu_model);
-    cs = CPU(cpu);
-    cs->halted = 1;
-
     /* Initialize backend core & drivers */
     if (xen_be_init() != 0) {
         fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
-- 
1.7.2.5

WARNING: multiple messages have this Message-ID (diff)
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	qemu-stable@nongnu.org, imammedo@redhat.com,
	anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [PATCH v2 3/3] xen_machine_pv: do not create a dummy CPU in machine->init
Date: Wed, 29 May 2013 12:34:31 +0100	[thread overview]
Message-ID: <1369827271-20921-3-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305291205540.4799@kaball.uk.xensource.com>

This fixes a regression introduced by:

commit 62fc403f11523169eb4264de31279745f48e3ecc
Author: Igor Mammedov <imammedo@redhat.com>
Date:   Mon Apr 29 18:54:13 2013 +0200

    target-i386: Attach ICC bus to CPU on its creation

    X86CPU should have parent bus so it could provide bus for child APIC.

The commit makes it mandatory to pass a valid ICC bus to cpu_x86_create,
but cpu_x86_init just passes NULL to it.
xen_machine_pv uses cpu_x86_init, therefore it has been broken.

This patch fixes the problem by removing the dummy CPU creation
altogether from xen_init_pv, relying on the fact that QEMU can now cope
with a machine without an emulated CPU.

This fix should be backported to QEMU 1.5.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: imammedo@redhat.com
CC: qemu-stable@nongnu.org
---
 hw/i386/xen_machine_pv.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/hw/i386/xen_machine_pv.c b/hw/i386/xen_machine_pv.c
index f829a52..9f2e291 100644
--- a/hw/i386/xen_machine_pv.c
+++ b/hw/i386/xen_machine_pv.c
@@ -23,7 +23,6 @@
  */
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/boards.h"
 #include "hw/xen/xen_backend.h"
 #include "xen_domainbuild.h"
@@ -31,27 +30,12 @@
 
 static void xen_init_pv(QEMUMachineInitArgs *args)
 {
-    const char *cpu_model = args->cpu_model;
     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;
 
-    /* Initialize a dummy CPU */
-    if (cpu_model == NULL) {
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
-    }
-    cpu = cpu_x86_init(cpu_model);
-    cs = CPU(cpu);
-    cs->halted = 1;
-
     /* Initialize backend core & drivers */
     if (xen_be_init() != 0) {
         fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
-- 
1.7.2.5

  parent reply	other threads:[~2013-05-29 11:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 11:18 [Qemu-devel] [PATCH v2 0/3] Xen related fixes Stefano Stabellini
2013-05-29 11:18 ` Stefano Stabellini
2013-05-29 11:34 ` [Qemu-devel] [PATCH v2 1/3] xen: simplify xen_enabled Stefano Stabellini
2013-05-29 11:34   ` Stefano Stabellini
2013-05-29 11:34 ` [Qemu-devel] [PATCH v2 2/3] main_loop: do not set nonblocking if xen_enabled() Stefano Stabellini
2013-05-29 11:34   ` Stefano Stabellini
2013-05-29 11:34 ` Stefano Stabellini [this message]
2013-05-29 11:34   ` [PATCH v2 3/3] xen_machine_pv: do not create a dummy CPU in machine->init Stefano Stabellini
2013-05-29 12:11   ` [Qemu-devel] " Andreas Färber
2013-05-29 12:11     ` Andreas Färber
2013-05-29 12:29     ` [Qemu-devel] " Paolo Bonzini
2013-05-29 12:29       ` Paolo Bonzini
2013-05-29 13:09       ` [Qemu-devel] " Stefano Stabellini
2013-05-29 13:09         ` Stefano Stabellini
2013-05-29 14:35       ` [Qemu-devel] " Igor Mammedov
2013-05-29 14:35         ` Igor Mammedov
2013-05-31 10:57 ` [Qemu-devel] [PATCH v2 0/3] Xen related fixes Stefano Stabellini
2013-05-31 10:57   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369827271-20921-3-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.