60061b
From c2b3564ce466bc5069bf9f5b0694025c68b0858d Mon Sep 17 00:00:00 2001
902636
From: Miroslav Rezanina <mrezanin@redhat.com>
902636
Date: Fri, 19 Oct 2018 13:10:31 +0200
902636
Subject: Add x86_64 machine types
902636
902636
Adding changes to add RHEL machine types for x86_64 architecture.
902636
902636
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
902636
902636
Rebase changes (qemu-4.0.0):
902636
- Use upstream compat handling
902636
902636
Rebase notes (3.1.0):
902636
- Removed xsave changes
902636
902636
Rebase notes (4.1.0):
902636
- Updated format for compat structures
902636
902636
Rebase notes (4.2.0-rc2):
902636
- Use X86MachineClass for save_tsc_khz (upstream change)
902636
60061b
Rebase notes (weekly-210303):
60061b
- Use rhel-8.4.0 hw compat
60061b
60061b
Rebase notes (weekly-210519):
60061b
- kvm_default_props moved to new file (upstream)
60061b
60061b
Rebase notes (6.2.0-rc0):
60061b
- linuxboot_dma_enabled moved to X86MachineState
60061b
902636
Merged patches (4.1.0):
902636
- f4dc802 pc: 7.5 compat entries
902636
- 456ed3e pc: PC_RHEL7_6_COMPAT
902636
- 04119ee pc: Add compat for pc-i440fx-rhel7.6.0 machine type
902636
- b3b3687 pc: Add pc-q35-8.0.0 machine type
902636
- 8d46fc6 pc: Add x-migrate-smi-count=off to PC_RHEL7_6_COMPAT
902636
- 1de7949 kvm: clear out KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT for older machine types
902636
- 18cf0d7 target/i386: Disable MPX support on named CPU models (partialy)
902636
- 2660667 rhel: Set host-phys-bits-limit=48 on rhel machine-types
902636
902636
Merged patches (4.2.0):
902636
- 7d5c2ef pc: Don't make die-id mandatory unless necessary
902636
- e42808c x86 machine types: pc_rhel_8_0_compat
902636
- 9de83a8 x86 machine types: q35: Fixup units_per_default_bus
902636
- 6df1559 x86 machine types: Fixup dynamic sysbus entries
902636
- 0784125 x86 machine types: add pc-q35-rhel8.1.0
902636
- machines/x86: Add rhel 8.2 machine type (patch 92959)
902636
60061b
Merged patches (5.1.0):
60061b
- 481357e RHEL: hw/i386: disable nested PERF_GLOBAL_CTRL MSR support
60061b
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
60061b
60061b
Merged patches (5.2.0 rc0):
60061b
- b02c9f5 x86: Add 8.3.0 x86_64 machine type
60061b
- f2edc4f q35: Set max_cpus to 512
60061b
- 6d7ba66 machine types/numa: set numa_mem_supported on old machine types (partialy)
60061b
- 25c5644 machine_types/numa: compatibility for auto_enable_numa_with_memdev (partialy)
60061b
- e2d3209 x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features (partialy)
60061b
60061b
Merged patches (weekly-210120):
60061b
- d0afeaa0c4 RHEL: Switch pvpanic test to q35
60061b
- e19cdad83c 8.4 x86 machine type
60061b
60061b
Merged patches (weekly-210203):
60061b
- 96f8781bd6 q35: Increase max_cpus to 710 on pc-q35-rhel8* machine types
60061b
60061b
Merged patches (weekly-210224):
60061b
- 70d3924521 redhat: Add some devices for exporting upstream machine types
60061b
 - machine type chunks only
60061b
60061b
Merged patches (6.0.0 rc0):
60061b
- 031c690804 i386/acpi: restore device paths for pre-5.1 vms
60061b
60061b
Merged patches (weekly-210623):
60061b
- 64c350696f x86: Add x86 rhel8.5 machine types
60061b
- 1c8fe5e164 redhat: x86: Enable 'kvm-asyncpf-int' by default
60061b
60061b
Merged patches (weekly-210714):
60061b
- 618e2424ed redhat: Expose upstream machines pc-4.2 and pc-2.11
60061b
- c4d1aa8bf2 redhat: Enable FDC device for upstream machines too
60061b
- 66882f9a32 redhat: Add hw_compat_4_2_extra and apply to upstream machines
60061b
60061b
Fix machine type
902636
---
60061b
 hw/block/fdc.c             |   5 +-
60061b
 hw/i386/acpi-build.c       |   3 +
60061b
 hw/i386/pc.c               | 298 ++++++++++++++++++++++++++++++++++++-
60061b
 hw/i386/pc_piix.c          | 274 +++++++++++++++++++++++++++++++++-
60061b
 hw/i386/pc_q35.c           | 234 ++++++++++++++++++++++++++++-
60061b
 include/hw/boards.h        |   2 +
60061b
 include/hw/i386/pc.h       |  45 ++++++
60061b
 target/i386/kvm/kvm-cpu.c  |   1 +
60061b
 target/i386/kvm/kvm.c      |   4 +
60061b
 tests/qtest/pvpanic-test.c |   5 +-
60061b
 10 files changed, 862 insertions(+), 9 deletions(-)
902636
60061b
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
60061b
index 97fa6de423..63042ef030 100644
60061b
--- a/hw/block/fdc.c
60061b
+++ b/hw/block/fdc.c
60061b
@@ -2341,7 +2341,10 @@ void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, Error **errp)
60061b
 
60061b
     /* Restricted for Red Hat Enterprise Linux: */
60061b
     MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
60061b
-    if (!strstr(mc->name, "-rhel7.")) {
60061b
+    if (!strstr(mc->name, "-rhel7.") &&
60061b
+        /* Exported two upstream machine types allows FDC too */
60061b
+        strcmp(mc->name, "pc-i440fx-4.2") &&
60061b
+        strcmp(mc->name, "pc-i440fx-2.11")) {
60061b
         error_setg(errp, "Device %s is not supported with machine type %s",
60061b
                    object_get_typename(OBJECT(dev)), mc->name);
60061b
         return;
902636
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
60061b
index a99c6e4fe3..447ea35275 100644
902636
--- a/hw/i386/acpi-build.c
902636
+++ b/hw/i386/acpi-build.c
60061b
@@ -230,6 +230,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
902636
         pm->fadt.reset_reg = r;
902636
         pm->fadt.reset_val = 0xf;
902636
         pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
902636
+        if (object_property_get_bool(lpc,
902636
+                                     "__com.redhat_force-rev1-fadt", NULL))
902636
+            pm->fadt.rev = 1;
902636
         pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
60061b
         pm->smi_on_cpuhp =
60061b
             !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT));
902636
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
60061b
index a2ef40ecbc..e8109954ca 100644
902636
--- a/hw/i386/pc.c
902636
+++ b/hw/i386/pc.c
60061b
@@ -371,6 +371,296 @@ GlobalProperty pc_compat_1_4[] = {
902636
 };
902636
 const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
902636
 
902636
+/* This macro is for changes to properties that are RHEL specific,
902636
+ * different to the current upstream and to be applied to the latest
902636
+ * machine type.
902636
+ */
902636
+GlobalProperty pc_rhel_compat[] = {
902636
+    { TYPE_X86_CPU, "host-phys-bits", "on" },
902636
+    { TYPE_X86_CPU, "host-phys-bits-limit", "48" },
60061b
+    { TYPE_X86_CPU, "vmx-entry-load-perf-global-ctrl", "off" },
60061b
+    { TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" },
902636
+    /* bz 1508330 */ 
902636
+    { "vfio-pci", "x-no-geforce-quirks", "on" },
60061b
+    /* bz 1941397 */
60061b
+    { TYPE_X86_CPU, "kvm-asyncpf-int", "on" },
902636
+};
902636
+const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
902636
+
60061b
+GlobalProperty pc_rhel_8_4_compat[] = {
60061b
+    /* pc_rhel_8_4_compat from pc_compat_5_2 */
60061b
+    { "ICH9-LPC", "x-smi-cpu-hotunplug", "off" },
60061b
+    { TYPE_X86_CPU, "kvm-asyncpf-int", "off" },
60061b
+};
60061b
+const size_t pc_rhel_8_4_compat_len = G_N_ELEMENTS(pc_rhel_8_4_compat);
60061b
+
60061b
+GlobalProperty pc_rhel_8_3_compat[] = {
60061b
+    /* pc_rhel_8_3_compat from pc_compat_5_1 */
60061b
+    { "ICH9-LPC", "x-smi-cpu-hotplug", "off" },
60061b
+};
60061b
+const size_t pc_rhel_8_3_compat_len = G_N_ELEMENTS(pc_rhel_8_3_compat);
60061b
+
60061b
+GlobalProperty pc_rhel_8_2_compat[] = {
60061b
+    /* pc_rhel_8_2_compat from pc_compat_4_2 */
60061b
+    { "mch", "smbase-smram", "off" },
60061b
+};
60061b
+const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat);
60061b
+
902636
+/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */
902636
+GlobalProperty pc_rhel_8_1_compat[] = { };
902636
+const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat);
902636
+
902636
+GlobalProperty pc_rhel_8_0_compat[] = {
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "intel-iommu", "dma-drain", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G4" "-" TYPE_X86_CPU, "npt", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G4" "-" TYPE_X86_CPU, "nrip-save", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G5" "-" TYPE_X86_CPU, "npt", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Opteron_G5" "-" TYPE_X86_CPU, "nrip-save", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "EPYC" "-" TYPE_X86_CPU, "npt", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "EPYC" "-" TYPE_X86_CPU, "nrip-save", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "EPYC-IBPB" "-" TYPE_X86_CPU, "npt", "off" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "EPYC-IBPB" "-" TYPE_X86_CPU, "nrip-save", "off" },
902636
+    /** The mpx=on entries from pc_compat_3_1 are in pc_rhel_7_6_compat **/
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" },
902636
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
902636
+    { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" },
902636
+};
902636
+const size_t pc_rhel_8_0_compat_len = G_N_ELEMENTS(pc_rhel_8_0_compat);
902636
+
902636
+/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but:
902636
+ * all of the 2_12 stuff was already in 7.6 from bz 1481253
902636
+ * x-migrate-smi-count comes from PC_COMPAT_2_11 but
902636
+ * is really tied to kernel version so keep it off on 7.x
902636
+ * machine types irrespective of host.
902636
+ */
902636
+GlobalProperty pc_rhel_7_6_compat[] = {
902636
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
902636
+    { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
902636
+    { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
902636
+    { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { TYPE_X86_CPU, "x-migrate-smi-count", "off" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Skylake-Client" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Skylake-Client-IBRS" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Skylake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Cascadelake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
902636
+    { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
902636
+};
902636
+const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat);
902636
+
902636
+/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but:
902636
+ * - x-hv-max-vps was backported to 7.5
902636
+ * - x-pci-hole64-fix was backported to 7.5
902636
+ */
902636
+GlobalProperty pc_rhel_7_5_compat[] = {
902636
+    /* pc_rhel_7_5_compat from pc_compat_2_11 */  
902636
+    { "Skylake-Server" "-" TYPE_X86_CPU, "clflushopt", "off" },
902636
+    /* pc_rhel_7_5_compat from pc_compat_2_12 */  
902636
+    { TYPE_X86_CPU, "legacy-cache", "on" },
902636
+    /* pc_rhel_7_5_compat from pc_compat_2_12 */  
902636
+    { TYPE_X86_CPU, "topoext", "off" },
902636
+    /* pc_rhel_7_5_compat from pc_compat_2_12 */  
902636
+    { "EPYC-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) },
902636
+    /* pc_rhel_7_5_compat from pc_compat_2_12 */  
902636
+    { "EPYC-IBPB-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) },
902636
+};
902636
+const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat);
902636
+
902636
+GlobalProperty pc_rhel_7_4_compat[] = {
902636
+    /* pc_rhel_7_4_compat from pc_compat_2_9 */ 
902636
+    { "mch", "extended-tseg-mbytes", stringify(0) },
902636
+    /* bz 1489800 */ 
902636
+    { "ICH9-LPC", "__com.redhat_force-rev1-fadt", "on" },
902636
+    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
902636
+    { "i440FX-pcihost", "x-pci-hole64-fix", "off" },
902636
+    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
902636
+    { "q35-pcihost", "x-pci-hole64-fix", "off" },
902636
+    /* pc_rhel_7_4_compat from pc_compat_2_10 */ 
902636
+    { TYPE_X86_CPU, "x-hv-max-vps", "0x40" },
902636
+};
902636
+const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat);
902636
+
902636
+GlobalProperty pc_rhel_7_3_compat[] = {
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_8 */ 
902636
+    { "kvmclock", "x-mach-use-reliable-get-clock", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { TYPE_X86_CPU, "l3-cache", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_7 */ 
902636
+    { "isa-pcspk", "migrate", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_6 */ 
902636
+    { TYPE_X86_CPU, "cpuid-0xb", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_8 */ 
902636
+    { "ICH9-LPC", "x-smi-broadcast", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_8 */ 
902636
+    { TYPE_X86_CPU, "vmware-cpuid-freq", "off" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_8 */ 
902636
+    { "Haswell-" TYPE_X86_CPU, "stepping", "1" },
902636
+    /* pc_rhel_7_3_compat from pc_compat_2_3 added in 2.9*/ 
902636
+    { TYPE_X86_CPU, "kvm-no-smi-migration", "on" },
902636
+};
902636
+const size_t pc_rhel_7_3_compat_len = G_N_ELEMENTS(pc_rhel_7_3_compat);
902636
+
902636
+GlobalProperty pc_rhel_7_2_compat[] = {
902636
+    { "phenom" "-" TYPE_X86_CPU, "rdtscp", "off"},
902636
+    { "qemu64" "-" TYPE_X86_CPU, "sse4a", "on" },
902636
+    { "qemu64" "-" TYPE_X86_CPU, "abm", "on" },
902636
+    { "Haswell-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Haswell-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Haswell-noTSX-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Broadwell-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Broadwell-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Broadwell-noTSX-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
902636
+    { "host" "-" TYPE_X86_CPU, "host-cache-info", "on" },
902636
+    { TYPE_X86_CPU, "check", "off" },
902636
+    { "qemu32" "-" TYPE_X86_CPU, "popcnt", "on" },
902636
+    { TYPE_X86_CPU, "arat", "off" },
902636
+    { "usb-redir", "streams", "off" },
902636
+    { TYPE_X86_CPU, "fill-mtrr-mask", "off" },
902636
+    { "apic-common", "legacy-instance-id", "on" },
902636
+};
902636
+const size_t pc_rhel_7_2_compat_len = G_N_ELEMENTS(pc_rhel_7_2_compat);
902636
+
902636
+GlobalProperty pc_rhel_7_1_compat[] = {
902636
+    { "kvm64" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "kvm32" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Conroe" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Penryn" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Nehalem" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Nehalem-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Westmere" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Westmere-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "SandyBridge" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "SandyBridge-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Haswell" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Haswell-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Broadwell" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Broadwell-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Opteron_G1" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Opteron_G2" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Opteron_G4" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Opteron_G5" "-" TYPE_X86_CPU, "vme", "off" },
902636
+    { "Haswell" "-" TYPE_X86_CPU,  "f16c", "off" },
902636
+    { "Haswell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" },
902636
+    { "Haswell" "-" TYPE_X86_CPU, "rdrand", "off" },
902636
+    { "Haswell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" },
902636
+    { "Broadwell" "-" TYPE_X86_CPU, "f16c", "off" },
902636
+    { "Broadwell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" },
902636
+    { "Broadwell" "-" TYPE_X86_CPU, "rdrand", "off" },
902636
+    { "Broadwell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" },
902636
+    { "coreduo" "-" TYPE_X86_CPU, "vmx", "on" },
902636
+    { "core2duo" "-" TYPE_X86_CPU, "vmx", "on" },
902636
+    { "qemu64" "-" TYPE_X86_CPU, "min-level", stringify(4) },
902636
+    { "kvm64" "-" TYPE_X86_CPU, "min-level", stringify(5) },
902636
+    { "pentium3" "-" TYPE_X86_CPU, "min-level", stringify(2) },
902636
+    { "n270" "-" TYPE_X86_CPU, "min-level", stringify(5) },
902636
+    { "Conroe" "-" TYPE_X86_CPU, "min-level", stringify(4) },
902636
+    { "Penryn" "-" TYPE_X86_CPU, "min-level", stringify(4) },
902636
+    { "Nehalem" "-" TYPE_X86_CPU, "min-level", stringify(4) },
902636
+    { "n270" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Penryn" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Conroe" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Nehalem" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Westmere" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "SandyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "IvyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Haswell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Haswell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Broadwell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+    { "Broadwell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
902636
+};
902636
+const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_compat);
902636
+
902636
+/*
902636
+ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
902636
+ * types as the PC_COMPAT_* do for upstream types.
902636
+ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
902636
+ */
902636
+
902636
+/*
902636
+ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_*
902636
+ * between our base and 1.5, less stuff backported to RHEL-7.0
902636
+ * (usb-device.msos-desc), less stuff for devices we changed
902636
+ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x,
902636
+ * pci-serial-4x) in 7.0.
902636
+ */
902636
+GlobalProperty pc_rhel_7_0_compat[] = {
902636
+    { "virtio-scsi-pci", "any_layout", "off" },
902636
+    { "PIIX4_PM", "memory-hotplug-support", "off" },
902636
+    { "apic", "version", stringify(0x11) },
902636
+    { "nec-usb-xhci", "superspeed-ports-first", "off" },
902636
+    { "nec-usb-xhci", "force-pcie-endcap", "on" },
902636
+    { "pci-serial", "prog_if", stringify(0) },
902636
+    { "virtio-net-pci", "guest_announce", "off" },
902636
+    { "ICH9-LPC", "memory-hotplug-support", "off" },
902636
+    { "xio3130-downstream", COMPAT_PROP_PCP, "off" },
902636
+    { "ioh3420", COMPAT_PROP_PCP, "off" },
902636
+    { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" },
902636
+    { "e1000", "mitigation", "off" },
902636
+    { "virtio-net-pci", "ctrl_guest_offloads", "off" },
902636
+    { "Conroe" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Penryn" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Nehalem" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Nehalem-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Westmere" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Westmere-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Opteron_G1" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Opteron_G2" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Opteron_G3" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Opteron_G4" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+    { "Opteron_G5" "-" TYPE_X86_CPU, "x2apic", "on" },
902636
+};
902636
+const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat);
902636
+
60061b
+/*
60061b
+ * RHEL: These properties only apply to the RHEL exported machine types
60061b
+ * pc-4.2/2.11 for the purpose to have a limited upstream machines support
60061b
+ * which can be migrated to RHEL.  Let's avoid touching hw_compat_4_2 directly
60061b
+ * so that we can have some isolation against the upstream code.
60061b
+ */
60061b
+GlobalProperty hw_compat_4_2_extra[] = {
60061b
+    /* By default enlarge the default virtio-net-pci ROM to 512KB. */
60061b
+    { "virtio-net-pci", "romsize", "0x80000" },
60061b
+};
60061b
+const size_t hw_compat_4_2_extra_len = G_N_ELEMENTS(hw_compat_4_2_extra);
60061b
+
60061b
 GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
902636
 {
60061b
     GSIState *s;
60061b
@@ -904,7 +1194,8 @@ void pc_memory_init(PCMachineState *pcms,
902636
     option_rom_mr = g_malloc(sizeof(*option_rom_mr));
902636
     memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
902636
                            &error_fatal);
902636
-    if (pcmc->pci_enabled) {
902636
+    /* RH difference: See bz 1489800, explicitly make ROM ro */
902636
+    if (pcmc->pc_rom_ro) {
902636
         memory_region_set_readonly(option_rom_mr, true);
902636
     }
902636
     memory_region_add_subregion_overlap(rom_memory,
60061b
@@ -1694,6 +1985,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
902636
     pcmc->pvh_enabled = true;
60061b
     pcmc->kvmclock_create_always = true;
902636
     assert(!mc->get_hotplug_handler);
902636
+    pcmc->pc_rom_ro = true;
902636
+    mc->async_pf_vmexit_disable = false;
902636
     mc->get_hotplug_handler = pc_get_hotplug_handler;
902636
     mc->hotplug_allowed = pc_hotplug_allowed;
902636
     mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
60061b
@@ -1704,7 +1997,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
60061b
     mc->has_hotpluggable_cpus = true;
60061b
     mc->default_boot_order = "cad";
902636
     mc->block_default_type = IF_IDE;
902636
-    mc->max_cpus = 255;
902636
+    /* 240: max CPU count for RHEL */
902636
+    mc->max_cpus = 240;
902636
     mc->reset = pc_machine_reset;
902636
     mc->wakeup = pc_machine_wakeup;
902636
     hc->pre_plug = pc_machine_device_pre_plug_cb;
902636
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
60061b
index dda3f64f19..2885edffe9 100644
902636
--- a/hw/i386/pc_piix.c
902636
+++ b/hw/i386/pc_piix.c
60061b
@@ -50,6 +50,7 @@
902636
 #include "qapi/error.h"
902636
 #include "qemu/error-report.h"
60061b
 #include "sysemu/xen.h"
902636
+#include "migration/migration.h"
902636
 #ifdef CONFIG_XEN
902636
 #include <xen/hvm/hvm_info_table.h>
902636
 #include "hw/xen/xen_pt.h"
60061b
@@ -174,8 +175,8 @@ static void pc_init1(MachineState *machine,
902636
     if (pcmc->smbios_defaults) {
902636
         MachineClass *mc = MACHINE_GET_CLASS(machine);
902636
         /* These values are guest ABI, do not change */
902636
-        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
902636
-                            mc->name, pcmc->smbios_legacy_mode,
902636
+        smbios_set_defaults("Red Hat", "KVM",
902636
+                            mc->desc, pcmc->smbios_legacy_mode,
902636
                             pcmc->smbios_uuid_encoded,
60061b
                             pcmc->smbios_stream_product,
60061b
                             pcmc->smbios_stream_version,
60061b
@@ -314,6 +315,15 @@ static void pc_init1(MachineState *machine,
902636
  * hw_compat_*, pc_compat_*, or * pc_*_machine_options().
902636
  */
902636
 
60061b
+/*
60061b
+ * NOTE!  Not all the upstream machine types are disabled for RHEL.  For
60061b
+ * providing a very limited support for upstream machine types, pc machines
60061b
+ * 2.11 and 4.2 are exposed explicitly.  This will make the below "#if" macros
60061b
+ * a bit messed up, but please read this comment first so that we can have a
60061b
+ * rough understanding of what we're going to do.
60061b
+ */
60061b
+
902636
+#if 0 /* Disabled for Red Hat Enterprise Linux */
902636
 static void pc_compat_2_3_fn(MachineState *machine)
902636
 {
60061b
     X86MachineState *x86ms = X86_MACHINE(machine);
60061b
@@ -389,6 +399,8 @@ static void pc_xen_hvm_init(MachineState *machine)
60061b
 }
60061b
 #endif
60061b
 
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
+
60061b
 #define DEFINE_I440FX_MACHINE(suffix, name, compatfn, optionfn) \
60061b
     static void pc_init_##suffix(MachineState *machine) \
60061b
     { \
60061b
@@ -424,8 +436,10 @@ static void pc_i440fx_6_2_machine_options(MachineClass *m)
60061b
     pcmc->default_cpu_version = 1;
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v6_2, "pc-i440fx-6.2", NULL,
60061b
                       pc_i440fx_6_2_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_6_1_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -437,8 +451,10 @@ static void pc_i440fx_6_1_machine_options(MachineClass *m)
60061b
     m->smp_props.prefer_sockets = true;
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v6_1, "pc-i440fx-6.1", NULL,
60061b
                       pc_i440fx_6_1_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_6_0_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -449,8 +465,10 @@ static void pc_i440fx_6_0_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_6_0, pc_compat_6_0_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
60061b
                       pc_i440fx_6_0_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_5_2_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -461,8 +479,10 @@ static void pc_i440fx_5_2_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v5_2, "pc-i440fx-5.2", NULL,
60061b
                       pc_i440fx_5_2_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_5_1_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -477,8 +497,10 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m)
60061b
     pcmc->pci_root_uid = 1;
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", NULL,
60061b
                       pc_i440fx_5_1_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_5_0_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -491,8 +513,10 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
60061b
     m->auto_enable_numa_with_memdev = false;
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v5_0, "pc-i440fx-5.0", NULL,
60061b
                       pc_i440fx_5_0_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_4_2_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -501,8 +525,21 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
60061b
     m->is_default = false;
60061b
     compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
60061b
     compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
60061b
+
60061b
+    /*
60061b
+     * RHEL: Mark all upstream machines as deprecated because they're not
60061b
+     * supported by RHEL, even if exported.
60061b
+     */
60061b
+    m->deprecation_reason = "Not supported by RHEL";
60061b
+    /*
60061b
+     * RHEL: Specific compat properties to have limited support for upstream
60061b
+     * machines exported.
60061b
+     */
60061b
+    compat_props_add(m->compat_props, hw_compat_4_2_extra,
60061b
+                     hw_compat_4_2_extra_len);
60061b
 }
60061b
 
60061b
+/* RHEL: Export pc-4.2 */
60061b
 DEFINE_I440FX_MACHINE(v4_2, "pc-i440fx-4.2", NULL,
60061b
                       pc_i440fx_4_2_machine_options);
60061b
 
60061b
@@ -515,8 +552,10 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v4_1, "pc-i440fx-4.1", NULL,
60061b
                       pc_i440fx_4_1_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_4_0_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -529,8 +568,10 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
60061b
                       pc_i440fx_4_0_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_3_1_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -546,8 +587,10 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
60061b
                       pc_i440fx_3_1_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_3_0_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -556,8 +599,10 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_3_0, pc_compat_3_0_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
60061b
                       pc_i440fx_3_0_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_2_12_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -566,8 +611,10 @@ static void pc_i440fx_2_12_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len);
60061b
 }
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL,
60061b
                       pc_i440fx_2_12_machine_options);
60061b
+#endif /* Disabled for Red Hat Enterprise Linux */
60061b
 
60061b
 static void pc_i440fx_2_11_machine_options(MachineClass *m)
60061b
 {
60061b
@@ -576,9 +623,11 @@ static void pc_i440fx_2_11_machine_options(MachineClass *m)
60061b
     compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len);
60061b
 }
60061b
 
60061b
+/* RHEL: Export pc-2.11 */
60061b
 DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL,
60061b
                       pc_i440fx_2_11_machine_options);
60061b
 
60061b
+#if 0 /* Disabled for Red Hat Enterprise Linux */
60061b
 static void pc_i440fx_2_10_machine_options(MachineClass *m)
60061b
 {
60061b
     pc_i440fx_2_11_machine_options(m);
60061b
@@ -951,3 +1000,224 @@ static void xenfv_3_1_machine_options(MachineClass *m)
60061b
 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
60061b
                   xenfv_3_1_machine_options);
902636
 #endif
902636
+#endif  /* Disabled for Red Hat Enterprise Linux */
902636
+
902636
+/* Red Hat Enterprise Linux machine types */
902636
+
902636
+/* Options for the latest rhel7 machine type */
902636
+static void pc_machine_rhel7_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    m->family = "pc_piix_Y";
60061b
+    m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
902636
+    pcmc->default_nic_model = "e1000";
60061b
+    pcmc->pci_root_uid = 0;
902636
+    m->default_display = "std";
902636
+    m->no_parallel = 1;
60061b
+    m->numa_mem_supported = true;
60061b
+    m->auto_enable_numa_with_memdev = false;
902636
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
902636
+    compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
902636
+    m->alias = "pc";
902636
+    m->is_default = 1;
902636
+}
902636
+
902636
+static void pc_init_rhel760(MachineState *machine)
902636
+{
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel760_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_machine_rhel7_options(m);
902636
+    m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
902636
+    m->async_pf_vmexit_disable = true;
902636
+    m->smbus_no_migration_support = true;
902636
+    pcmc->pvh_enabled = false;
902636
+    pcmc->default_cpu_version = CPU_VERSION_LEGACY;
60061b
+    pcmc->kvmclock_create_always = false;
60061b
+    /* From pc_i440fx_5_1_machine_options() */
60061b
+    pcmc->pci_root_uid = 1;
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_4,
60061b
+                     hw_compat_rhel_8_4_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_4_compat,
60061b
+                     pc_rhel_8_4_compat_len);
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_3,
60061b
+                     hw_compat_rhel_8_3_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_3_compat,
60061b
+                     pc_rhel_8_3_compat_len);
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_2,
60061b
+                     hw_compat_rhel_8_2_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_2_compat,
60061b
+                     pc_rhel_8_2_compat_len);
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len);
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760,
902636
+                  pc_machine_rhel760_options);
902636
+
902636
+static void pc_init_rhel750(MachineState *machine)
902636
+{
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel750_options(MachineClass *m)
902636
+{
902636
+    pc_machine_rhel760_options(m);
902636
+    m->alias = NULL;
902636
+    m->is_default = 0;
902636
+    m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)";
902636
+    m->auto_enable_numa_with_memhp = false;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
902636
+                  pc_machine_rhel750_options);
902636
+
902636
+static void pc_init_rhel740(MachineState *machine)
902636
+{
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel740_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_machine_rhel750_options(m);
902636
+    m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
902636
+    pcmc->pc_rom_ro = false;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
902636
+                  pc_machine_rhel740_options);
902636
+
902636
+static void pc_init_rhel730(MachineState *machine)
902636
+{
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel730_options(MachineClass *m)
902636
+{
60061b
+    X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
902636
+    pc_machine_rhel740_options(m);
902636
+    m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)";
60061b
+    x86mc->fwcfg_dma_enabled = false;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730,
902636
+                  pc_machine_rhel730_options);
902636
+
902636
+
902636
+static void pc_init_rhel720(MachineState *machine)
902636
+{
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel720_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
902636
+    pc_machine_rhel730_options(m);
902636
+    m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)";
902636
+    /* From pc_i440fx_2_5_machine_options */
902636
+    x86mc->save_tsc_khz = false;
902636
+    m->legacy_fw_cfg_order = 1;
902636
+    /* Note: broken_reserved_end was already in 7.2 */
902636
+    /* From pc_i440fx_2_6_machine_options */
902636
+    pcmc->legacy_cpu_hotplug = true;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_2_compat, pc_rhel_7_2_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720,
902636
+                  pc_machine_rhel720_options);
902636
+
902636
+static void pc_compat_rhel710(MachineState *machine)
902636
+{
902636
+    PCMachineState *pcms = PC_MACHINE(machine);
902636
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
902636
+
902636
+    /* From pc_compat_2_2 */
902636
+    pcmc->rsdp_in_ram = false;
902636
+    machine->suppress_vmdesc = true;
902636
+
902636
+    /* From pc_compat_2_1 */
902636
+    pcmc->smbios_uuid_encoded = false;
902636
+    x86_cpu_change_kvm_default("svm", NULL);
902636
+    pcmc->enforce_aligned_dimm = false;
902636
+
902636
+    /* Disable all the extra subsections that were added in 2.2 */
902636
+    migrate_pre_2_2 = true;
902636
+
902636
+    /* From pc_i440fx_2_4_machine_options */
902636
+    pcmc->broken_reserved_end = true;
902636
+}
902636
+
902636
+static void pc_init_rhel710(MachineState *machine)
902636
+{
902636
+    pc_compat_rhel710(machine);
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel710_options(MachineClass *m)
902636
+{
902636
+    pc_machine_rhel720_options(m);
902636
+    m->family = "pc_piix_Y";
902636
+    m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)";
902636
+    m->default_display = "cirrus";
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_1, hw_compat_rhel_7_1_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_1_compat, pc_rhel_7_1_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
902636
+                  pc_machine_rhel710_options);
902636
+
902636
+static void pc_compat_rhel700(MachineState *machine)
902636
+{
902636
+    PCMachineState *pcms = PC_MACHINE(machine);
902636
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
902636
+
902636
+    pc_compat_rhel710(machine);
902636
+
902636
+    /* Upstream enables it for everyone, we're a little more selective */
902636
+    x86_cpu_change_kvm_default("x2apic", NULL);
902636
+    x86_cpu_change_kvm_default("svm", NULL);
902636
+    pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
902636
+    pcmc->smbios_legacy_mode = true;
902636
+    pcmc->has_reserved_memory = false;
902636
+    migrate_cve_2014_5263_xhci_fields = true;
902636
+}
902636
+
902636
+static void pc_init_rhel700(MachineState *machine)
902636
+{
902636
+    pc_compat_rhel700(machine);
902636
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
902636
+             TYPE_I440FX_PCI_DEVICE);
902636
+}
902636
+
902636
+static void pc_machine_rhel700_options(MachineClass *m)
902636
+{
902636
+    pc_machine_rhel710_options(m);
902636
+    m->family = "pc_piix_Y";
902636
+    m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
902636
+    compat_props_add(m->compat_props, pc_rhel_7_0_compat, pc_rhel_7_0_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
902636
+                  pc_machine_rhel700_options);
902636
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
60061b
index 235054a643..c67418b6a9 100644
902636
--- a/hw/i386/pc_q35.c
902636
+++ b/hw/i386/pc_q35.c
902636
@@ -197,8 +197,8 @@ static void pc_q35_init(MachineState *machine)
902636
 
902636
     if (pcmc->smbios_defaults) {
902636
         /* These values are guest ABI, do not change */
902636
-        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
902636
-                            mc->name, pcmc->smbios_legacy_mode,
902636
+        smbios_set_defaults("Red Hat", "KVM",
902636
+                            mc->desc, pcmc->smbios_legacy_mode,
902636
                             pcmc->smbios_uuid_encoded,
60061b
                             pcmc->smbios_stream_product,
60061b
                             pcmc->smbios_stream_version,
60061b
@@ -342,6 +342,7 @@ static void pc_q35_init(MachineState *machine)
902636
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
902636
 
902636
 
902636
+#if 0 /* Disabled for Red Hat Enterprise Linux */
902636
 static void pc_q35_machine_options(MachineClass *m)
902636
 {
902636
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
60061b
@@ -620,3 +621,232 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
902636
 
902636
 DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
902636
                    pc_q35_2_4_machine_options);
902636
+#endif  /* Disabled for Red Hat Enterprise Linux */
902636
+
902636
+/* Red Hat Enterprise Linux machine types */
902636
+
902636
+/* Options for the latest rhel q35 machine type */
902636
+static void pc_q35_machine_rhel_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pcmc->default_nic_model = "e1000e";
60061b
+    pcmc->pci_root_uid = 0;
902636
+    m->family = "pc_q35_Z";
902636
+    m->units_per_default_bus = 1;
60061b
+    m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
902636
+    m->default_display = "std";
902636
+    m->no_floppy = 1;
902636
+    m->no_parallel = 1;
902636
+    pcmc->default_cpu_version = 1;
902636
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
902636
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
902636
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
902636
+    m->alias = "q35";
60061b
+    m->max_cpus = 710;
902636
+    compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
902636
+}
902636
+
60061b
+static void pc_q35_init_rhel850(MachineState *machine)
60061b
+{
60061b
+    pc_q35_init(machine);
60061b
+}
60061b
+
60061b
+static void pc_q35_machine_rhel850_options(MachineClass *m)
60061b
+{
60061b
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
60061b
+    pc_q35_machine_rhel_options(m);
60061b
+    m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)";
60061b
+    pcmc->smbios_stream_product = "RHEL-AV";
60061b
+    pcmc->smbios_stream_version = "8.5.0";
60061b
+}
60061b
+
60061b
+DEFINE_PC_MACHINE(q35_rhel850, "pc-q35-rhel8.5.0", pc_q35_init_rhel850,
60061b
+                  pc_q35_machine_rhel850_options);
60061b
+
60061b
+
60061b
+static void pc_q35_init_rhel840(MachineState *machine)
60061b
+{
60061b
+    pc_q35_init(machine);
60061b
+}
60061b
+
60061b
+static void pc_q35_machine_rhel840_options(MachineClass *m)
60061b
+{
60061b
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
60061b
+    pc_q35_machine_rhel850_options(m);
60061b
+    m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)";
60061b
+    m->alias = NULL;
60061b
+    pcmc->smbios_stream_product = "RHEL-AV";
60061b
+    pcmc->smbios_stream_version = "8.4.0";
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_4,
60061b
+                     hw_compat_rhel_8_4_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_4_compat,
60061b
+                     pc_rhel_8_4_compat_len);
60061b
+}
60061b
+
60061b
+DEFINE_PC_MACHINE(q35_rhel840, "pc-q35-rhel8.4.0", pc_q35_init_rhel840,
60061b
+                  pc_q35_machine_rhel840_options);
60061b
+
60061b
+
60061b
+static void pc_q35_init_rhel830(MachineState *machine)
60061b
+{
60061b
+    pc_q35_init(machine);
60061b
+}
60061b
+
60061b
+static void pc_q35_machine_rhel830_options(MachineClass *m)
60061b
+{
60061b
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
60061b
+    pc_q35_machine_rhel840_options(m);
60061b
+    m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)";
60061b
+    pcmc->smbios_stream_product = "RHEL-AV";
60061b
+    pcmc->smbios_stream_version = "8.3.0";
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_3,
60061b
+                     hw_compat_rhel_8_3_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_3_compat,
60061b
+                     pc_rhel_8_3_compat_len);
60061b
+    /* From pc_q35_5_1_machine_options() */
60061b
+    pcmc->kvmclock_create_always = false;
60061b
+    /* From pc_q35_5_1_machine_options() */
60061b
+    pcmc->pci_root_uid = 1;
60061b
+}
60061b
+
60061b
+DEFINE_PC_MACHINE(q35_rhel830, "pc-q35-rhel8.3.0", pc_q35_init_rhel830,
60061b
+                  pc_q35_machine_rhel830_options);
60061b
+
902636
+static void pc_q35_init_rhel820(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel820_options(MachineClass *m)
902636
+{
60061b
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
60061b
+    pc_q35_machine_rhel830_options(m);
902636
+    m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
60061b
+    m->numa_mem_supported = true;
60061b
+    m->auto_enable_numa_with_memdev = false;
60061b
+    pcmc->smbios_stream_product = "RHEL-AV";
60061b
+    pcmc->smbios_stream_version = "8.2.0";
60061b
+    compat_props_add(m->compat_props, hw_compat_rhel_8_2,
60061b
+                     hw_compat_rhel_8_2_len);
60061b
+    compat_props_add(m->compat_props, pc_rhel_8_2_compat,
60061b
+                     pc_rhel_8_2_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel820, "pc-q35-rhel8.2.0", pc_q35_init_rhel820,
902636
+                  pc_q35_machine_rhel820_options);
902636
+
902636
+static void pc_q35_init_rhel810(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel810_options(MachineClass *m)
902636
+{
60061b
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_q35_machine_rhel820_options(m);
902636
+    m->desc = "RHEL-8.1.0 PC (Q35 + ICH9, 2009)";
902636
+    m->alias = NULL;
60061b
+    pcmc->smbios_stream_product = NULL;
60061b
+    pcmc->smbios_stream_version = NULL;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel810, "pc-q35-rhel8.1.0", pc_q35_init_rhel810,
902636
+                  pc_q35_machine_rhel810_options);
902636
+
902636
+static void pc_q35_init_rhel800(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel800_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_q35_machine_rhel810_options(m);
902636
+    m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)";
902636
+    m->smbus_no_migration_support = true;
902636
+    m->alias = NULL;
902636
+    pcmc->pvh_enabled = false;
902636
+    pcmc->default_cpu_version = CPU_VERSION_LEGACY;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel800, "pc-q35-rhel8.0.0", pc_q35_init_rhel800,
902636
+                  pc_q35_machine_rhel800_options);
902636
+
902636
+static void pc_q35_init_rhel760(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel760_options(MachineClass *m)
902636
+{
902636
+    pc_q35_machine_rhel800_options(m);
902636
+    m->alias = NULL;
902636
+    m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)";
902636
+    m->async_pf_vmexit_disable = true;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760,
902636
+                  pc_q35_machine_rhel760_options);
902636
+
902636
+static void pc_q35_init_rhel750(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel750_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_q35_machine_rhel760_options(m);
902636
+    m->alias = NULL;
902636
+    m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)";
902636
+    m->auto_enable_numa_with_memhp = false;
902636
+    pcmc->default_nic_model = "e1000";
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
902636
+                  pc_q35_machine_rhel750_options);
902636
+
902636
+static void pc_q35_init_rhel740(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel740_options(MachineClass *m)
902636
+{
902636
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
902636
+    pc_q35_machine_rhel750_options(m);
902636
+    m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
902636
+    pcmc->pc_rom_ro = false;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
902636
+                  pc_q35_machine_rhel740_options);
902636
+
902636
+static void pc_q35_init_rhel730(MachineState *machine)
902636
+{
902636
+    pc_q35_init(machine);
902636
+}
902636
+
902636
+static void pc_q35_machine_rhel730_options(MachineClass *m)
902636
+{
60061b
+    X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
902636
+    pc_q35_machine_rhel740_options(m);
902636
+    m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)";
902636
+    m->max_cpus = 255;
60061b
+    x86mc->fwcfg_dma_enabled = false;
902636
+    compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len);
902636
+    compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len);
902636
+}
902636
+
902636
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
902636
+                  pc_q35_machine_rhel730_options);
902636
diff --git a/include/hw/boards.h b/include/hw/boards.h
60061b
index 8bba96ef2b..04e8759815 100644
902636
--- a/include/hw/boards.h
902636
+++ b/include/hw/boards.h
60061b
@@ -263,6 +263,8 @@ struct MachineClass {
902636
     strList *allowed_dynamic_sysbus_devices;
902636
     bool auto_enable_numa_with_memhp;
60061b
     bool auto_enable_numa_with_memdev;
902636
+    /* RHEL only */
902636
+    bool async_pf_vmexit_disable;
902636
     bool ignore_boot_device_suffixes;
60061b
     bool smbus_no_migration_support;
60061b
     bool nvdimm_supported;
902636
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
60061b
index 7ccc9a1a07..d0544ee119 100644
902636
--- a/include/hw/i386/pc.h
902636
+++ b/include/hw/i386/pc.h
60061b
@@ -125,6 +125,9 @@ struct PCMachineClass {
902636
 
60061b
     /* create kvmclock device even when KVM PV features are not exposed */
60061b
     bool kvmclock_create_always;
60061b
+
902636
+    /* RH only, see bz 1489800 */
902636
+    bool pc_rom_ro;
60061b
 };
902636
 
902636
 #define TYPE_PC_MACHINE "generic-pc-machine"
60061b
@@ -280,6 +283,48 @@ extern const size_t pc_compat_1_5_len;
902636
 extern GlobalProperty pc_compat_1_4[];
902636
 extern const size_t pc_compat_1_4_len;
902636
 
902636
+extern GlobalProperty pc_rhel_compat[];
902636
+extern const size_t pc_rhel_compat_len;
902636
+
60061b
+extern GlobalProperty pc_rhel_8_4_compat[];
60061b
+extern const size_t pc_rhel_8_4_compat_len;
60061b
+
60061b
+extern GlobalProperty pc_rhel_8_3_compat[];
60061b
+extern const size_t pc_rhel_8_3_compat_len;
60061b
+
60061b
+extern GlobalProperty pc_rhel_8_2_compat[];
60061b
+extern const size_t pc_rhel_8_2_compat_len;
60061b
+
902636
+extern GlobalProperty pc_rhel_8_1_compat[];
902636
+extern const size_t pc_rhel_8_1_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_8_0_compat[];
902636
+extern const size_t pc_rhel_8_0_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_6_compat[];
902636
+extern const size_t pc_rhel_7_6_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_5_compat[];
902636
+extern const size_t pc_rhel_7_5_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_4_compat[];
902636
+extern const size_t pc_rhel_7_4_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_3_compat[];
902636
+extern const size_t pc_rhel_7_3_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_2_compat[];
902636
+extern const size_t pc_rhel_7_2_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_1_compat[];
902636
+extern const size_t pc_rhel_7_1_compat_len;
902636
+
902636
+extern GlobalProperty pc_rhel_7_0_compat[];
902636
+extern const size_t pc_rhel_7_0_compat_len;
902636
+
60061b
+extern GlobalProperty hw_compat_4_2_extra[];
60061b
+extern const size_t hw_compat_4_2_extra_len;
60061b
+
902636
 /* Helper for setting model-id for CPU models that changed model-id
902636
  * depending on QEMU versions up to QEMU 2.4.
902636
  */
60061b
diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c
60061b
index d95028018e..7b004065ae 100644
60061b
--- a/target/i386/kvm/kvm-cpu.c
60061b
+++ b/target/i386/kvm/kvm-cpu.c
60061b
@@ -131,6 +131,7 @@ static PropValue kvm_default_props[] = {
902636
     { "acpi", "off" },
902636
     { "monitor", "off" },
902636
     { "svm", "off" },
902636
+    { "kvm-pv-unhalt", "on" },
902636
     { NULL, NULL },
902636
 };
902636
 
60061b
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
60061b
index 5a698bde19..a668f521ac 100644
60061b
--- a/target/i386/kvm/kvm.c
60061b
+++ b/target/i386/kvm/kvm.c
60061b
@@ -3336,6 +3336,7 @@ static int kvm_get_msrs(X86CPU *cpu)
902636
     struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries;
902636
     int ret, i;
902636
     uint64_t mtrr_top_bits;
902636
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
902636
 
902636
     kvm_msr_buf_reset(cpu);
902636
 
60061b
@@ -3665,6 +3666,9 @@ static int kvm_get_msrs(X86CPU *cpu)
902636
             break;
902636
         case MSR_KVM_ASYNC_PF_EN:
902636
             env->async_pf_en_msr = msrs[i].data;
902636
+            if (mc->async_pf_vmexit_disable) {
902636
+                env->async_pf_en_msr &= ~(1ULL << 2);
902636
+            }
902636
             break;
60061b
         case MSR_KVM_ASYNC_PF_INT:
60061b
             env->async_pf_int_msr = msrs[i].data;
60061b
diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c
60061b
index 6dcad2db49..580c2c43d2 100644
60061b
--- a/tests/qtest/pvpanic-test.c
60061b
+++ b/tests/qtest/pvpanic-test.c
60061b
@@ -17,7 +17,7 @@ static void test_panic_nopause(void)
60061b
     QDict *response, *data;
60061b
     QTestState *qts;
60061b
 
60061b
-    qts = qtest_init("-device pvpanic -action panic=none");
60061b
+    qts = qtest_init("-M q35 -device pvpanic -action panic=none");
60061b
 
60061b
     val = qtest_inb(qts, 0x505);
60061b
     g_assert_cmpuint(val, ==, 3);
60061b
@@ -40,7 +40,8 @@ static void test_panic(void)
60061b
     QDict *response, *data;
60061b
     QTestState *qts;
60061b
 
60061b
-    qts = qtest_init("-device pvpanic -action panic=pause");
60061b
+    /* RHEL: Use q35 */
60061b
+    qts = qtest_init("-M q35 -device pvpanic -action panic=pause");
60061b
 
60061b
     val = qtest_inb(qts, 0x505);
60061b
     g_assert_cmpuint(val, ==, 3);
902636
-- 
60061b
2.27.0
902636