a83cc2
From 4fa7a78aa900988816d07034943be384d57117f0 Mon Sep 17 00:00:00 2001
a83cc2
From: Juan Quintela <quintela@redhat.com>
a83cc2
Date: Tue, 3 Aug 2021 10:24:56 +0200
a83cc2
Subject: [PATCH 03/39] Remove RHEL 7.0.0 machine type
a83cc2
a83cc2
RH-Author: quintela1 <quintela@redhat.com>
a83cc2
RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types
a83cc2
RH-Commit: [1/6] f182af372d3c38c3c1960af0d5cd37aba7205848 (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
Everything is used elsewhere except for cve_2014_5263 fields.  Remove those.
a83cc2
a83cc2
Signed-off-by: Juan Quintela <quintela@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 hw/i386/pc.c         | 35 -----------------------------------
a83cc2
 hw/i386/pc_piix.c    | 34 ----------------------------------
a83cc2
 hw/usb/hcd-xhci.c    | 20 --------------------
a83cc2
 hw/usb/hcd-xhci.h    |  2 --
a83cc2
 include/hw/i386/pc.h |  3 ---
a83cc2
 include/hw/usb.h     |  3 ---
a83cc2
 6 files changed, 97 deletions(-)
a83cc2
a83cc2
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
a83cc2
index cdbfa84d2e..516ca50353 100644
a83cc2
--- a/hw/i386/pc.c
a83cc2
+++ b/hw/i386/pc.c
a83cc2
@@ -598,41 +598,6 @@ const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_compat);
a83cc2
  * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
a83cc2
  */
a83cc2
 
a83cc2
-/*
a83cc2
- * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_*
a83cc2
- * between our base and 1.5, less stuff backported to RHEL-7.0
a83cc2
- * (usb-device.msos-desc), less stuff for devices we changed
a83cc2
- * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x,
a83cc2
- * pci-serial-4x) in 7.0.
a83cc2
- */
a83cc2
-GlobalProperty pc_rhel_7_0_compat[] = {
a83cc2
-    { "virtio-scsi-pci", "any_layout", "off" },
a83cc2
-    { "PIIX4_PM", "memory-hotplug-support", "off" },
a83cc2
-    { "apic", "version", stringify(0x11) },
a83cc2
-    { "nec-usb-xhci", "superspeed-ports-first", "off" },
a83cc2
-    { "nec-usb-xhci", "force-pcie-endcap", "on" },
a83cc2
-    { "pci-serial", "prog_if", stringify(0) },
a83cc2
-    { "virtio-net-pci", "guest_announce", "off" },
a83cc2
-    { "ICH9-LPC", "memory-hotplug-support", "off" },
a83cc2
-    { "xio3130-downstream", COMPAT_PROP_PCP, "off" },
a83cc2
-    { "ioh3420", COMPAT_PROP_PCP, "off" },
a83cc2
-    { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" },
a83cc2
-    { "e1000", "mitigation", "off" },
a83cc2
-    { "virtio-net-pci", "ctrl_guest_offloads", "off" },
a83cc2
-    { "Conroe" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Penryn" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Nehalem" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Nehalem-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Westmere" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Westmere-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Opteron_G1" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Opteron_G2" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Opteron_G3" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Opteron_G4" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-    { "Opteron_G5" "-" TYPE_X86_CPU, "x2apic", "on" },
a83cc2
-};
a83cc2
-const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat);
a83cc2
-
a83cc2
 GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
a83cc2
 {
a83cc2
     GSIState *s;
a83cc2
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
a83cc2
index 5d61c9b833..b4e8034671 100644
a83cc2
--- a/hw/i386/pc_piix.c
a83cc2
+++ b/hw/i386/pc_piix.c
a83cc2
@@ -1116,37 +1116,3 @@ static void pc_machine_rhel710_options(MachineClass *m)
a83cc2
 
a83cc2
 DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
a83cc2
                   pc_machine_rhel710_options);
a83cc2
-
a83cc2
-static void pc_compat_rhel700(MachineState *machine)
a83cc2
-{
a83cc2
-    PCMachineState *pcms = PC_MACHINE(machine);
a83cc2
-    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
a83cc2
-
a83cc2
-    pc_compat_rhel710(machine);
a83cc2
-
a83cc2
-    /* Upstream enables it for everyone, we're a little more selective */
a83cc2
-    x86_cpu_change_kvm_default("x2apic", NULL);
a83cc2
-    x86_cpu_change_kvm_default("svm", NULL);
a83cc2
-    pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
a83cc2
-    pcmc->smbios_legacy_mode = true;
a83cc2
-    pcmc->has_reserved_memory = false;
a83cc2
-    migrate_cve_2014_5263_xhci_fields = true;
a83cc2
-}
a83cc2
-
a83cc2
-static void pc_init_rhel700(MachineState *machine)
a83cc2
-{
a83cc2
-    pc_compat_rhel700(machine);
a83cc2
-    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
a83cc2
-             TYPE_I440FX_PCI_DEVICE);
a83cc2
-}
a83cc2
-
a83cc2
-static void pc_machine_rhel700_options(MachineClass *m)
a83cc2
-{
a83cc2
-    pc_machine_rhel710_options(m);
a83cc2
-    m->family = "pc_piix_Y";
a83cc2
-    m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
a83cc2
-    compat_props_add(m->compat_props, pc_rhel_7_0_compat, pc_rhel_7_0_compat_len);
a83cc2
-}
a83cc2
-
a83cc2
-DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
a83cc2
-                  pc_machine_rhel700_options);
a83cc2
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
a83cc2
index 6d1f278aad..46212b1e69 100644
a83cc2
--- a/hw/usb/hcd-xhci.c
a83cc2
+++ b/hw/usb/hcd-xhci.c
a83cc2
@@ -3490,27 +3490,9 @@ static const VMStateDescription vmstate_xhci_slot = {
a83cc2
     }
a83cc2
 };
a83cc2
 
a83cc2
-static int xhci_event_pre_save(void *opaque)
a83cc2
-{
a83cc2
-    XHCIEvent *s = opaque;
a83cc2
-
a83cc2
-    s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
a83cc2
-    s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
a83cc2
-
a83cc2
-    return 0;
a83cc2
-}
a83cc2
-
a83cc2
-bool migrate_cve_2014_5263_xhci_fields;
a83cc2
-
a83cc2
-static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
a83cc2
-{
a83cc2
-    return migrate_cve_2014_5263_xhci_fields;
a83cc2
-}
a83cc2
-
a83cc2
 static const VMStateDescription vmstate_xhci_event = {
a83cc2
     .name = "xhci-event",
a83cc2
     .version_id = 1,
a83cc2
-    .pre_save = xhci_event_pre_save,
a83cc2
     .fields = (VMStateField[]) {
a83cc2
         VMSTATE_UINT32(type,   XHCIEvent),
a83cc2
         VMSTATE_UINT32(ccode,  XHCIEvent),
a83cc2
@@ -3519,8 +3501,6 @@ static const VMStateDescription vmstate_xhci_event = {
a83cc2
         VMSTATE_UINT32(flags,  XHCIEvent),
a83cc2
         VMSTATE_UINT8(slotid,  XHCIEvent),
a83cc2
         VMSTATE_UINT8(epid,    XHCIEvent),
a83cc2
-        VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
a83cc2
-        VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
a83cc2
         VMSTATE_END_OF_LIST()
a83cc2
     }
a83cc2
 };
a83cc2
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
a83cc2
index f450ffd13b..7bba361f3b 100644
a83cc2
--- a/hw/usb/hcd-xhci.h
a83cc2
+++ b/hw/usb/hcd-xhci.h
a83cc2
@@ -149,8 +149,6 @@ typedef struct XHCIEvent {
a83cc2
     uint32_t flags;
a83cc2
     uint8_t slotid;
a83cc2
     uint8_t epid;
a83cc2
-    uint8_t cve_2014_5263_a;
a83cc2
-    uint8_t cve_2014_5263_b;
a83cc2
 } XHCIEvent;
a83cc2
 
a83cc2
 typedef struct XHCIInterrupter {
a83cc2
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
a83cc2
index 1980c93f41..2d17daf71f 100644
a83cc2
--- a/include/hw/i386/pc.h
a83cc2
+++ b/include/hw/i386/pc.h
a83cc2
@@ -314,9 +314,6 @@ extern const size_t pc_rhel_7_2_compat_len;
a83cc2
 extern GlobalProperty pc_rhel_7_1_compat[];
a83cc2
 extern const size_t pc_rhel_7_1_compat_len;
a83cc2
 
a83cc2
-extern GlobalProperty pc_rhel_7_0_compat[];
a83cc2
-extern const size_t pc_rhel_7_0_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
diff --git a/include/hw/usb.h b/include/hw/usb.h
a83cc2
index edb2cd94b6..436e07b304 100644
a83cc2
--- a/include/hw/usb.h
a83cc2
+++ b/include/hw/usb.h
a83cc2
@@ -577,7 +577,4 @@ void usb_pcap_init(FILE *fp);
a83cc2
 void usb_pcap_ctrl(USBPacket *p, bool setup);
a83cc2
 void usb_pcap_data(USBPacket *p, bool setup);
a83cc2
 
a83cc2
-/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
a83cc2
-extern bool migrate_cve_2014_5263_xhci_fields;
a83cc2
-
a83cc2
 #endif
a83cc2
-- 
a83cc2
2.27.0
a83cc2