febaa2
From 4ff7102cb75e8501c6657ccef0f7009e1c18cb5f Mon Sep 17 00:00:00 2001
22c213
From: Miroslav Rezanina <mrezanin@redhat.com>
22c213
Date: Fri, 11 Jan 2019 09:54:45 +0100
22c213
Subject: Machine type related general changes
22c213
22c213
This patch is first part of original "Add RHEL machine types" patch we
22c213
split to allow easier review. It contains changes not related to any
22c213
architecture.
22c213
22c213
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
22c213
22c213
Rebase changes (4.0.0):
22c213
- Remove e1000 device duplication changes to reflect upstream solution
22c213
- Rewrite machine compat properties to upstream solution
22c213
22c213
Rebase changes (4.1.0):
22c213
- Removed optional flag for machine compat properties (upstream)
22c213
- Remove c3e002cb chunk from hw/net/e1000.c
22c213
- Reorder compat structures
22c213
- Use one format for compat scructures
22c213
- Added compat for virtio-balloon-pci.any_layout for rhel71
22c213
febaa2
Rebase changes (weekly-210303):
febaa2
- Added rhel 8.4.0 compat based on 5.2 compat
febaa2
22c213
Merged patches (4.0.0):
22c213
- d4c0957 compat: Generic HW_COMPAT_RHEL7_6
22c213
- cbac773 virtio: Make disable-legacy/disable-modern compat properties optional
22c213
22c213
Merged patches (4.1.0):
22c213
- 479ad30 redhat: fix cut'n'paste garbage in hw_compat comments
22c213
- f19738e compat: Generic hw_compat_rhel_8_0
22c213
22c213
Merged patches (4.2.0):
22c213
- 9f2bfaa machine types: Update hw_compat_rhel_8_0 from hw_compat_4_0
22c213
- ca4a5e8 virtio: Make disable-legacy/disable-modern compat properties optional
22c213
- compat: Generic hw_compat_rhel_8_1 (patch 93040/92956)
22c213
febaa2
Merged patches (5.1.0):
febaa2
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
febaa2
- 8f9f4d8 compat: disable 'edid' for virtio-gpu-ccw
febaa2
febaa2
Merged patches (5.2.0 rc0):
febaa2
- 8348642 redhat: define hw_compat_8_2
febaa2
- 45b8402 redhat: define hw_compat_8_2
febaa2
- 4effa71 redhat: Update hw_compat_8_2
febaa2
- 0e84dff virtio: skip legacy support check on machine types less than 5.1 (partialy)
febaa2
febaa2
Merged patches (6.0.0):
febaa2
- fa0063ba67 redhat: Define hw_compat_8_3
febaa2
- d98e328c8d usb/hcd-xhci-pci: Fixup capabilities ordering (again)
febaa2
- b8a2578117 virtio: move 'use-disabled-flag' property to hw_compat_4_2
febaa2
- f7940b04c8 virtio-pci: compat page aligned ATS
febaa2
febaa2
Merged patches (weekly-210602):
febaa2
- 26f25108c1 redhat: add missing entries in hw_compat_rhel_8_4
febaa2
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
febaa2
 hw/acpi/ich9.c               |  15 +++
febaa2
 hw/acpi/piix4.c              |   5 +-
febaa2
 hw/arm/virt.c                |   2 +-
febaa2
 hw/char/serial.c             |  16 +++
febaa2
 hw/core/machine.c            | 255 +++++++++++++++++++++++++++++++++++
febaa2
 hw/display/vga-isa.c         |   2 +-
febaa2
 hw/i386/pc_piix.c            |   2 +
febaa2
 hw/i386/pc_q35.c             |   2 +
febaa2
 hw/net/e1000e.c              |  22 +++
febaa2
 hw/net/rtl8139.c             |   4 +-
febaa2
 hw/rtc/mc146818rtc.c         |   6 +
febaa2
 hw/smbios/smbios.c           |  46 ++++++-
febaa2
 hw/timer/i8254_common.c      |   2 +-
febaa2
 hw/usb/hcd-uhci.c            |   4 +-
febaa2
 hw/usb/hcd-xhci-pci.c        |  59 ++++++--
febaa2
 hw/usb/hcd-xhci-pci.h        |   1 +
febaa2
 hw/usb/hcd-xhci.c            |  20 +++
febaa2
 hw/usb/hcd-xhci.h            |   2 +
febaa2
 include/hw/acpi/ich9.h       |   3 +
febaa2
 include/hw/boards.h          |  33 +++++
febaa2
 include/hw/firmware/smbios.h |   5 +-
febaa2
 include/hw/i386/pc.h         |   3 +
febaa2
 include/hw/usb.h             |   3 +
febaa2
 migration/migration.c        |   2 +
febaa2
 migration/migration.h        |   5 +
febaa2
 25 files changed, 494 insertions(+), 25 deletions(-)
22c213
22c213
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
febaa2
index 802501881f..147b5d9815 100644
22c213
--- a/hw/acpi/ich9.c
22c213
+++ b/hw/acpi/ich9.c
febaa2
@@ -419,6 +419,18 @@ static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, Error **errp)
febaa2
     s->pm.use_acpi_hotplug_bridge = value;
22c213
 }
22c213
 
22c213
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
22c213
+{
22c213
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
22c213
+    return s->pm.force_rev1_fadt;
22c213
+}
22c213
+
22c213
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
22c213
+{
22c213
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
22c213
+    s->pm.force_rev1_fadt = value;
22c213
+}
22c213
+
febaa2
 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
22c213
 {
22c213
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
febaa2
@@ -442,6 +454,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
febaa2
     object_property_add_bool(obj, "cpu-hotplug-legacy",
22c213
                              ich9_pm_get_cpu_hotplug_legacy,
febaa2
                              ich9_pm_set_cpu_hotplug_legacy);
22c213
+    object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
22c213
+                             ich9_pm_get_force_rev1_fadt,
febaa2
+                             ich9_pm_set_force_rev1_fadt);
febaa2
     object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED,
febaa2
                                   &pm->disable_s3, OBJ_PROP_FLAG_READWRITE);
febaa2
     object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
22c213
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
febaa2
index 48f7a1edbc..af21cb4ac3 100644
22c213
--- a/hw/acpi/piix4.c
22c213
+++ b/hw/acpi/piix4.c
febaa2
@@ -279,6 +279,7 @@ static const VMStateDescription vmstate_acpi = {
22c213
     .name = "piix4_pm",
22c213
     .version_id = 3,
22c213
     .minimum_version_id = 3,
22c213
+    .minimum_version_id = 2,
22c213
     .post_load = vmstate_acpi_post_load,
22c213
     .fields = (VMStateField[]) {
22c213
         VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
febaa2
@@ -644,8 +645,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
22c213
 
22c213
 static Property piix4_pm_properties[] = {
22c213
     DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
22c213
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
22c213
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
22c213
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
22c213
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
22c213
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
22c213
     DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
febaa2
                      use_acpi_hotplug_bridge, true),
febaa2
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
febaa2
index 81eda46b0b..cd1a2d985d 100644
febaa2
--- a/hw/arm/virt.c
febaa2
+++ b/hw/arm/virt.c
febaa2
@@ -1524,7 +1524,7 @@ static void virt_build_smbios(VirtMachineState *vms)
febaa2
 
febaa2
     smbios_set_defaults("QEMU", product,
febaa2
                         vmc->smbios_old_sys_ver ? "1.0" : mc->name, false,
febaa2
-                        true, SMBIOS_ENTRY_POINT_30);
febaa2
+                        true, NULL, NULL, SMBIOS_ENTRY_POINT_30);
febaa2
 
febaa2
     smbios_get_tables(MACHINE(vms), NULL, 0,
febaa2
                       &smbios_tables, &smbios_tables_len,
22c213
diff --git a/hw/char/serial.c b/hw/char/serial.c
febaa2
index 7061aacbce..fe8d0afbb0 100644
22c213
--- a/hw/char/serial.c
22c213
+++ b/hw/char/serial.c
febaa2
@@ -37,6 +37,7 @@
22c213
 #include "trace.h"
febaa2
 #include "hw/qdev-properties.h"
febaa2
 #include "hw/qdev-properties-system.h"
22c213
+#include "migration/migration.h"
22c213
 
febaa2
 #define UART_LCR_DLAB	0x80	/* Divisor latch access bit */
22c213
 
febaa2
@@ -689,6 +690,9 @@ static int serial_post_load(void *opaque, int version_id)
22c213
 static bool serial_thr_ipending_needed(void *opaque)
22c213
 {
22c213
     SerialState *s = opaque;
22c213
+    if (migrate_pre_2_2) {
22c213
+        return false;
22c213
+    }
22c213
 
22c213
     if (s->ier & UART_IER_THRI) {
22c213
         bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
febaa2
@@ -770,6 +774,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
22c213
 static bool serial_fifo_timeout_timer_needed(void *opaque)
22c213
 {
22c213
     SerialState *s = (SerialState *)opaque;
22c213
+    if (migrate_pre_2_2) {
22c213
+        return false;
22c213
+    }
22c213
+
22c213
     return timer_pending(s->fifo_timeout_timer);
22c213
 }
22c213
 
febaa2
@@ -787,6 +795,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
22c213
 static bool serial_timeout_ipending_needed(void *opaque)
22c213
 {
22c213
     SerialState *s = (SerialState *)opaque;
22c213
+    if (migrate_pre_2_2) {
22c213
+        return false;
22c213
+    }
22c213
+
22c213
     return s->timeout_ipending != 0;
22c213
 }
22c213
 
febaa2
@@ -804,6 +816,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
22c213
 static bool serial_poll_needed(void *opaque)
22c213
 {
22c213
     SerialState *s = (SerialState *)opaque;
22c213
+    if (migrate_pre_2_2) {
22c213
+        return false;
22c213
+    }
22c213
+
22c213
     return s->poll_msl >= 0;
22c213
 }
22c213
 
22c213
diff --git a/hw/core/machine.c b/hw/core/machine.c
febaa2
index 54e040587d..c7ddca1778 100644
22c213
--- a/hw/core/machine.c
22c213
+++ b/hw/core/machine.c
febaa2
@@ -37,6 +37,261 @@
febaa2
 #include "hw/virtio/virtio.h"
febaa2
 #include "hw/virtio/virtio-pci.h"
22c213
 
22c213
+/*
febaa2
+ * Mostly the same as hw_compat_5_2
febaa2
+ */
febaa2
+GlobalProperty hw_compat_rhel_8_4[] = {
febaa2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
febaa2
+    { "ICH9-LPC", "smm-compat", "on"},
febaa2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
febaa2
+    { "PIIX4_PM", "smm-compat", "on"},
febaa2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
febaa2
+    { "virtio-blk-device", "report-discard-granularity", "off" },
febaa2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
febaa2
+    { "virtio-net-pci", "vectors", "3"},
febaa2
+};
febaa2
+const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4);
febaa2
+
febaa2
+/*
febaa2
+ * Mostly the same as hw_compat_5_1
febaa2
+ */
febaa2
+GlobalProperty hw_compat_rhel_8_3[] = {
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "vhost-scsi", "num_queues", "1"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "vhost-user-blk", "num-queues", "1"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "vhost-user-scsi", "num_queues", "1"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "virtio-blk-device", "num-queues", "1"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "virtio-scsi-device", "num_queues", "1"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "nvme", "use-intel-id", "on"},
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */
febaa2
+    /* hw_compat_rhel_8_3 bz 1912846 */
febaa2
+    { "pci-xhci", "x-rh-late-msi-cap", "off" },
febaa2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
febaa2
+    { "virtio-pci", "x-ats-page-aligned", "off"},
febaa2
+};
febaa2
+const size_t hw_compat_rhel_8_3_len = G_N_ELEMENTS(hw_compat_rhel_8_3);
febaa2
+
febaa2
+/*
febaa2
+ * The same as hw_compat_4_2 + hw_compat_5_0
febaa2
+ */
febaa2
+GlobalProperty hw_compat_rhel_8_2[] = {
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-blk-device", "queue-size", "128"},
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-scsi-device", "virtqueue_size", "128"},
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-blk-device", "seg-max-adjust", "off"},
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-scsi-device", "seg_max_adjust", "off"},
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "vhost-blk-device", "seg_max_adjust", "off"},
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "usb-host", "suppress-remote-wake", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "usb-redir", "suppress-remote-wake", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "qxl", "revision", "4" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "qxl-vga", "revision", "4" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "fw_cfg", "acpi-mr-restore", "false" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
febaa2
+    { "virtio-device", "use-disabled-flag", "false" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "virtio-balloon-device", "page-poison", "false" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "vmport", "x-read-set-eax", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "vmport", "x-signal-unsupported-cmd", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "vmport", "x-report-vmx-type", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "vmport", "x-cmds-v2", "off" },
febaa2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
febaa2
+    { "virtio-device", "x-disable-legacy-check", "true" },
febaa2
+};
febaa2
+const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
febaa2
+
febaa2
+/*
22c213
+ * The same as hw_compat_4_1
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_8_1[] = {
22c213
+    /* hw_compat_rhel_8_1 from hw_compat_4_1 */
22c213
+    { "virtio-pci", "x-pcie-flr-init", "off" },
22c213
+};
22c213
+const size_t hw_compat_rhel_8_1_len = G_N_ELEMENTS(hw_compat_rhel_8_1);
22c213
+
22c213
+/* The same as hw_compat_3_1
22c213
+ * format of array has been changed by:
22c213
+ *     6c36bddf5340 ("machine: Use shorter format for GlobalProperty arrays")
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_8_0[] = {
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "pcie-root-port", "x-speed", "2_5" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "pcie-root-port", "x-width", "1" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "true" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "tpm-crb", "ppi", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "tpm-tis", "ppi", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "usb-kbd", "serial", "42" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "usb-mouse", "serial", "42" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "usb-tablet", "serial", "42" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "virtio-blk-device", "discard", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
22c213
+    { "virtio-blk-device", "write-zeroes", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
22c213
+    { "VGA",            "edid", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
22c213
+    { "secondary-vga",  "edid", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
22c213
+    { "bochs-display",  "edid", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
22c213
+    { "virtio-vga",     "edid", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
febaa2
+    { "virtio-gpu-device", "edid", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
22c213
+    { "virtio-device", "use-started", "false" },
22c213
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 - that was added in 4.1 */
22c213
+    { "pcie-root-port-base", "disable-acs", "true" },
22c213
+};
22c213
+const size_t hw_compat_rhel_8_0_len = G_N_ELEMENTS(hw_compat_rhel_8_0);
22c213
+
22c213
+/* The same as hw_compat_3_0 + hw_compat_2_12
22c213
+ * except that
22c213
+ *   there's nothing in 3_0
22c213
+ *   migration.decompress-error-check=off was in 7.5 from bz 1584139
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_7_6[] = {
22c213
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
22c213
+    { "hda-audio", "use-timer", "false" },
22c213
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
22c213
+    { "cirrus-vga", "global-vmstate", "true" },
22c213
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
22c213
+    { "VGA", "global-vmstate", "true" },
22c213
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
22c213
+    { "vmware-svga", "global-vmstate", "true" },
22c213
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
22c213
+    { "qxl-vga", "global-vmstate",  "true" },
22c213
+};
22c213
+const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6);
22c213
+
22c213
+/* The same as hw_compat_2_11 + hw_compat_2_10 */
22c213
+GlobalProperty hw_compat_rhel_7_5[] = {
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_11 */
22c213
+    { "hpet", "hpet-offset-saved", "false" },
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_11 */
22c213
+    { "virtio-blk-pci", "vectors", "2" },
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_11 */
22c213
+    { "vhost-user-blk-pci", "vectors", "2" },
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_11
22c213
+       bz 1608778 modified for our naming */
22c213
+    { "e1000-82540em", "migrate_tso_props", "off" },
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_10 */
22c213
+    { "virtio-mouse-device", "wheel-axis", "false" },
22c213
+    /* hw_compat_rhel_7_5 from hw_compat_2_10 */
22c213
+    { "virtio-tablet-device", "wheel-axis", "false" },
22c213
+    { "cirrus-vga", "vgamem_mb", "16" },
22c213
+    { "migration", "decompress-error-check", "off" },
22c213
+};
22c213
+const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5);
22c213
+
22c213
+/* Mostly like hw_compat_2_9 except
22c213
+ * x-mtu-bypass-backend, x-migrate-msix has already been
22c213
+ * backported to RHEL7.4. shpc was already on in 7.4.
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_7_4[] = {
22c213
+    { "intel-iommu", "pt", "off" },
22c213
+};
22c213
+
22c213
+const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4);
22c213
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
22c213
+ * disable-modern, disable-legacy, page-per-vq have already been
22c213
+ * backported to RHEL7.3
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_7_3[] = {
22c213
+    { "virtio-mmio", "format_transport_address", "off" },
22c213
+    { "virtio-serial-device", "emergency-write", "off" },
22c213
+    { "ioapic", "version", "0x11" },
22c213
+    { "intel-iommu", "x-buggy-eim", "true" },
22c213
+    { "virtio-pci", "x-ignore-backend-features", "on" },
22c213
+    { "fw_cfg_mem", "x-file-slots", stringify(0x10) },
22c213
+    { "fw_cfg_io", "x-file-slots", stringify(0x10) },
22c213
+    { "pflash_cfi01", "old-multiple-chip-handling", "on" },
22c213
+    { TYPE_PCI_DEVICE, "x-pcie-extcap-init", "off" },
22c213
+    { "virtio-pci", "x-pcie-deverr-init", "off" },
22c213
+    { "virtio-pci", "x-pcie-lnkctl-init", "off" },
22c213
+    { "virtio-pci", "x-pcie-pm-init", "off" },
22c213
+    { "virtio-net-device", "x-mtu-bypass-backend", "off" },
22c213
+    { "e1000e", "__redhat_e1000e_7_3_intr_state", "on" },
22c213
+};
22c213
+const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3);
22c213
+
22c213
+/* Mostly like hw_compat_2_4 + 2_3 but:
22c213
+ *  we don't need "any_layout" as it has been backported to 7.2
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_7_2[] = {
22c213
+        { "virtio-blk-device", "scsi", "true" },
22c213
+        { "e1000-82540em", "extra_mac_registers", "off" },
22c213
+        { "virtio-pci", "x-disable-pcie", "on" },
22c213
+        { "virtio-pci", "migrate-extra", "off" },
22c213
+        { "fw_cfg_mem", "dma_enabled", "off" },
22c213
+        { "fw_cfg_io", "dma_enabled", "off" },
22c213
+        { "isa-fdc", "fallback", "144" },
22c213
+        /* Optional because not all virtio-pci devices support legacy mode */
22c213
+        { "virtio-pci", "disable-modern", "on", .optional = true },
22c213
+        { "virtio-pci", "disable-legacy", "off", .optional = true },
22c213
+        { TYPE_PCI_DEVICE, "x-pcie-lnksta-dllla", "off" },
22c213
+        { "virtio-pci", "page-per-vq", "on" },
22c213
+        /* hw_compat_rhel_7_2 - introduced with 2.10.0 */
22c213
+        { "migration", "send-section-footer", "off" },
22c213
+        /* hw_compat_rhel_7_2 - introduced with 2.10.0 */
22c213
+        { "migration", "store-global-state", "off",
22c213
+        },
22c213
+};
22c213
+const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2);
22c213
+
22c213
+/* Mostly like hw_compat_2_1 but:
22c213
+ *    we don't need virtio-scsi-pci since 7.0 already had that on
22c213
+ *
22c213
+ * RH: Note, qemu-extended-regs should have been enabled in the 7.1
22c213
+ * machine type, but was accidentally turned off in 7.2 onwards.
22c213
+ */
22c213
+GlobalProperty hw_compat_rhel_7_1[] = {
22c213
+    { "intel-hda-generic", "old_msi_addr", "on" },
22c213
+    { "VGA", "qemu-extended-regs", "off" },
22c213
+    { "secondary-vga", "qemu-extended-regs", "off" },
22c213
+    { "usb-mouse", "usb_version", stringify(1) },
22c213
+    { "usb-kbd", "usb_version", stringify(1) },
22c213
+    { "virtio-pci",  "virtio-pci-bus-master-bug-migration", "on" },
22c213
+    { "virtio-blk-pci", "any_layout", "off" },
22c213
+    { "virtio-balloon-pci", "any_layout", "off" },
22c213
+    { "virtio-serial-pci", "any_layout", "off" },
22c213
+    { "virtio-9p-pci", "any_layout", "off" },
22c213
+    { "virtio-rng-pci", "any_layout", "off" },
22c213
+    /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */
22c213
+    { "migration", "send-configuration", "off" },
22c213
+};
22c213
+const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1);
22c213
+
febaa2
 GlobalProperty hw_compat_6_0[] = {
febaa2
     { "gpex-pcihost", "allow-unmapped-accesses", "false" },
febaa2
     { "i8042", "extended-state", "false"},
22c213
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
febaa2
index 90851e730b..a91c5d7467 100644
22c213
--- a/hw/display/vga-isa.c
22c213
+++ b/hw/display/vga-isa.c
febaa2
@@ -85,7 +85,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
22c213
 }
22c213
 
22c213
 static Property vga_isa_properties[] = {
22c213
-    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
22c213
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
22c213
     DEFINE_PROP_END_OF_LIST(),
22c213
 };
22c213
 
febaa2
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
febaa2
index 30b8bd6ea9..eebb4f3141 100644
febaa2
--- a/hw/i386/pc_piix.c
febaa2
+++ b/hw/i386/pc_piix.c
febaa2
@@ -177,6 +177,8 @@ static void pc_init1(MachineState *machine,
febaa2
         smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
febaa2
                             mc->name, pcmc->smbios_legacy_mode,
febaa2
                             pcmc->smbios_uuid_encoded,
febaa2
+                            pcmc->smbios_stream_product,
febaa2
+                            pcmc->smbios_stream_version,
febaa2
                             SMBIOS_ENTRY_POINT_21);
febaa2
     }
febaa2
 
febaa2
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
febaa2
index 04b4a4788d..e7724fd02c 100644
febaa2
--- a/hw/i386/pc_q35.c
febaa2
+++ b/hw/i386/pc_q35.c
febaa2
@@ -199,6 +199,8 @@ static void pc_q35_init(MachineState *machine)
febaa2
         smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
febaa2
                             mc->name, pcmc->smbios_legacy_mode,
febaa2
                             pcmc->smbios_uuid_encoded,
febaa2
+                            pcmc->smbios_stream_product,
febaa2
+                            pcmc->smbios_stream_version,
febaa2
                             SMBIOS_ENTRY_POINT_21);
febaa2
     }
febaa2
 
22c213
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
febaa2
index ac96f7665a..d35bc1f0b0 100644
22c213
--- a/hw/net/e1000e.c
22c213
+++ b/hw/net/e1000e.c
febaa2
@@ -81,6 +81,12 @@ struct E1000EState {
22c213
 
22c213
     E1000ECore core;
febaa2
     bool init_vet;
febaa2
+
22c213
+    /* 7.3 had the intr_state field that was in the original e1000e code
22c213
+     * but that was removed prior to 2.7's release
22c213
+     */
22c213
+    bool redhat_7_3_intr_state_enable;
22c213
+    uint32_t redhat_7_3_intr_state;
febaa2
 };
22c213
 
22c213
 #define E1000E_MMIO_IDX     0
febaa2
@@ -96,6 +102,10 @@ struct E1000EState {
22c213
 #define E1000E_MSIX_TABLE   (0x0000)
22c213
 #define E1000E_MSIX_PBA     (0x2000)
22c213
 
22c213
+/* Values as in RHEL 7.3 build and original upstream */
22c213
+#define RH_E1000E_USE_MSI     BIT(0)
22c213
+#define RH_E1000E_USE_MSIX    BIT(1)
22c213
+
22c213
 static uint64_t
22c213
 e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
22c213
 {
febaa2
@@ -307,6 +317,8 @@ e1000e_init_msix(E1000EState *s)
22c213
     } else {
22c213
         if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
22c213
             msix_uninit(d, &s->msix, &s->msix);
22c213
+        } else {
22c213
+            s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX;
22c213
         }
22c213
     }
22c213
 }
febaa2
@@ -478,6 +490,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
22c213
     ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
22c213
     if (ret) {
22c213
         trace_e1000e_msi_init_fail(ret);
22c213
+    } else {
22c213
+        s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI;
22c213
     }
22c213
 
22c213
     if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
febaa2
@@ -605,6 +619,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
22c213
     VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0,                           \
22c213
                          e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
22c213
 
22c213
+static bool rhel_7_3_check(void *opaque, int version_id)
22c213
+{
22c213
+    return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable;
22c213
+}
22c213
+
22c213
 static const VMStateDescription e1000e_vmstate = {
22c213
     .name = "e1000e",
22c213
     .version_id = 1,
febaa2
@@ -616,6 +635,7 @@ static const VMStateDescription e1000e_vmstate = {
22c213
         VMSTATE_MSIX(parent_obj, E1000EState),
22c213
 
22c213
         VMSTATE_UINT32(ioaddr, E1000EState),
22c213
+        VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check),
22c213
         VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
22c213
         VMSTATE_UINT8(core.rx_desc_len, E1000EState),
22c213
         VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
febaa2
@@ -664,6 +684,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
22c213
 
22c213
 static Property e1000e_properties[] = {
22c213
     DEFINE_NIC_PROPERTIES(E1000EState, conf),
22c213
+    DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState,
22c213
+                        redhat_7_3_intr_state_enable, false),
22c213
     DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false,
22c213
                         e1000e_prop_disable_vnet, bool),
22c213
     DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
22c213
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
febaa2
index 90b4fc63ce..3ffb9dd22c 100644
22c213
--- a/hw/net/rtl8139.c
22c213
+++ b/hw/net/rtl8139.c
febaa2
@@ -3179,7 +3179,7 @@ static int rtl8139_pre_save(void *opaque)
22c213
 
22c213
 static const VMStateDescription vmstate_rtl8139 = {
22c213
     .name = "rtl8139",
22c213
-    .version_id = 5,
22c213
+    .version_id = 4,
22c213
     .minimum_version_id = 3,
22c213
     .post_load = rtl8139_post_load,
22c213
     .pre_save  = rtl8139_pre_save,
febaa2
@@ -3260,7 +3260,9 @@ static const VMStateDescription vmstate_rtl8139 = {
22c213
         VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
22c213
         VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
22c213
         VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
22c213
+#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */
22c213
         VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5),
22c213
+#endif
22c213
         VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State),
22c213
         VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
22c213
 
22c213
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
febaa2
index 4fbafddb22..2f120c6e70 100644
22c213
--- a/hw/rtc/mc146818rtc.c
22c213
+++ b/hw/rtc/mc146818rtc.c
febaa2
@@ -43,6 +43,7 @@
febaa2
 #include "qapi/qapi-events-misc-target.h"
22c213
 #include "qapi/visitor.h"
22c213
 #include "hw/rtc/mc146818rtc_regs.h"
22c213
+#include "migration/migration.h"
22c213
 
22c213
 #ifdef TARGET_I386
22c213
 #include "qapi/qapi-commands-misc-target.h"
febaa2
@@ -821,6 +822,11 @@ static int rtc_post_load(void *opaque, int version_id)
22c213
 static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
22c213
 {
22c213
     RTCState *s = (RTCState *)opaque;
22c213
+
22c213
+    if (migrate_pre_2_2) {
22c213
+        return false;
22c213
+    }
22c213
+
22c213
     return s->irq_reinject_on_ack_count != 0;
22c213
 }
22c213
 
22c213
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
febaa2
index 7397e56737..3a4bb894ba 100644
22c213
--- a/hw/smbios/smbios.c
22c213
+++ b/hw/smbios/smbios.c
febaa2
@@ -57,6 +57,9 @@ static bool smbios_legacy = true;
febaa2
 static bool smbios_uuid_encoded = true;
febaa2
 /* end: legacy structures & constants for <= 2.0 machines */
febaa2
 
febaa2
+/* Set to true for modern Windows 10 HardwareID-6 compat */
febaa2
+static bool smbios_type2_required;
febaa2
+
febaa2
 
febaa2
 uint8_t *smbios_tables;
febaa2
 size_t smbios_tables_len;
febaa2
@@ -619,7 +622,7 @@ static void smbios_build_type_1_table(void)
febaa2
 
febaa2
 static void smbios_build_type_2_table(void)
febaa2
 {
febaa2
-    SMBIOS_BUILD_TABLE_PRE(2, 0x200, false); /* optional */
febaa2
+    SMBIOS_BUILD_TABLE_PRE(2, 0x200, smbios_type2_required);
febaa2
 
febaa2
     SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer);
febaa2
     SMBIOS_TABLE_SET_STR(2, product_str, type2.product);
febaa2
@@ -888,7 +891,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features)
febaa2
 
febaa2
 void smbios_set_defaults(const char *manufacturer, const char *product,
febaa2
                          const char *version, bool legacy_mode,
febaa2
-                         bool uuid_encoded, SmbiosEntryPointType ep_type)
febaa2
+                         bool uuid_encoded,
febaa2
+                         const char *stream_product,
febaa2
+                         const char *stream_version,
febaa2
+                         SmbiosEntryPointType ep_type)
febaa2
 {
febaa2
     smbios_have_defaults = true;
febaa2
     smbios_legacy = legacy_mode;
febaa2
@@ -909,11 +915,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
febaa2
         g_free(smbios_entries);
febaa2
     }
febaa2
 
febaa2
+    /*
febaa2
+     * If @stream_product & @stream_version are non-NULL, then
febaa2
+     * we're following rules for new Windows driver support.
febaa2
+     * The data we have to report is defined in this doc:
febaa2
+     *
febaa2
+     * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer
febaa2
+     *
febaa2
+     * The Windows drivers are written to expect use of the
febaa2
+     * scheme documented as "HardwareID-6" against Windows 10,
febaa2
+     * which uses SMBIOS System (Type 1) and Base Board (Type 2)
febaa2
+     * tables and will match on
febaa2
+     *
febaa2
+     *   System Manufacturer = Red Hat     (@manufacturer)
febaa2
+     *   System SKU Number = 8.2.0         (@stream_version)
febaa2
+     *   Baseboard Manufacturer = Red Hat  (@manufacturer)
febaa2
+     *   Baseboard Product = RHEL-AV       (@stream_product)
febaa2
+     *
febaa2
+     * NB, SKU must be changed with each RHEL-AV release
febaa2
+     *
febaa2
+     * Other fields can be freely used by applications using
febaa2
+     * QEMU. For example apps can use the "System product"
febaa2
+     * and "System version" to identify themselves.
febaa2
+     *
febaa2
+     * We get 'System Manufacturer' and 'Baseboard Manufacturer'
febaa2
+     */
22c213
     SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer);
22c213
     SMBIOS_SET_DEFAULT(type1.product, product);
22c213
     SMBIOS_SET_DEFAULT(type1.version, version);
22c213
+    SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux");
febaa2
+    if (stream_version != NULL) {
febaa2
+        SMBIOS_SET_DEFAULT(type1.sku, stream_version);
febaa2
+    }
22c213
     SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer);
febaa2
-    SMBIOS_SET_DEFAULT(type2.product, product);
febaa2
+    if (stream_product != NULL) {
febaa2
+        SMBIOS_SET_DEFAULT(type2.product, stream_product);
febaa2
+        smbios_type2_required = true;
febaa2
+    } else {
febaa2
+        SMBIOS_SET_DEFAULT(type2.product, product);
febaa2
+    }
22c213
     SMBIOS_SET_DEFAULT(type2.version, version);
febaa2
     SMBIOS_SET_DEFAULT(type3.manufacturer, manufacturer);
febaa2
     SMBIOS_SET_DEFAULT(type3.version, version);
22c213
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
22c213
index 050875b497..32935da46c 100644
22c213
--- a/hw/timer/i8254_common.c
22c213
+++ b/hw/timer/i8254_common.c
22c213
@@ -231,7 +231,7 @@ static const VMStateDescription vmstate_pit_common = {
22c213
     .pre_save = pit_dispatch_pre_save,
22c213
     .post_load = pit_dispatch_post_load,
22c213
     .fields = (VMStateField[]) {
22c213
-        VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
22c213
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
22c213
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
22c213
                              vmstate_pit_channel, PITChannelState),
22c213
         VMSTATE_INT64(channels[0].next_transition_time,
22c213
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
febaa2
index 0cb02a6432..962a9622e5 100644
22c213
--- a/hw/usb/hcd-uhci.c
22c213
+++ b/hw/usb/hcd-uhci.c
febaa2
@@ -1167,12 +1167,14 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
22c213
     UHCIState *s = UHCI(dev);
22c213
     uint8_t *pci_conf = s->dev.config;
22c213
     int i;
22c213
+    int irq_pin;
22c213
 
22c213
     pci_conf[PCI_CLASS_PROG] = 0x00;
22c213
     /* TODO: reset value should be 0. */
22c213
     pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
22c213
 
22c213
-    pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
22c213
+    irq_pin = u->info.irq_pin;
22c213
+    pci_config_set_interrupt_pin(pci_conf, irq_pin + 1);
22c213
 
22c213
     if (s->masterbus) {
22c213
         USBPort *ports[NB_PORTS];
febaa2
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
febaa2
index e934b1a5b1..e18b05e528 100644
febaa2
--- a/hw/usb/hcd-xhci-pci.c
febaa2
+++ b/hw/usb/hcd-xhci-pci.c
febaa2
@@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id)
febaa2
    return 0;
febaa2
 }
febaa2
 
febaa2
+/* RH bz 1912846 */
febaa2
+static bool usb_xhci_pci_add_msi(struct PCIDevice *dev, Error **errp)
febaa2
+{
febaa2
+    int ret;
febaa2
+    Error *err = NULL;
febaa2
+    XHCIPciState *s = XHCI_PCI(dev);
febaa2
+
febaa2
+    ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err;;
febaa2
+    /*
febaa2
+     * Any error other than -ENOTSUP(board's MSI support is broken)
febaa2
+     * is a programming error
febaa2
+     */
febaa2
+    assert(!ret || ret == -ENOTSUP);
febaa2
+    if (ret && s->msi == ON_OFF_AUTO_ON) {
febaa2
+        /* Can't satisfy user's explicit msi=on request, fail */
febaa2
+        error_append_hint(&err, "You have to use msi=auto (default) or "
febaa2
+                "msi=off with this machine type.\n");
febaa2
+        error_propagate(errp, err);
febaa2
+        return true;
febaa2
+    }
febaa2
+    assert(!err || s->msi == ON_OFF_AUTO_AUTO);
febaa2
+    /* With msi=auto, we fall back to MSI off silently */
febaa2
+    error_free(err);
febaa2
+
febaa2
+    return false;
febaa2
+}
febaa2
+
febaa2
 static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
febaa2
 {
febaa2
     int ret;
febaa2
@@ -125,23 +152,12 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
febaa2
         s->xhci.nec_quirks = true;
febaa2
     }
febaa2
 
febaa2
-    if (s->msi != ON_OFF_AUTO_OFF) {
febaa2
-        ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err;;
febaa2
-        /*
febaa2
-         * Any error other than -ENOTSUP(board's MSI support is broken)
febaa2
-         * is a programming error
febaa2
-         */
febaa2
-        assert(!ret || ret == -ENOTSUP);
febaa2
-        if (ret && s->msi == ON_OFF_AUTO_ON) {
febaa2
-            /* Can't satisfy user's explicit msi=on request, fail */
febaa2
-            error_append_hint(&err, "You have to use msi=auto (default) or "
febaa2
-                    "msi=off with this machine type.\n");
febaa2
+    if (s->msi != ON_OFF_AUTO_OFF && s->rh_late_msi_cap) {
febaa2
+        /* This gives the behaviour from 5.2.0 onwards, lspci shows 90,a0,70 */
febaa2
+        if (usb_xhci_pci_add_msi(dev, &err)) {
febaa2
             error_propagate(errp, err);
febaa2
             return;
febaa2
         }
febaa2
-        assert(!err || s->msi == ON_OFF_AUTO_AUTO);
febaa2
-        /* With msi=auto, we fall back to MSI off silently */
febaa2
-        error_free(err);
febaa2
     }
febaa2
     pci_register_bar(dev, 0,
febaa2
                      PCI_BASE_ADDRESS_SPACE_MEMORY |
febaa2
@@ -154,6 +170,14 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
febaa2
         assert(ret > 0);
febaa2
     }
febaa2
 
febaa2
+    /* RH bz 1912846 */
febaa2
+    if (s->msi != ON_OFF_AUTO_OFF && !s->rh_late_msi_cap) {
febaa2
+        /* This gives the older RH machine behaviour, lspci shows 90,70,a0 */
febaa2
+        if (usb_xhci_pci_add_msi(dev, &err)) {
febaa2
+            error_propagate(errp, err);
febaa2
+            return;
febaa2
+        }
febaa2
+    }
febaa2
     if (s->msix != ON_OFF_AUTO_OFF) {
febaa2
         /* TODO check for errors, and should fail when msix=on */
febaa2
         msix_init(dev, s->xhci.numintrs,
febaa2
@@ -198,11 +222,18 @@ static void xhci_instance_init(Object *obj)
febaa2
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
febaa2
 }
febaa2
 
febaa2
+static Property xhci_pci_properties[] = {
febaa2
+    /* RH bz 1912846 */
febaa2
+    DEFINE_PROP_BOOL("x-rh-late-msi-cap", XHCIPciState, rh_late_msi_cap, true),
febaa2
+    DEFINE_PROP_END_OF_LIST()
febaa2
+};
febaa2
+
febaa2
 static void xhci_class_init(ObjectClass *klass, void *data)
febaa2
 {
febaa2
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
febaa2
     DeviceClass *dc = DEVICE_CLASS(klass);
febaa2
 
febaa2
+    device_class_set_props(dc, xhci_pci_properties);
febaa2
     dc->reset   = xhci_pci_reset;
febaa2
     dc->vmsd    = &vmstate_xhci_pci;
febaa2
     set_bit(DEVICE_CATEGORY_USB, dc->categories);
febaa2
diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h
febaa2
index c193f79443..086a1feb1e 100644
febaa2
--- a/hw/usb/hcd-xhci-pci.h
febaa2
+++ b/hw/usb/hcd-xhci-pci.h
febaa2
@@ -39,6 +39,7 @@ typedef struct XHCIPciState {
febaa2
     XHCIState xhci;
febaa2
     OnOffAuto msi;
febaa2
     OnOffAuto msix;
febaa2
+    bool      rh_late_msi_cap;  /* bz 1912846 */
febaa2
 } XHCIPciState;
febaa2
 
febaa2
 #endif
22c213
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
febaa2
index e01700039b..d5ea13356c 100644
22c213
--- a/hw/usb/hcd-xhci.c
22c213
+++ b/hw/usb/hcd-xhci.c
febaa2
@@ -3494,9 +3494,27 @@ static const VMStateDescription vmstate_xhci_slot = {
22c213
     }
22c213
 };
22c213
 
22c213
+static int xhci_event_pre_save(void *opaque)
22c213
+{
22c213
+    XHCIEvent *s = opaque;
22c213
+
22c213
+    s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
22c213
+    s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
22c213
+
22c213
+    return 0;
22c213
+}
22c213
+
22c213
+bool migrate_cve_2014_5263_xhci_fields;
22c213
+
22c213
+static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
22c213
+{
22c213
+    return migrate_cve_2014_5263_xhci_fields;
22c213
+}
22c213
+
22c213
 static const VMStateDescription vmstate_xhci_event = {
22c213
     .name = "xhci-event",
22c213
     .version_id = 1,
22c213
+    .pre_save = xhci_event_pre_save,
22c213
     .fields = (VMStateField[]) {
22c213
         VMSTATE_UINT32(type,   XHCIEvent),
22c213
         VMSTATE_UINT32(ccode,  XHCIEvent),
febaa2
@@ -3505,6 +3523,8 @@ static const VMStateDescription vmstate_xhci_event = {
22c213
         VMSTATE_UINT32(flags,  XHCIEvent),
22c213
         VMSTATE_UINT8(slotid,  XHCIEvent),
22c213
         VMSTATE_UINT8(epid,    XHCIEvent),
22c213
+        VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
22c213
+        VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
22c213
         VMSTATE_END_OF_LIST()
22c213
     }
22c213
 };
22c213
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
febaa2
index 98f598382a..50a7b6f6c4 100644
22c213
--- a/hw/usb/hcd-xhci.h
22c213
+++ b/hw/usb/hcd-xhci.h
febaa2
@@ -149,6 +149,8 @@ typedef struct XHCIEvent {
22c213
     uint32_t flags;
22c213
     uint8_t slotid;
22c213
     uint8_t epid;
22c213
+    uint8_t cve_2014_5263_a;
22c213
+    uint8_t cve_2014_5263_b;
22c213
 } XHCIEvent;
22c213
 
22c213
 typedef struct XHCIInterrupter {
22c213
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
febaa2
index a329ce43ab..6aa02f2d8f 100644
22c213
--- a/include/hw/acpi/ich9.h
22c213
+++ b/include/hw/acpi/ich9.h
febaa2
@@ -67,6 +67,9 @@ typedef struct ICH9LPCPMRegs {
febaa2
     bool smm_compat;
22c213
     bool enable_tco;
22c213
     TCOIORegs tco_regs;
22c213
+
22c213
+    /* RH addition, see bz 1489800 */
22c213
+    bool force_rev1_fadt;
22c213
 } ICH9LPCPMRegs;
22c213
 
22c213
 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
22c213
diff --git a/include/hw/boards.h b/include/hw/boards.h
febaa2
index accd6eff35..ff4674474f 100644
22c213
--- a/include/hw/boards.h
22c213
+++ b/include/hw/boards.h
febaa2
@@ -416,4 +416,37 @@ extern const size_t hw_compat_2_2_len;
22c213
 extern GlobalProperty hw_compat_2_1[];
22c213
 extern const size_t hw_compat_2_1_len;
22c213
 
febaa2
+extern GlobalProperty hw_compat_rhel_8_4[];
febaa2
+extern const size_t hw_compat_rhel_8_4_len;
febaa2
+
febaa2
+extern GlobalProperty hw_compat_rhel_8_3[];
febaa2
+extern const size_t hw_compat_rhel_8_3_len;
febaa2
+
febaa2
+extern GlobalProperty hw_compat_rhel_8_2[];
febaa2
+extern const size_t hw_compat_rhel_8_2_len;
febaa2
+
22c213
+extern GlobalProperty hw_compat_rhel_8_1[];
22c213
+extern const size_t hw_compat_rhel_8_1_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_8_0[];
22c213
+extern const size_t hw_compat_rhel_8_0_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_6[];
22c213
+extern const size_t hw_compat_rhel_7_6_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_5[];
22c213
+extern const size_t hw_compat_rhel_7_5_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_4[];
22c213
+extern const size_t hw_compat_rhel_7_4_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_3[];
22c213
+extern const size_t hw_compat_rhel_7_3_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_2[];
22c213
+extern const size_t hw_compat_rhel_7_2_len;
22c213
+
22c213
+extern GlobalProperty hw_compat_rhel_7_1[];
22c213
+extern const size_t hw_compat_rhel_7_1_len;
22c213
+
22c213
 #endif
febaa2
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
febaa2
index 5a0dd0c8cf..2cb1ec2bab 100644
febaa2
--- a/include/hw/firmware/smbios.h
febaa2
+++ b/include/hw/firmware/smbios.h
febaa2
@@ -278,7 +278,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp);
febaa2
 void smbios_set_cpuid(uint32_t version, uint32_t features);
febaa2
 void smbios_set_defaults(const char *manufacturer, const char *product,
febaa2
                          const char *version, bool legacy_mode,
febaa2
-                         bool uuid_encoded, SmbiosEntryPointType ep_type);
febaa2
+                         bool uuid_encoded,
febaa2
+                         const char *stream_product,
febaa2
+                         const char *stream_version,
febaa2
+                         SmbiosEntryPointType ep_type);
febaa2
 uint8_t *smbios_get_table_legacy(MachineState *ms, size_t *length);
febaa2
 void smbios_get_tables(MachineState *ms,
febaa2
                        const struct smbios_phys_mem_area *mem_array,
febaa2
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
febaa2
index 88dffe7517..17ad7bfc3a 100644
febaa2
--- a/include/hw/i386/pc.h
febaa2
+++ b/include/hw/i386/pc.h
febaa2
@@ -107,6 +107,9 @@ struct PCMachineClass {
febaa2
     bool smbios_defaults;
febaa2
     bool smbios_legacy_mode;
febaa2
     bool smbios_uuid_encoded;
febaa2
+    /* New fields needed for Windows HardwareID-6 matching */
febaa2
+    const char *smbios_stream_product;
febaa2
+    const char *smbios_stream_version;
febaa2
 
febaa2
     /* RAM / address space compat: */
febaa2
     bool gigabyte_align;
22c213
diff --git a/include/hw/usb.h b/include/hw/usb.h
febaa2
index 33668dd0a9..e6b2fe72da 100644
22c213
--- a/include/hw/usb.h
22c213
+++ b/include/hw/usb.h
febaa2
@@ -582,4 +582,7 @@ void usb_pcap_init(FILE *fp);
febaa2
 void usb_pcap_ctrl(USBPacket *p, bool setup);
febaa2
 void usb_pcap_data(USBPacket *p, bool setup);
22c213
 
22c213
+/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
22c213
+extern bool migrate_cve_2014_5263_xhci_fields;
22c213
+
22c213
 #endif
22c213
diff --git a/migration/migration.c b/migration/migration.c
febaa2
index 041b8451a6..dc5f2df00a 100644
22c213
--- a/migration/migration.c
22c213
+++ b/migration/migration.c
febaa2
@@ -164,6 +164,8 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot,
febaa2
     MIGRATION_CAPABILITY_X_COLO,
febaa2
     MIGRATION_CAPABILITY_VALIDATE_UUID);
22c213
 
22c213
+bool migrate_pre_2_2;
22c213
+
22c213
 /* When we add fault tolerance, we could have several
22c213
    migrations at once.  For now we don't need to add
22c213
    dynamic creation of migration */
22c213
diff --git a/migration/migration.h b/migration/migration.h
febaa2
index 7a5aa8c2fd..e06778f3a4 100644
22c213
--- a/migration/migration.h
22c213
+++ b/migration/migration.h
febaa2
@@ -381,6 +381,11 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm,
22c213
 void migrate_add_address(SocketAddress *address);
22c213
 
22c213
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
22c213
+/*
22c213
+ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards
22c213
+ * migration compatibility.
22c213
+ */
22c213
+extern bool migrate_pre_2_2;
22c213
 
22c213
 #define qemu_ram_foreach_block \
22c213
   #warning "Use foreach_not_ignored_block in migration code"
22c213
-- 
febaa2
2.31.1
22c213