qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hu Tao <hutao@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH] pvpanic: create pvpanic by default for machine 1.5
Date: Tue, 9 Apr 2013 17:06:40 +0800	[thread overview]
Message-ID: <1365498400-30558-1-git-send-email-hutao@cn.fujitsu.com> (raw)
In-Reply-To: <a8f8ee9b0baaea4cc36055d70bd928a9c77392ab.1365143012.git.hutao@cn.fujitsu.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 hw/i386/pc_piix.c | 16 ++++++++++++++--
 hw/i386/pc_q35.c  | 15 ++++++++++++++-
 hw/pc.h           |  3 +++
 hw/pvpanic.c      |  7 +++++++
 4 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0abc9f1..384c95f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -54,6 +54,8 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
+static bool has_pvpanic = true;
+
 /* PC hardware initialisation */
 static void pc_init1(MemoryRegion *system_memory,
                      MemoryRegion *system_io,
@@ -217,6 +219,10 @@ static void pc_init1(MemoryRegion *system_memory,
     if (pci_enabled) {
         pc_pci_device_init(pci_bus);
     }
+
+    if (has_pvpanic) {
+        pvpanic_init(isa_bus);
+    }
 }
 
 static void pc_init_pci(QEMUMachineInitArgs *args)
@@ -234,10 +240,16 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
              initrd_filename, cpu_model, 1, 1);
 }
 
+static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
+{
+    has_pvpanic = false;
+    pc_init_pci(args);
+}
+
 static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
 {
     enable_compat_apic_id_mode();
-    pc_init_pci(args);
+    pc_init_pci_1_4(args);
 }
 
 /* PC machine init function for pc-0.14 to pc-1.2 */
@@ -308,7 +320,7 @@ static QEMUMachine pc_i440fx_machine_v1_5 = {
 static QEMUMachine pc_i440fx_machine_v1_4 = {
     .name = "pc-i440fx-1.4",
     .desc = "Standard PC (i440FX + PIIX, 1996)",
-    .init = pc_init_pci,
+    .init = pc_init_pci_1_4,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_1_4,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 4f5f347..7f9b65f 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -45,6 +45,8 @@
 /* ICH9 AHCI has 6 ports */
 #define MAX_SATA_PORTS     6
 
+static bool has_pvpanic = true;
+
 /* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE)
  *    BIOS will read it and start S3 resume at POST Entry */
 static void pc_cmos_set_s3_resume(void *opaque, int irq, int level)
@@ -207,8 +209,19 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     if (pci_enabled) {
         pc_pci_device_init(host_bus);
     }
+
+    if (has_pvpanic) {
+        pvpanic_init(isa_bus);
+    }
+}
+
+static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
+{
+    has_pvpanic = false;
+    pc_q35_init(args);
 }
 
+
 static QEMUMachine pc_q35_machine_v1_5 = {
     .name = "pc-q35-1.5",
     .alias = "q35",
@@ -221,7 +234,7 @@ static QEMUMachine pc_q35_machine_v1_5 = {
 static QEMUMachine pc_q35_machine_v1_4 = {
     .name = "pc-q35-1.4",
     .desc = "Standard PC (Q35 + ICH9, 2009)",
-    .init = pc_q35_init,
+    .init = pc_q35_init_1_4,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_1_4,
diff --git a/hw/pc.h b/hw/pc.h
index 8e1dd4c..912baf5 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -178,6 +178,9 @@ static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
 /* pc_sysfw.c */
 void pc_system_firmware_init(MemoryRegion *rom_memory);
 
+/* pvpanic.c */
+int pvpanic_init(ISABus *bus);
+
 /* e820 types */
 #define E820_RAM        1
 #define E820_RESERVED   2
diff --git a/hw/pvpanic.c b/hw/pvpanic.c
index b3d10e2..bb30207 100644
--- a/hw/pvpanic.c
+++ b/hw/pvpanic.c
@@ -19,6 +19,7 @@
 #include <sysemu/kvm.h>
 
 #include "hw/fw_cfg.h"
+#include "hw/pc.h"
 
 /* The bit of supported pv event */
 #define PVPANIC_F_PANICKED      0
@@ -100,6 +101,12 @@ static int pvpanic_isa_initfn(ISADevice *dev)
     return 0;
 }
 
+int pvpanic_init(ISABus *bus)
+{
+    isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE);
+    return 0;
+}
+
 static Property pvpanic_isa_properties[] = {
     DEFINE_PROP_UINT16("ioport", PVPanicState, ioport, 0x505),
     DEFINE_PROP_END_OF_LIST(),
-- 
1.8.1.4

  parent reply	other threads:[~2013-04-09  9:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  6:36 [Qemu-devel] [PATCH v17 0/6] Add pvpanic device to deal with guest panic event Hu Tao
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 1/6] add a new runstate: RUN_STATE_GUEST_PANICKED Hu Tao
2013-05-17  6:59   ` Christian Borntraeger
2013-05-17  7:43     ` [Qemu-devel] [PATCH] vl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE Hu Tao
2013-05-17  8:03       ` [Qemu-devel] [PATCH for-1.5] " Paolo Bonzini
2013-05-17  8:22       ` [Qemu-devel] [PATCH] " Christian Borntraeger
2013-05-17  7:50     ` [Qemu-devel] [PATCH v17 1/6] add a new runstate: RUN_STATE_GUEST_PANICKED Markus Armbruster
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 2/6] add a new qevent: QEVENT_GUEST_PANICKED Hu Tao
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 3/6] introduce a new qom device to deal with panicked event Hu Tao
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 4/6] pvpanic: pass configurable ioport to seabios Hu Tao
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 5/6] pvpanic: create pvpanic device by default Hu Tao
2013-04-05 11:14   ` Paolo Bonzini
2013-04-08  2:50     ` Hu Tao
2013-04-09  9:06   ` Hu Tao [this message]
2013-04-09  9:34     ` [Qemu-devel] [PATCH] pvpanic: create pvpanic by default for machine 1.5 Paolo Bonzini
2013-04-05  6:36 ` [Qemu-devel] [PATCH v17 6/6] pvpanic: add document of pvpanic Hu Tao
2013-04-05  7:10 ` [Qemu-devel] [PATCH v17] pvpanic: pvpanic device driver Hu Tao
2013-04-05 11:45   ` Paolo Bonzini
2013-04-30 15:39   ` Paolo Bonzini
2013-04-05  7:17 ` [Qemu-devel] [PATCH v17] Add " Hu Tao
2013-04-30 16:00   ` Paolo Bonzini
2013-05-01  1:07     ` Kevin O'Connor
2013-05-15  7:21   ` [Qemu-devel] [SeaBIOS] " Laszlo Ersek
2013-05-15  7:27     ` Hu Tao
2013-05-15  7:30       ` Hu Tao
2013-05-15  7:36       ` Laszlo Ersek
2013-05-15 16:25       ` Laszlo Ersek
2013-05-15 16:25         ` Paolo Bonzini
2013-05-15 16:34           ` Laszlo Ersek
2013-05-15  7:32   ` [Qemu-devel] " Christian Borntraeger
2013-05-15  7:36     ` Hu Tao
2013-04-05  8:42 ` [Qemu-devel] [PATCH] [RFC] Wire up disabled wait a panicked event on s390 Christian Borntraeger
2013-04-05 13:15   ` Luiz Capitulino

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=1365498400-30558-1-git-send-email-hutao@cn.fujitsu.com \
    --to=hutao@cn.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).