7f1c5b
From 0208f38671b9de4036c0d56142a7f22e5091bae0 Mon Sep 17 00:00:00 2001
a83cc2
From: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
Date: Fri, 11 Jan 2019 09:54:45 +0100
a83cc2
Subject: Machine type related general changes
a83cc2
a83cc2
This patch is first part of original "Add RHEL machine types" patch we
a83cc2
split to allow easier review. It contains changes not related to any
a83cc2
architecture.
a83cc2
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
b697b4
--
29b115
Rebase notes (6.2.0):
b697b4
- Do not duplicate minimal_version_id for piix4_pm
b697b4
- Remove empty line chunks in serial.c
b697b4
- Remove migration.h include in serial.c
b697b4
- Update hw_compat_rhel_8_5 (from MR 66)
77609c
29b115
Rebase notes (7.0.0):
29b115
- Remove downstream changes leftovers in hw/rtc/mc146818rtc.c
29b115
- Remove unnecessary change in hw/usb/hcd-uhci.c
29b115
7f1c5b
Rebase notes (7.1.0 rc0):
7f1c5b
- Moved adding rhel_old_machine_deprecation variable from s390x to general machine types commit
7f1c5b
- Moved adding hw_compat_rhel_8_6 struct from x86_64 to general machine types commit
7f1c5b
77609c
Merged patches (6.1.0):
b697b4
- f2fb42a3c6 redhat: add missing entries in hw_compat_rhel_8_4
b697b4
- 1949ec258e hw/arm/virt: Disable PL011 clock migration through hw_compat_rhel_8_3
77609c
- a3995e2eff Remove RHEL 7.0.0 machine type (only generic changes)
77609c
- ad3190a79b Remove RHEL 7.1.0 machine type (only generic changes)
77609c
- 84bbe15d4e Remove RHEL 7.2.0 machine type (only generic changes)
77609c
- 0215eb3356 Remove RHEL 7.3.0 machine types (only generic changes)
77609c
- af69d1ca6e Remove RHEL 7.4.0 machine types (only generic changes)
77609c
- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only generic changes)
b697b4
29b115
Merged patches (6.2.0):
b697b4
- d687ac13d2 redhat: Define hw_compat_rhel_8_5
29b115
29b115
Merged patches (7.0.0):
29b115
- ef5afcc86d Fix virtio-net-pci* "vectors" compat
29b115
- 168f0d56e3 compat: Update hw_compat_rhel_8_5 with 6.2.0 RC2 changes
7f1c5b
7f1c5b
Merged patches (7.1.0 rc0):
7f1c5b
- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/acpi/piix4.c chunk)
7f1c5b
- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/core/machine.c and include/hw/boards.h chunk)
7f1c5b
7f1c5b
Merged patches (7.2.0 rc0):
7f1c5b
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
a83cc2
---
7f1c5b
 hw/acpi/piix4.c              |   2 +-
a83cc2
 hw/arm/virt.c                |   2 +-
7f1c5b
 hw/core/machine.c            | 222 +++++++++++++++++++++++++++++++++++
a83cc2
 hw/display/vga-isa.c         |   2 +-
a83cc2
 hw/i386/pc_piix.c            |   2 +
a83cc2
 hw/i386/pc_q35.c             |   2 +
a83cc2
 hw/net/rtl8139.c             |   4 +-
7f1c5b
 hw/smbios/smbios.c           |  46 +++++++-
a83cc2
 hw/timer/i8254_common.c      |   2 +-
7f1c5b
 hw/usb/hcd-xhci-pci.c        |  59 +++++++---
a83cc2
 hw/usb/hcd-xhci-pci.h        |   1 +
7f1c5b
 include/hw/boards.h          |  31 +++++
a83cc2
 include/hw/firmware/smbios.h |   5 +-
a83cc2
 include/hw/i386/pc.h         |   3 +
7f1c5b
 14 files changed, 360 insertions(+), 23 deletions(-)
a83cc2
a83cc2
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
7f1c5b
index 0a81f1ad93..dbfb362a8f 100644
a83cc2
--- a/hw/acpi/piix4.c
a83cc2
+++ b/hw/acpi/piix4.c
7f1c5b
@@ -248,7 +248,7 @@ static bool vmstate_test_migrate_acpi_index(void *opaque, int version_id)
b697b4
 static const VMStateDescription vmstate_acpi = {
a83cc2
     .name = "piix4_pm",
a83cc2
     .version_id = 3,
b697b4
-    .minimum_version_id = 3,
a83cc2
+    .minimum_version_id = 2,
a83cc2
     .post_load = vmstate_acpi_post_load,
a83cc2
     .fields = (VMStateField[]) {
a83cc2
         VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
a83cc2
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
7f1c5b
index b871350856..d633300fdc 100644
a83cc2
--- a/hw/arm/virt.c
a83cc2
+++ b/hw/arm/virt.c
7f1c5b
@@ -1619,7 +1619,7 @@ static void virt_build_smbios(VirtMachineState *vms)
a83cc2
 
a83cc2
     smbios_set_defaults("QEMU", product,
a83cc2
                         vmc->smbios_old_sys_ver ? "1.0" : mc->name, false,
29b115
-                        true, SMBIOS_ENTRY_POINT_TYPE_64);
29b115
+                        true, NULL, NULL, SMBIOS_ENTRY_POINT_TYPE_64);
a83cc2
 
77609c
     smbios_get_tables(MACHINE(vms), NULL, 0,
77609c
                       &smbios_tables, &smbios_tables_len,
a83cc2
diff --git a/hw/core/machine.c b/hw/core/machine.c
7f1c5b
index 8d34caa31d..9edec1ca05 100644
a83cc2
--- a/hw/core/machine.c
a83cc2
+++ b/hw/core/machine.c
7f1c5b
@@ -40,6 +40,228 @@
a83cc2
 #include "hw/virtio/virtio-pci.h"
7f1c5b
 #include "qom/object_interfaces.h"
a83cc2
 
a83cc2
+/*
7f1c5b
+ * RHEL only: machine types for previous major releases are deprecated
7f1c5b
+ */
7f1c5b
+const char *rhel_old_machine_deprecation =
7f1c5b
+    "machine types for previous major releases are deprecated";
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Mostly the same as hw_compat_7_0
7f1c5b
+ */
7f1c5b
+GlobalProperty hw_compat_rhel_9_1[] = {
7f1c5b
+  /* hw_compat_rhel_9_1 from hw_compat_7_0 */
7f1c5b
+  { "arm-gicv3-common", "force-8-bit-prio", "on" },
7f1c5b
+  /* hw_compat_rhel_9_1 from hw_compat_7_0 */
7f1c5b
+  { "nvme-ns", "eui64-default", "on"},
7f1c5b
+};
7f1c5b
+const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1);
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Mostly the same as hw_compat_6_2
7f1c5b
+ */
7f1c5b
+GlobalProperty hw_compat_rhel_9_0[] = {
7f1c5b
+    /* hw_compat_rhel_9_0 from hw_compat_6_2 */
7f1c5b
+    { "PIIX4_PM", "x-not-migrate-acpi-index", "on"},
7f1c5b
+};
7f1c5b
+const size_t hw_compat_rhel_9_0_len = G_N_ELEMENTS(hw_compat_rhel_9_0);
7f1c5b
+
7f1c5b
+GlobalProperty hw_compat_rhel_8_6[] = {
7f1c5b
+    /* hw_compat_rhel_8_6 bz 2065589 */
7f1c5b
+    /*
7f1c5b
+     * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so
7f1c5b
+     * we need do disable it downstream on the latest hw_compat_rhel_8.
7f1c5b
+     */
7f1c5b
+    { "vhost-vsock-device", "seqpacket", "off" },
7f1c5b
+};
7f1c5b
+const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6);
7f1c5b
+
7f1c5b
+/*
b697b4
+ * Mostly the same as hw_compat_6_0 and hw_compat_6_1
b697b4
+ */
b697b4
+GlobalProperty hw_compat_rhel_8_5[] = {
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "gpex-pcihost", "allow-unmapped-accesses", "false" },
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "i8042", "extended-state", "false"},
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "nvme-ns", "eui64-default", "off"},
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "e1000", "init-vet", "off" },
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "e1000e", "init-vet", "off" },
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_0 */
b697b4
+    { "vhost-vsock-device", "seqpacket", "off" },
b697b4
+    /* hw_compat_rhel_8_5 from hw_compat_6_1 */
b697b4
+    { "vhost-user-vsock-device", "seqpacket", "off" },
29b115
+    /* hw_compat_rhel_8_5 from hw_compat_6_1 */
29b115
+    { "nvme-ns", "shared", "off" },
b697b4
+};
b697b4
+const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5);
b697b4
+
b697b4
+/*
a83cc2
+ * Mostly the same as hw_compat_5_2
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_8_4[] = {
a83cc2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
a83cc2
+    { "ICH9-LPC", "smm-compat", "on"},
a83cc2
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
a83cc2
+    { "PIIX4_PM", "smm-compat", "on"},
77609c
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
77609c
+    { "virtio-blk-device", "report-discard-granularity", "off" },
77609c
+    /* hw_compat_rhel_8_4 from hw_compat_5_2 */
29b115
+    /*
29b115
+     * Upstream incorrectly had "virtio-net-pci" instead of "virtio-net-pci-base",
29b115
+     * (https://bugzilla.redhat.com/show_bug.cgi?id=1999141)
29b115
+     */
29b115
+    { "virtio-net-pci-base", "vectors", "3"},
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4);
a83cc2
+
a83cc2
+/*
a83cc2
+ * Mostly the same as hw_compat_5_1
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_8_3[] = {
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "vhost-scsi", "num_queues", "1"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "vhost-user-blk", "num-queues", "1"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "vhost-user-scsi", "num_queues", "1"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "virtio-blk-device", "num-queues", "1"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "virtio-scsi-device", "num_queues", "1"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "nvme", "use-intel-id", "on"},
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */
77609c
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
77609c
+    { "pl011", "migrate-clk", "off" },
a83cc2
+    /* hw_compat_rhel_8_3 bz 1912846 */
a83cc2
+    { "pci-xhci", "x-rh-late-msi-cap", "off" },
a83cc2
+    /* hw_compat_rhel_8_3 from hw_compat_5_1 */
a83cc2
+    { "virtio-pci", "x-ats-page-aligned", "off"},
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_8_3_len = G_N_ELEMENTS(hw_compat_rhel_8_3);
a83cc2
+
a83cc2
+/*
a83cc2
+ * The same as hw_compat_4_2 + hw_compat_5_0
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_8_2[] = {
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-blk-device", "queue-size", "128"},
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-scsi-device", "virtqueue_size", "128"},
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-blk-device", "seg-max-adjust", "off"},
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-scsi-device", "seg_max_adjust", "off"},
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "vhost-blk-device", "seg_max_adjust", "off"},
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "usb-host", "suppress-remote-wake", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "usb-redir", "suppress-remote-wake", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "qxl", "revision", "4" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "qxl-vga", "revision", "4" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "fw_cfg", "acpi-mr-restore", "false" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_4_2 */
a83cc2
+    { "virtio-device", "use-disabled-flag", "false" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "virtio-balloon-device", "page-poison", "false" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "vmport", "x-read-set-eax", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "vmport", "x-signal-unsupported-cmd", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "vmport", "x-report-vmx-type", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "vmport", "x-cmds-v2", "off" },
a83cc2
+    /* hw_compat_rhel_8_2 from hw_compat_5_0 */
a83cc2
+    { "virtio-device", "x-disable-legacy-check", "true" },
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
a83cc2
+
a83cc2
+/*
a83cc2
+ * The same as hw_compat_4_1
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_8_1[] = {
a83cc2
+    /* hw_compat_rhel_8_1 from hw_compat_4_1 */
a83cc2
+    { "virtio-pci", "x-pcie-flr-init", "off" },
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_8_1_len = G_N_ELEMENTS(hw_compat_rhel_8_1);
a83cc2
+
a83cc2
+/* The same as hw_compat_3_1
a83cc2
+ * format of array has been changed by:
a83cc2
+ *     6c36bddf5340 ("machine: Use shorter format for GlobalProperty arrays")
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_8_0[] = {
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "pcie-root-port", "x-speed", "2_5" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "pcie-root-port", "x-width", "1" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "true" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "tpm-crb", "ppi", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "tpm-tis", "ppi", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "usb-kbd", "serial", "42" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "usb-mouse", "serial", "42" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "usb-tablet", "serial", "42" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "virtio-blk-device", "discard", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 */
a83cc2
+    { "virtio-blk-device", "write-zeroes", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "VGA",            "edid", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "secondary-vga",  "edid", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "bochs-display",  "edid", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "virtio-vga",     "edid", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "virtio-gpu-device", "edid", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_4_0 */
a83cc2
+    { "virtio-device", "use-started", "false" },
a83cc2
+    /* hw_compat_rhel_8_0 from hw_compat_3_1 - that was added in 4.1 */
a83cc2
+    { "pcie-root-port-base", "disable-acs", "true" },
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_8_0_len = G_N_ELEMENTS(hw_compat_rhel_8_0);
a83cc2
+
a83cc2
+/* The same as hw_compat_3_0 + hw_compat_2_12
a83cc2
+ * except that
a83cc2
+ *   there's nothing in 3_0
a83cc2
+ *   migration.decompress-error-check=off was in 7.5 from bz 1584139
a83cc2
+ */
a83cc2
+GlobalProperty hw_compat_rhel_7_6[] = {
a83cc2
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
a83cc2
+    { "hda-audio", "use-timer", "false" },
a83cc2
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
a83cc2
+    { "cirrus-vga", "global-vmstate", "true" },
a83cc2
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
a83cc2
+    { "VGA", "global-vmstate", "true" },
a83cc2
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
a83cc2
+    { "vmware-svga", "global-vmstate", "true" },
a83cc2
+    /* hw_compat_rhel_7_6 from hw_compat_2_12 */
a83cc2
+    { "qxl-vga", "global-vmstate",  "true" },
a83cc2
+};
a83cc2
+const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6);
a83cc2
+
7f1c5b
 GlobalProperty hw_compat_7_1[] = {
7f1c5b
     { "virtio-device", "queue_reset", "false" },
29b115
 };
a83cc2
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
7f1c5b
index 2a5437d803..0db2c2b2a1 100644
a83cc2
--- a/hw/display/vga-isa.c
a83cc2
+++ b/hw/display/vga-isa.c
7f1c5b
@@ -89,7 +89,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
a83cc2
 }
a83cc2
 
a83cc2
 static Property vga_isa_properties[] = {
a83cc2
-    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
a83cc2
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
a83cc2
     DEFINE_PROP_END_OF_LIST(),
a83cc2
 };
a83cc2
 
a83cc2
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
7f1c5b
index 0ad0ed1603..0985ff67d2 100644
a83cc2
--- a/hw/i386/pc_piix.c
a83cc2
+++ b/hw/i386/pc_piix.c
7f1c5b
@@ -187,6 +187,8 @@ static void pc_init1(MachineState *machine,
a83cc2
         smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
a83cc2
                             mc->name, pcmc->smbios_legacy_mode,
a83cc2
                             pcmc->smbios_uuid_encoded,
a83cc2
+                            pcmc->smbios_stream_product,
a83cc2
+                            pcmc->smbios_stream_version,
29b115
                             pcms->smbios_entry_point_type);
a83cc2
     }
a83cc2
 
a83cc2
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
7f1c5b
index a496bd6e74..ea582254e3 100644
a83cc2
--- a/hw/i386/pc_q35.c
a83cc2
+++ b/hw/i386/pc_q35.c
7f1c5b
@@ -201,6 +201,8 @@ static void pc_q35_init(MachineState *machine)
a83cc2
         smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
a83cc2
                             mc->name, pcmc->smbios_legacy_mode,
a83cc2
                             pcmc->smbios_uuid_encoded,
a83cc2
+                            pcmc->smbios_stream_product,
a83cc2
+                            pcmc->smbios_stream_version,
29b115
                             pcms->smbios_entry_point_type);
a83cc2
     }
a83cc2
 
a83cc2
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
7f1c5b
index 700b1b66b6..13693aeb4f 100644
a83cc2
--- a/hw/net/rtl8139.c
a83cc2
+++ b/hw/net/rtl8139.c
7f1c5b
@@ -3178,7 +3178,7 @@ static int rtl8139_pre_save(void *opaque)
a83cc2
 
a83cc2
 static const VMStateDescription vmstate_rtl8139 = {
a83cc2
     .name = "rtl8139",
a83cc2
-    .version_id = 5,
a83cc2
+    .version_id = 4,
a83cc2
     .minimum_version_id = 3,
a83cc2
     .post_load = rtl8139_post_load,
a83cc2
     .pre_save  = rtl8139_pre_save,
7f1c5b
@@ -3259,7 +3259,9 @@ static const VMStateDescription vmstate_rtl8139 = {
a83cc2
         VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
a83cc2
         VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
a83cc2
         VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */
a83cc2
         VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5),
a83cc2
+#endif
a83cc2
         VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State),
a83cc2
         VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
a83cc2
 
a83cc2
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
7f1c5b
index b4243de735..c5ad69237e 100644
a83cc2
--- a/hw/smbios/smbios.c
a83cc2
+++ b/hw/smbios/smbios.c
77609c
@@ -57,6 +57,9 @@ static bool smbios_legacy = true;
a83cc2
 static bool smbios_uuid_encoded = true;
a83cc2
 /* end: legacy structures & constants for <= 2.0 machines */
a83cc2
 
a83cc2
+/* Set to true for modern Windows 10 HardwareID-6 compat */
a83cc2
+static bool smbios_type2_required;
a83cc2
+
a83cc2
 
a83cc2
 uint8_t *smbios_tables;
a83cc2
 size_t smbios_tables_len;
7f1c5b
@@ -669,7 +672,7 @@ static void smbios_build_type_1_table(void)
a83cc2
 
a83cc2
 static void smbios_build_type_2_table(void)
a83cc2
 {
29b115
-    SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, false); /* optional */
29b115
+    SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, smbios_type2_required);
a83cc2
 
a83cc2
     SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer);
a83cc2
     SMBIOS_TABLE_SET_STR(2, product_str, type2.product);
7f1c5b
@@ -977,7 +980,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features)
a83cc2
 
a83cc2
 void smbios_set_defaults(const char *manufacturer, const char *product,
a83cc2
                          const char *version, bool legacy_mode,
a83cc2
-                         bool uuid_encoded, SmbiosEntryPointType ep_type)
a83cc2
+                         bool uuid_encoded,
a83cc2
+                         const char *stream_product,
a83cc2
+                         const char *stream_version,
a83cc2
+                         SmbiosEntryPointType ep_type)
a83cc2
 {
a83cc2
     smbios_have_defaults = true;
a83cc2
     smbios_legacy = legacy_mode;
7f1c5b
@@ -998,11 +1004,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
a83cc2
         g_free(smbios_entries);
a83cc2
     }
a83cc2
 
a83cc2
+    /*
a83cc2
+     * If @stream_product & @stream_version are non-NULL, then
a83cc2
+     * we're following rules for new Windows driver support.
a83cc2
+     * The data we have to report is defined in this doc:
a83cc2
+     *
a83cc2
+     * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer
a83cc2
+     *
a83cc2
+     * The Windows drivers are written to expect use of the
a83cc2
+     * scheme documented as "HardwareID-6" against Windows 10,
a83cc2
+     * which uses SMBIOS System (Type 1) and Base Board (Type 2)
a83cc2
+     * tables and will match on
a83cc2
+     *
a83cc2
+     *   System Manufacturer = Red Hat     (@manufacturer)
a83cc2
+     *   System SKU Number = 8.2.0         (@stream_version)
a83cc2
+     *   Baseboard Manufacturer = Red Hat  (@manufacturer)
a83cc2
+     *   Baseboard Product = RHEL-AV       (@stream_product)
a83cc2
+     *
a83cc2
+     * NB, SKU must be changed with each RHEL-AV release
a83cc2
+     *
a83cc2
+     * Other fields can be freely used by applications using
a83cc2
+     * QEMU. For example apps can use the "System product"
a83cc2
+     * and "System version" to identify themselves.
a83cc2
+     *
a83cc2
+     * We get 'System Manufacturer' and 'Baseboard Manufacturer'
a83cc2
+     */
a83cc2
     SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer);
a83cc2
     SMBIOS_SET_DEFAULT(type1.product, product);
a83cc2
     SMBIOS_SET_DEFAULT(type1.version, version);
a83cc2
+    SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux");
a83cc2
+    if (stream_version != NULL) {
a83cc2
+        SMBIOS_SET_DEFAULT(type1.sku, stream_version);
a83cc2
+    }
a83cc2
     SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer);
a83cc2
-    SMBIOS_SET_DEFAULT(type2.product, product);
a83cc2
+    if (stream_product != NULL) {
a83cc2
+        SMBIOS_SET_DEFAULT(type2.product, stream_product);
a83cc2
+        smbios_type2_required = true;
a83cc2
+    } else {
a83cc2
+        SMBIOS_SET_DEFAULT(type2.product, product);
a83cc2
+    }
a83cc2
     SMBIOS_SET_DEFAULT(type2.version, version);
a83cc2
     SMBIOS_SET_DEFAULT(type3.manufacturer, manufacturer);
a83cc2
     SMBIOS_SET_DEFAULT(type3.version, version);
a83cc2
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
a83cc2
index 050875b497..32935da46c 100644
a83cc2
--- a/hw/timer/i8254_common.c
a83cc2
+++ b/hw/timer/i8254_common.c
a83cc2
@@ -231,7 +231,7 @@ static const VMStateDescription vmstate_pit_common = {
a83cc2
     .pre_save = pit_dispatch_pre_save,
a83cc2
     .post_load = pit_dispatch_post_load,
a83cc2
     .fields = (VMStateField[]) {
a83cc2
-        VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
a83cc2
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
a83cc2
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
a83cc2
                              vmstate_pit_channel, PITChannelState),
a83cc2
         VMSTATE_INT64(channels[0].next_transition_time,
a83cc2
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
7f1c5b
index 643d4643e4..529bad9366 100644
a83cc2
--- a/hw/usb/hcd-xhci-pci.c
a83cc2
+++ b/hw/usb/hcd-xhci-pci.c
77609c
@@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id)
a83cc2
    return 0;
a83cc2
 }
a83cc2
 
a83cc2
+/* RH bz 1912846 */
a83cc2
+static bool usb_xhci_pci_add_msi(struct PCIDevice *dev, Error **errp)
a83cc2
+{
a83cc2
+    int ret;
a83cc2
+    Error *err = NULL;
a83cc2
+    XHCIPciState *s = XHCI_PCI(dev);
a83cc2
+
a83cc2
+    ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err;;
a83cc2
+    /*
a83cc2
+     * Any error other than -ENOTSUP(board's MSI support is broken)
a83cc2
+     * is a programming error
a83cc2
+     */
a83cc2
+    assert(!ret || ret == -ENOTSUP);
a83cc2
+    if (ret && s->msi == ON_OFF_AUTO_ON) {
a83cc2
+        /* Can't satisfy user's explicit msi=on request, fail */
a83cc2
+        error_append_hint(&err, "You have to use msi=auto (default) or "
a83cc2
+                "msi=off with this machine type.\n");
a83cc2
+        error_propagate(errp, err);
a83cc2
+        return true;
a83cc2
+    }
a83cc2
+    assert(!err || s->msi == ON_OFF_AUTO_AUTO);
a83cc2
+    /* With msi=auto, we fall back to MSI off silently */
a83cc2
+    error_free(err);
a83cc2
+
a83cc2
+    return false;
a83cc2
+}
a83cc2
+
a83cc2
 static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
a83cc2
 {
a83cc2
     int ret;
77609c
@@ -125,23 +152,12 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
a83cc2
         s->xhci.nec_quirks = true;
a83cc2
     }
a83cc2
 
a83cc2
-    if (s->msi != ON_OFF_AUTO_OFF) {
a83cc2
-        ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err;;
a83cc2
-        /*
a83cc2
-         * Any error other than -ENOTSUP(board's MSI support is broken)
a83cc2
-         * is a programming error
a83cc2
-         */
a83cc2
-        assert(!ret || ret == -ENOTSUP);
a83cc2
-        if (ret && s->msi == ON_OFF_AUTO_ON) {
a83cc2
-            /* Can't satisfy user's explicit msi=on request, fail */
a83cc2
-            error_append_hint(&err, "You have to use msi=auto (default) or "
a83cc2
-                    "msi=off with this machine type.\n");
a83cc2
+    if (s->msi != ON_OFF_AUTO_OFF && s->rh_late_msi_cap) {
a83cc2
+        /* This gives the behaviour from 5.2.0 onwards, lspci shows 90,a0,70 */
a83cc2
+        if (usb_xhci_pci_add_msi(dev, &err)) {
a83cc2
             error_propagate(errp, err);
a83cc2
             return;
a83cc2
         }
a83cc2
-        assert(!err || s->msi == ON_OFF_AUTO_AUTO);
a83cc2
-        /* With msi=auto, we fall back to MSI off silently */
a83cc2
-        error_free(err);
a83cc2
     }
a83cc2
     pci_register_bar(dev, 0,
a83cc2
                      PCI_BASE_ADDRESS_SPACE_MEMORY |
77609c
@@ -154,6 +170,14 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
a83cc2
         assert(ret > 0);
a83cc2
     }
a83cc2
 
a83cc2
+    /* RH bz 1912846 */
a83cc2
+    if (s->msi != ON_OFF_AUTO_OFF && !s->rh_late_msi_cap) {
a83cc2
+        /* This gives the older RH machine behaviour, lspci shows 90,70,a0 */
a83cc2
+        if (usb_xhci_pci_add_msi(dev, &err)) {
a83cc2
+            error_propagate(errp, err);
a83cc2
+            return;
a83cc2
+        }
a83cc2
+    }
a83cc2
     if (s->msix != ON_OFF_AUTO_OFF) {
a83cc2
         /* TODO check for errors, and should fail when msix=on */
a83cc2
         msix_init(dev, s->xhci.numintrs,
77609c
@@ -198,11 +222,18 @@ static void xhci_instance_init(Object *obj)
a83cc2
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
a83cc2
 }
a83cc2
 
a83cc2
+static Property xhci_pci_properties[] = {
a83cc2
+    /* RH bz 1912846 */
a83cc2
+    DEFINE_PROP_BOOL("x-rh-late-msi-cap", XHCIPciState, rh_late_msi_cap, true),
a83cc2
+    DEFINE_PROP_END_OF_LIST()
a83cc2
+};
a83cc2
+
a83cc2
 static void xhci_class_init(ObjectClass *klass, void *data)
a83cc2
 {
a83cc2
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
a83cc2
     DeviceClass *dc = DEVICE_CLASS(klass);
a83cc2
 
a83cc2
+    device_class_set_props(dc, xhci_pci_properties);
a83cc2
     dc->reset   = xhci_pci_reset;
a83cc2
     dc->vmsd    = &vmstate_xhci_pci;
a83cc2
     set_bit(DEVICE_CATEGORY_USB, dc->categories);
a83cc2
diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h
a83cc2
index c193f79443..086a1feb1e 100644
a83cc2
--- a/hw/usb/hcd-xhci-pci.h
a83cc2
+++ b/hw/usb/hcd-xhci-pci.h
a83cc2
@@ -39,6 +39,7 @@ typedef struct XHCIPciState {
a83cc2
     XHCIState xhci;
a83cc2
     OnOffAuto msi;
a83cc2
     OnOffAuto msix;
a83cc2
+    bool      rh_late_msi_cap;  /* bz 1912846 */
a83cc2
 } XHCIPciState;
a83cc2
 
a83cc2
 #endif
a83cc2
diff --git a/include/hw/boards.h b/include/hw/boards.h
7f1c5b
index 90f1dd3aeb..2209d4e416 100644
a83cc2
--- a/include/hw/boards.h
a83cc2
+++ b/include/hw/boards.h
7f1c5b
@@ -454,4 +454,35 @@ extern const size_t hw_compat_2_2_len;
a83cc2
 extern GlobalProperty hw_compat_2_1[];
a83cc2
 extern const size_t hw_compat_2_1_len;
a83cc2
 
7f1c5b
+extern GlobalProperty hw_compat_rhel_9_1[];
7f1c5b
+extern const size_t hw_compat_rhel_9_1_len;
7f1c5b
+
7f1c5b
+extern GlobalProperty hw_compat_rhel_9_0[];
7f1c5b
+extern const size_t hw_compat_rhel_9_0_len;
7f1c5b
+
7f1c5b
+extern GlobalProperty hw_compat_rhel_8_6[];
7f1c5b
+extern const size_t hw_compat_rhel_8_6_len;
7f1c5b
+
b697b4
+extern GlobalProperty hw_compat_rhel_8_5[];
b697b4
+extern const size_t hw_compat_rhel_8_5_len;
b697b4
+
a83cc2
+extern GlobalProperty hw_compat_rhel_8_4[];
a83cc2
+extern const size_t hw_compat_rhel_8_4_len;
a83cc2
+
a83cc2
+extern GlobalProperty hw_compat_rhel_8_3[];
a83cc2
+extern const size_t hw_compat_rhel_8_3_len;
a83cc2
+
a83cc2
+extern GlobalProperty hw_compat_rhel_8_2[];
a83cc2
+extern const size_t hw_compat_rhel_8_2_len;
a83cc2
+
a83cc2
+extern GlobalProperty hw_compat_rhel_8_1[];
a83cc2
+extern const size_t hw_compat_rhel_8_1_len;
a83cc2
+
a83cc2
+extern GlobalProperty hw_compat_rhel_8_0[];
a83cc2
+extern const size_t hw_compat_rhel_8_0_len;
a83cc2
+
a83cc2
+extern GlobalProperty hw_compat_rhel_7_6[];
a83cc2
+extern const size_t hw_compat_rhel_7_6_len;
a83cc2
+
7f1c5b
+extern const char *rhel_old_machine_deprecation;
a83cc2
 #endif
a83cc2
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
7f1c5b
index 7f3259a630..d24b3ccd32 100644
a83cc2
--- a/include/hw/firmware/smbios.h
a83cc2
+++ b/include/hw/firmware/smbios.h
7f1c5b
@@ -294,7 +294,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp);
a83cc2
 void smbios_set_cpuid(uint32_t version, uint32_t features);
a83cc2
 void smbios_set_defaults(const char *manufacturer, const char *product,
a83cc2
                          const char *version, bool legacy_mode,
a83cc2
-                         bool uuid_encoded, SmbiosEntryPointType ep_type);
a83cc2
+                         bool uuid_encoded,
a83cc2
+                         const char *stream_product,
a83cc2
+                         const char *stream_version,
a83cc2
+                         SmbiosEntryPointType ep_type);
a83cc2
 uint8_t *smbios_get_table_legacy(MachineState *ms, size_t *length);
a83cc2
 void smbios_get_tables(MachineState *ms,
a83cc2
                        const struct smbios_phys_mem_area *mem_array,
a83cc2
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
7f1c5b
index c95333514e..3754eaa97d 100644
a83cc2
--- a/include/hw/i386/pc.h
a83cc2
+++ b/include/hw/i386/pc.h
7f1c5b
@@ -112,6 +112,9 @@ struct PCMachineClass {
a83cc2
     bool smbios_defaults;
a83cc2
     bool smbios_legacy_mode;
a83cc2
     bool smbios_uuid_encoded;
a83cc2
+    /* New fields needed for Windows HardwareID-6 matching */
a83cc2
+    const char *smbios_stream_product;
a83cc2
+    const char *smbios_stream_version;
a83cc2
 
a83cc2
     /* RAM / address space compat: */
a83cc2
     bool gigabyte_align;
a83cc2
-- 
29b115
2.31.1
a83cc2