Blame SOURCES/kvm-hw-misc-don-t-create-pvpanic-device-by-default.patch

218e99
From 45dc4ec297fdb6ba95e7a8c1f3d904fe88b0e282 Mon Sep 17 00:00:00 2001
218e99
From: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
Date: Wed, 6 Nov 2013 16:32:37 +0100
218e99
Subject: [PATCH 78/81] hw/misc: don't create pvpanic device by default
218e99
218e99
RH-Author: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
Message-id: <1383755557-21590-10-git-send-email-marcel.a@redhat.com>
218e99
Patchwork-id: 55554
218e99
O-Subject: [RHEL-7 qemu-kvm PATCH v3 9/9] hw/misc: don't create pvpanic device by default
218e99
Bugzilla: 990601
218e99
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
218e99
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
218e99
218e99
We don't need compatibility with 1.5 so we can simply
218e99
revert the patch creating it by default.
218e99
218e99
This patch:
218e99
 - reverts "pvpanic: create pvpanic by default for machine 1.5"
218e99
 - removes cannot_instantiate_with_device_add_yet flag
218e99
218e99
Closest upstream commit (currently in qemu-devl-list):
218e99
	[Qemu-devel] [PATCH v2 1.7] pc: get rid of builtin pvpanic for "-M pc-1.5"
218e99
218e99
Related upstream commit:
218e99
    commit 7f3e341a008c585deed174eaf1f826c88c67948a
218e99
    Author: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
    Date:   Sun Aug 11 18:10:42 2013 +0300
218e99
218e99
        hw/misc: don't create pvpanic device by default
218e99
218e99
        This patch is based on Hu Tao's:
218e99
        http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
218e99
218e99
        No need to hard-code pvpanic as part of the machine.
218e99
        It can be added with "-device pvpanic" from command line (The next patch).
218e99
        Anyway, for backport compatibility it is still part of 1.5
218e99
        machine.
218e99
218e99
        Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
        Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
218e99
        Message-id: 1376233843-19410-2-git-send-email-marcel.a@redhat.com
218e99
        Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
218e99
218e99
losest upstream patch:
218e99
218e99
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
---
218e99
 hw/i386/pc_piix.c | 12 ------------
218e99
 hw/i386/pc_q35.c  |  6 ------
218e99
 hw/misc/pvpanic.c | 11 -----------
218e99
 3 files changed, 29 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 hw/i386/pc_piix.c |   12 ------------
218e99
 hw/i386/pc_q35.c  |    6 ------
218e99
 hw/misc/pvpanic.c |   11 -----------
218e99
 3 files changed, 0 insertions(+), 29 deletions(-)
218e99
218e99
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
218e99
index 825a5b1..2d8e79f 100644
218e99
--- a/hw/i386/pc_piix.c
218e99
+++ b/hw/i386/pc_piix.c
218e99
@@ -57,7 +57,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
218e99
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
218e99
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
218e99
 
218e99
-static bool has_pvpanic = true;
218e99
 static bool smbios_type1_defaults = true;
218e99
 
218e99
 /* PC hardware initialisation */
218e99
@@ -227,10 +226,6 @@ static void pc_init1(QEMUMachineInitArgs *args,
218e99
     if (pci_enabled) {
218e99
         pc_pci_device_init(pci_bus);
218e99
     }
218e99
-
218e99
-    if (has_pvpanic) {
218e99
-        pvpanic_init(isa_bus);
218e99
-    }
218e99
 }
218e99
 
218e99
 static void pc_init_pci(QEMUMachineInitArgs *args)
218e99
@@ -242,7 +237,6 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
218e99
 
218e99
 static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
218e99
 {
218e99
-    has_pvpanic = false;
218e99
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
218e99
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
218e99
     pc_init_pci(args);
218e99
@@ -251,7 +245,6 @@ static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
218e99
 static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
218e99
 {
218e99
     enable_compat_apic_id_mode();
218e99
-    has_pvpanic = false;
218e99
     pc_init_pci(args);
218e99
 }
218e99
 
218e99
@@ -260,7 +253,6 @@ static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
218e99
 {
218e99
     disable_kvm_pv_eoi();
218e99
     enable_compat_apic_id_mode();
218e99
-    has_pvpanic = false;
218e99
     pc_init_pci(args);
218e99
 }
218e99
 
218e99
@@ -269,14 +261,12 @@ static void pc_init_pci_1_0(QEMUMachineInitArgs *args)
218e99
 {
218e99
     disable_kvm_pv_eoi();
218e99
     enable_compat_apic_id_mode();
218e99
-    has_pvpanic = false;
218e99
     pc_init_pci(args);
218e99
 }
218e99
 
218e99
 /* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */
218e99
 static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
218e99
 {
218e99
-    has_pvpanic = false;
218e99
     disable_kvm_pv_eoi();
218e99
     enable_compat_apic_id_mode();
218e99
     pc_init1(args, get_system_memory(), get_system_io(), 1, 0);
218e99
@@ -284,7 +274,6 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
218e99
 
218e99
 static void pc_init_isa(QEMUMachineInitArgs *args)
218e99
 {
218e99
-    has_pvpanic = false;
218e99
     if (!args->cpu_model) {
218e99
         args->cpu_model = "486";
218e99
     }
218e99
@@ -931,7 +920,6 @@ static QEMUMachine pc_machine_rhel650 = {
218e99
 
218e99
 static void pc_init_rhel640(QEMUMachineInitArgs *args)
218e99
 {
218e99
-    has_pvpanic = false;
218e99
     x86_cpu_compat_set_features(NULL, FEAT_1_EDX, 0, CPUID_SEP);
218e99
     pc_init_rhel650(args);
218e99
 }
218e99
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
218e99
index 64995ac..f308098 100644
218e99
--- a/hw/i386/pc_q35.c
218e99
+++ b/hw/i386/pc_q35.c
218e99
@@ -47,7 +47,6 @@
218e99
 /* ICH9 AHCI has 6 ports */
218e99
 #define MAX_SATA_PORTS     6
218e99
 
218e99
-static bool has_pvpanic = true;
218e99
 static bool smbios_type1_defaults = true;
218e99
 
218e99
 /* PC hardware initialisation */
218e99
@@ -205,17 +204,12 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
218e99
     if (pci_enabled) {
218e99
         pc_pci_device_init(host_bus);
218e99
     }
218e99
-
218e99
-    if (has_pvpanic) {
218e99
-        pvpanic_init(isa_bus);
218e99
-    }
218e99
 }
218e99
 
218e99
 #if 0 /* Disabled for Red Hat Enterprise Linux */
218e99
 
218e99
 static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
218e99
 {
218e99
-    has_pvpanic = false;
218e99
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
218e99
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
218e99
     pc_q35_init(args);
218e99
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
218e99
index 1d3178d..1838bc7 100644
218e99
--- a/hw/misc/pvpanic.c
218e99
+++ b/hw/misc/pvpanic.c
218e99
@@ -19,7 +19,6 @@
218e99
 #include "qemu/log.h"
218e99
 
218e99
 #include "hw/nvram/fw_cfg.h"
218e99
-#include "hw/i386/pc.h"
218e99
 
218e99
 /* The bit of supported pv event */
218e99
 #define PVPANIC_F_PANICKED      0
218e99
@@ -108,11 +107,6 @@ static int pvpanic_isa_initfn(ISADevice *dev)
218e99
     return 0;
218e99
 }
218e99
 
218e99
-void pvpanic_init(ISABus *bus)
218e99
-{
218e99
-    isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE);
218e99
-}
218e99
-
218e99
 static Property pvpanic_isa_properties[] = {
218e99
     DEFINE_PROP_UINT16("ioport", PVPanicState, ioport, 0x505),
218e99
     DEFINE_PROP_END_OF_LIST(),
218e99
@@ -125,11 +119,6 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data)
218e99
 
218e99
     ic->init = pvpanic_isa_initfn;
218e99
     dc->props = pvpanic_isa_properties;
218e99
-    /*
218e99
-     * To be dropped in future backport of commit a5d3f64 "hw/misc:
218e99
-     * make pvpanic known to user":
218e99
-     */
218e99
-    dc->cannot_instantiate_with_device_add_yet = true;
218e99
 }
218e99
 
218e99
 static TypeInfo pvpanic_isa_info = {
218e99
-- 
218e99
1.7.1
218e99