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