a83cc2
From b64f8848efe610c52791587ec41301b73ec9165a Mon Sep 17 00:00:00 2001
a83cc2
From: Juan Quintela <quintela@redhat.com>
a83cc2
Date: Tue, 3 Aug 2021 11:53:07 +0200
a83cc2
Subject: [PATCH 07/39] Remove RHEL 7.4.0 machine types
a83cc2
a83cc2
RH-Author: quintela1 <quintela@redhat.com>
a83cc2
RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types
a83cc2
RH-Commit: [5/6] a1940ac35591cebff52379f85656caf6a03328dd (juan.quintela/qemu-kvm)
a83cc2
RH-Bugzilla: 1968519
a83cc2
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
a83cc2
RH-Acked-by: Thomas Huth <thuth@redhat.com>
a83cc2
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
a83cc2
Revert pc_rom_ro hack.
a83cc2
Remove force_rev1_fadt hack, it is not needed anymore.
a83cc2
a83cc2
Signed-off-by: Juan Quintela <quintela@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 hw/acpi/ich9.c         | 15 ---------------
a83cc2
 hw/core/machine.c      |  9 ---------
a83cc2
 hw/i386/acpi-build.c   |  3 ---
a83cc2
 hw/i386/pc.c           | 18 +-----------------
a83cc2
 hw/i386/pc_piix.c      | 19 -------------------
a83cc2
 hw/i386/pc_q35.c       | 18 ------------------
a83cc2
 hw/ppc/spapr.c         | 43 ------------------------------------------
a83cc2
 include/hw/acpi/ich9.h |  3 ---
a83cc2
 include/hw/boards.h    |  3 ---
a83cc2
 include/hw/i386/pc.h   |  6 ------
a83cc2
 10 files changed, 1 insertion(+), 136 deletions(-)
a83cc2
a83cc2
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
a83cc2
index 33b0c6e33c..7f01fad64c 100644
a83cc2
--- a/hw/acpi/ich9.c
a83cc2
+++ b/hw/acpi/ich9.c
a83cc2
@@ -369,18 +369,6 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
a83cc2
     s->pm.enable_tco = value;
a83cc2
 }
a83cc2
 
a83cc2
-static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
a83cc2
-{
a83cc2
-    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
a83cc2
-    return s->pm.force_rev1_fadt;
a83cc2
-}
a83cc2
-
a83cc2
-static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
a83cc2
-{
a83cc2
-    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
a83cc2
-    s->pm.force_rev1_fadt = value;
a83cc2
-}
a83cc2
-
a83cc2
 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
a83cc2
 {
a83cc2
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
a83cc2
@@ -403,9 +391,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
a83cc2
     object_property_add_bool(obj, "cpu-hotplug-legacy",
a83cc2
                              ich9_pm_get_cpu_hotplug_legacy,
a83cc2
                              ich9_pm_set_cpu_hotplug_legacy);
a83cc2
-    object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
a83cc2
-                             ich9_pm_get_force_rev1_fadt,
a83cc2
-                             ich9_pm_set_force_rev1_fadt);
a83cc2
     object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED,
a83cc2
                                   &pm->disable_s3, OBJ_PROP_FLAG_READWRITE);
a83cc2
     object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
a83cc2
diff --git a/hw/core/machine.c b/hw/core/machine.c
a83cc2
index 0bcaabd8a9..6dc2651d73 100644
a83cc2
--- a/hw/core/machine.c
a83cc2
+++ b/hw/core/machine.c
a83cc2
@@ -215,15 +215,6 @@ GlobalProperty hw_compat_rhel_7_5[] = {
a83cc2
 };
a83cc2
 const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5);
a83cc2
 
a83cc2
-/* Mostly like hw_compat_2_9 except
a83cc2
- * x-mtu-bypass-backend, x-migrate-msix has already been
a83cc2
- * backported to RHEL7.4. shpc was already on in 7.4.
a83cc2
- */
a83cc2
-GlobalProperty hw_compat_rhel_7_4[] = {
a83cc2
-    { "intel-iommu", "pt", "off" },
a83cc2
-};
a83cc2
-
a83cc2
-const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4);
a83cc2
 GlobalProperty hw_compat_5_2[] = {
a83cc2
     { "ICH9-LPC", "smm-compat", "on"},
a83cc2
     { "PIIX4_PM", "smm-compat", "on"},
a83cc2
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
a83cc2
index 7bd67f7877..de98750aef 100644
a83cc2
--- a/hw/i386/acpi-build.c
a83cc2
+++ b/hw/i386/acpi-build.c
a83cc2
@@ -231,9 +231,6 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
a83cc2
         pm->fadt.reset_reg = r;
a83cc2
         pm->fadt.reset_val = 0xf;
a83cc2
         pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
a83cc2
-        if (object_property_get_bool(lpc,
a83cc2
-                                     "__com.redhat_force-rev1-fadt", NULL))
a83cc2
-            pm->fadt.rev = 1;
a83cc2
         pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
a83cc2
         pm->smi_on_cpuhp =
a83cc2
             !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT));
a83cc2
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
a83cc2
index 75abe0acc2..6b39abce02 100644
a83cc2
--- a/hw/i386/pc.c
a83cc2
+++ b/hw/i386/pc.c
a83cc2
@@ -477,20 +477,6 @@ GlobalProperty pc_rhel_7_5_compat[] = {
a83cc2
 };
a83cc2
 const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat);
a83cc2
 
a83cc2
-GlobalProperty pc_rhel_7_4_compat[] = {
a83cc2
-    /* pc_rhel_7_4_compat from pc_compat_2_9 */ 
a83cc2
-    { "mch", "extended-tseg-mbytes", stringify(0) },
a83cc2
-    /* bz 1489800 */ 
a83cc2
-    { "ICH9-LPC", "__com.redhat_force-rev1-fadt", "on" },
a83cc2
-    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
a83cc2
-    { "i440FX-pcihost", "x-pci-hole64-fix", "off" },
a83cc2
-    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
a83cc2
-    { "q35-pcihost", "x-pci-hole64-fix", "off" },
a83cc2
-    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
a83cc2
-    { TYPE_X86_CPU, "x-hv-max-vps", "0x40" },
a83cc2
-};
a83cc2
-const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat);
a83cc2
-
a83cc2
 /*
a83cc2
  * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
a83cc2
  * types as the PC_COMPAT_* do for upstream types.
a83cc2
@@ -1094,8 +1080,7 @@ void pc_memory_init(PCMachineState *pcms,
a83cc2
     option_rom_mr = g_malloc(sizeof(*option_rom_mr));
a83cc2
     memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
a83cc2
                            &error_fatal);
a83cc2
-    /* RH difference: See bz 1489800, explicitly make ROM ro */
a83cc2
-    if (pcmc->pc_rom_ro) {
a83cc2
+    if (pcmc->pci_enabled) {
a83cc2
         memory_region_set_readonly(option_rom_mr, true);
a83cc2
     }
a83cc2
     memory_region_add_subregion_overlap(rom_memory,
a83cc2
@@ -1845,7 +1830,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
a83cc2
     pcmc->pvh_enabled = true;
a83cc2
     pcmc->kvmclock_create_always = true;
a83cc2
     assert(!mc->get_hotplug_handler);
a83cc2
-    pcmc->pc_rom_ro = true;
a83cc2
     mc->async_pf_vmexit_disable = false;
a83cc2
     mc->get_hotplug_handler = pc_get_hotplug_handler;
a83cc2
     mc->hotplug_allowed = pc_hotplug_allowed;
a83cc2
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
a83cc2
index 64662cc3d5..fe2ac7593a 100644
a83cc2
--- a/hw/i386/pc_piix.c
a83cc2
+++ b/hw/i386/pc_piix.c
a83cc2
@@ -1011,22 +1011,3 @@ static void pc_machine_rhel750_options(MachineClass *m)
a83cc2
 
a83cc2
 DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
a83cc2
                   pc_machine_rhel750_options);
a83cc2
-
a83cc2
-static void pc_init_rhel740(MachineState *machine)
a83cc2
-{
a83cc2
-    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
a83cc2
-             TYPE_I440FX_PCI_DEVICE);
a83cc2
-}
a83cc2
-
a83cc2
-static void pc_machine_rhel740_options(MachineClass *m)
a83cc2
-{
a83cc2
-    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
a83cc2
-    pc_machine_rhel750_options(m);
a83cc2
-    m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
a83cc2
-    pcmc->pc_rom_ro = false;
a83cc2
-    compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
a83cc2
-    compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
a83cc2
-}
a83cc2
-
a83cc2
-DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
a83cc2
-                  pc_machine_rhel740_options);
a83cc2
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
a83cc2
index bf49a943dc..9958ed9184 100644
a83cc2
--- a/hw/i386/pc_q35.c
a83cc2
+++ b/hw/i386/pc_q35.c
a83cc2
@@ -774,21 +774,3 @@ static void pc_q35_machine_rhel750_options(MachineClass *m)
a83cc2
 
a83cc2
 DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
a83cc2
                   pc_q35_machine_rhel750_options);
a83cc2
-
a83cc2
-static void pc_q35_init_rhel740(MachineState *machine)
a83cc2
-{
a83cc2
-    pc_q35_init(machine);
a83cc2
-}
a83cc2
-
a83cc2
-static void pc_q35_machine_rhel740_options(MachineClass *m)
a83cc2
-{
a83cc2
-    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
a83cc2
-    pc_q35_machine_rhel750_options(m);
a83cc2
-    m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
a83cc2
-    pcmc->pc_rom_ro = false;
a83cc2
-    compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
a83cc2
-    compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
a83cc2
-}
a83cc2
-
a83cc2
-DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
a83cc2
-                  pc_q35_machine_rhel740_options);
a83cc2
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
a83cc2
index ca0b99403e..bdabbf8b81 100644
a83cc2
--- a/hw/ppc/spapr.c
a83cc2
+++ b/hw/ppc/spapr.c
a83cc2
@@ -5308,49 +5308,6 @@ static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc)
a83cc2
 }
a83cc2
 
a83cc2
 DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false);
a83cc2
-
a83cc2
-/*
a83cc2
- * pseries-rhel7.4.0
a83cc2
- * like spapr_compat_2_9
a83cc2
- */
a83cc2
-GlobalProperty spapr_compat_rhel7_4[] = {
a83cc2
-    { TYPE_POWERPC_CPU, "pre-2.10-migration", "on" },
a83cc2
-};
a83cc2
-const size_t spapr_compat_rhel7_4_len = G_N_ELEMENTS(spapr_compat_rhel7_4);
a83cc2
-
a83cc2
-static void spapr_machine_rhel740_class_options(MachineClass *mc)
a83cc2
-{
a83cc2
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
a83cc2
-
a83cc2
-    spapr_machine_rhel750_class_options(mc);
a83cc2
-    compat_props_add(mc->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
a83cc2
-    compat_props_add(mc->compat_props, spapr_compat_rhel7_4, spapr_compat_rhel7_4_len);
a83cc2
-    smc->has_power9_support = false;
a83cc2
-    smc->pre_2_10_has_unused_icps = true;
a83cc2
-    smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
a83cc2
-    smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
a83cc2
-}
a83cc2
-
a83cc2
-DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false);
a83cc2
-
a83cc2
-/*
a83cc2
- * pseries-rhel7.4.0-sxxm
a83cc2
- *
a83cc2
- * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default
a83cc2
- */
a83cc2
-
a83cc2
-static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc)
a83cc2
-{
a83cc2
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
a83cc2
-
a83cc2
-    spapr_machine_rhel740_class_options(mc);
a83cc2
-    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
a83cc2
-    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
a83cc2
-    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
a83cc2
-}
a83cc2
-
a83cc2
-DEFINE_SPAPR_MACHINE(rhel740sxxm, "rhel7.4.0-sxxm", false);
a83cc2
-
a83cc2
 static void spapr_machine_register_types(void)
a83cc2
 {
a83cc2
     type_register_static(&spapr_machine_info);
a83cc2
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
a83cc2
index e1ecfbaf1f..df519e40b5 100644
a83cc2
--- a/include/hw/acpi/ich9.h
a83cc2
+++ b/include/hw/acpi/ich9.h
a83cc2
@@ -62,9 +62,6 @@ typedef struct ICH9LPCPMRegs {
a83cc2
     bool smm_compat;
a83cc2
     bool enable_tco;
a83cc2
     TCOIORegs tco_regs;
a83cc2
-
a83cc2
-    /* RH addition, see bz 1489800 */
a83cc2
-    bool force_rev1_fadt;
a83cc2
 } ICH9LPCPMRegs;
a83cc2
 
a83cc2
 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
a83cc2
diff --git a/include/hw/boards.h b/include/hw/boards.h
a83cc2
index 24d4d726d8..f27170b6fb 100644
a83cc2
--- a/include/hw/boards.h
a83cc2
+++ b/include/hw/boards.h
a83cc2
@@ -436,7 +436,4 @@ extern const size_t hw_compat_rhel_7_6_len;
a83cc2
 extern GlobalProperty hw_compat_rhel_7_5[];
a83cc2
 extern const size_t hw_compat_rhel_7_5_len;
a83cc2
 
a83cc2
-extern GlobalProperty hw_compat_rhel_7_4[];
a83cc2
-extern const size_t hw_compat_rhel_7_4_len;
a83cc2
-
a83cc2
 #endif
a83cc2
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
a83cc2
index 820fb3f577..ff93dfb372 100644
a83cc2
--- a/include/hw/i386/pc.h
a83cc2
+++ b/include/hw/i386/pc.h
a83cc2
@@ -128,9 +128,6 @@ struct PCMachineClass {
a83cc2
 
a83cc2
     /* create kvmclock device even when KVM PV features are not exposed */
a83cc2
     bool kvmclock_create_always;
a83cc2
-
a83cc2
-    /* RH only, see bz 1489800 */
a83cc2
-    bool pc_rom_ro;
a83cc2
 };
a83cc2
 
a83cc2
 #define TYPE_PC_MACHINE "generic-pc-machine"
a83cc2
@@ -302,9 +299,6 @@ extern const size_t pc_rhel_7_6_compat_len;
a83cc2
 extern GlobalProperty pc_rhel_7_5_compat[];
a83cc2
 extern const size_t pc_rhel_7_5_compat_len;
a83cc2
 
a83cc2
-extern GlobalProperty pc_rhel_7_4_compat[];
a83cc2
-extern const size_t pc_rhel_7_4_compat_len;
a83cc2
-
a83cc2
 /* Helper for setting model-id for CPU models that changed model-id
a83cc2
  * depending on QEMU versions up to QEMU 2.4.
a83cc2
  */
a83cc2
-- 
a83cc2
2.27.0
a83cc2