ed5979
From 0935624ccdddc286d6eeeb0c1b70d78983c21aa2 Mon Sep 17 00:00:00 2001
495e37
From: Miroslav Rezanina <mrezanin@redhat.com>
495e37
Date: Fri, 19 Oct 2018 13:10:31 +0200
495e37
Subject: Add x86_64 machine types
495e37
495e37
Adding changes to add RHEL machine types for x86_64 architecture.
495e37
495e37
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
495e37
Rebase notes (6.1.0):
495e37
- Update qemu64 cpu spec
495e37
586cba
Rebase notes (7.0.0):
586cba
- Reset alias for all machine-types except latest one
586cba
495e37
Merged patches (6.1.0):
495e37
- 59c284ad3b x86: Add x86 rhel8.5 machine types
495e37
- a8868b42fe redhat: x86: Enable 'kvm-asyncpf-int' by default
495e37
- a3995e2eff Remove RHEL 7.0.0 machine type (only x86_64 changes)
495e37
- ad3190a79b Remove RHEL 7.1.0 machine type (only x86_64 changes)
495e37
- 84bbe15d4e Remove RHEL 7.2.0 machine type (only x86_64 changes)
495e37
- 0215eb3356 Remove RHEL 7.3.0 machine types (only x86_64 changes)
495e37
- af69d1ca6e Remove RHEL 7.4.0 machine types (only x86_64 changes)
495e37
- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only x86_64 changes)
586cba
586cba
Merged patches (7.0.0):
586cba
- eae7d8dd3c x86/rhel machine types: Add pc_rhel_8_5_compat
586cba
- 6762f56469 x86/rhel machine types: Wire compat into q35 and i440fx
586cba
- 5762101438 rhel machine types/x86: set prefer_sockets
586cba
- 9ba9ddc632 x86: Add q35 RHEL 8.6.0 machine type
586cba
- 6110d865e5 x86: Add q35 RHEL 9.0.0 machine type
586cba
- dcc64971bf RHEL: mark old machine types as deprecated (partialy)
586cba
- 6b396f182b RHEL: disable "seqpacket" for "vhost-vsock-device" in rhel8.6.0
ed5979
ed5979
Merged patches (7.1.0 rc0):
ed5979
-  38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/i386/pc.c chunk)
ed5979
-  1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (x86_64 specific changes)
ed5979
- 35b5c8554f target/i386: deprecate CPUs older than x86_64-v2 ABI
ed5979
ed5979
Merged patches (7.2.0 rc0):
ed5979
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
495e37
---
ed5979
 hw/i386/pc.c               | 147 ++++++++++++++++++++++-
ed5979
 hw/i386/pc_piix.c          |  86 +++++++++++++-
ed5979
 hw/i386/pc_q35.c           | 234 ++++++++++++++++++++++++++++++++++++-
586cba
 hw/s390x/s390-virtio-ccw.c |   1 +
ed5979
 include/hw/boards.h        |   2 +
ed5979
 include/hw/i386/pc.h       |  27 +++++
ed5979
 target/i386/cpu.c          |  21 ++++
495e37
 target/i386/kvm/kvm-cpu.c  |   1 +
495e37
 target/i386/kvm/kvm.c      |   4 +
495e37
 tests/qtest/pvpanic-test.c |   5 +-
ed5979
 10 files changed, 521 insertions(+), 7 deletions(-)
495e37
495e37
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
ed5979
index 546b703cb4..c7b1350e64 100644
495e37
--- a/hw/i386/pc.c
495e37
+++ b/hw/i386/pc.c
ed5979
@@ -393,6 +393,149 @@ GlobalProperty pc_compat_1_4[] = {
495e37
 };
495e37
 const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
495e37
 
495e37
+/* This macro is for changes to properties that are RHEL specific,
495e37
+ * different to the current upstream and to be applied to the latest
495e37
+ * machine type.
495e37
+ */
495e37
+GlobalProperty pc_rhel_compat[] = {
ed5979
+    /* we don't support s3/s4 suspend */
ed5979
+    { "PIIX4_PM", "disable_s3", "1" },
ed5979
+    { "PIIX4_PM", "disable_s4", "1" },
ed5979
+    { "ICH9-LPC", "disable_s3", "1" },
ed5979
+    { "ICH9-LPC", "disable_s4", "1" },
ed5979
+
495e37
+    { TYPE_X86_CPU, "host-phys-bits", "on" },
495e37
+    { TYPE_X86_CPU, "host-phys-bits-limit", "48" },
495e37
+    { TYPE_X86_CPU, "vmx-entry-load-perf-global-ctrl", "off" },
495e37
+    { TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" },
495e37
+    /* bz 1508330 */ 
495e37
+    { "vfio-pci", "x-no-geforce-quirks", "on" },
495e37
+    /* bz 1941397 */
495e37
+    { TYPE_X86_CPU, "kvm-asyncpf-int", "on" },
495e37
+};
495e37
+const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
495e37
+
ed5979
+GlobalProperty pc_rhel_9_0_compat[] = {
ed5979
+    /* pc_rhel_9_0_compat from pc_compat_6_2 */
ed5979
+    { "virtio-mem", "unplugged-inaccessible", "off" },
ed5979
+};
ed5979
+const size_t pc_rhel_9_0_compat_len = G_N_ELEMENTS(pc_rhel_9_0_compat);
ed5979
+
586cba
+GlobalProperty pc_rhel_8_5_compat[] = {
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_0 */
586cba
+    { "qemu64" "-" TYPE_X86_CPU, "family", "6" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_0 */
586cba
+    { "qemu64" "-" TYPE_X86_CPU, "model", "6" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_0 */
586cba
+    { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_0 */
586cba
+    { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_0 */
586cba
+    { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" },
586cba
+
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_1 */
586cba
+    { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_1 */
586cba
+    { TYPE_X86_CPU, "hv-version-id-major", "0x0006" },
586cba
+    /* pc_rhel_8_5_compat from pc_compat_6_1 */
586cba
+    { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" },
586cba
+};
586cba
+const size_t pc_rhel_8_5_compat_len = G_N_ELEMENTS(pc_rhel_8_5_compat);
586cba
+
495e37
+GlobalProperty pc_rhel_8_4_compat[] = {
495e37
+    /* pc_rhel_8_4_compat from pc_compat_5_2 */
495e37
+    { "ICH9-LPC", "x-smi-cpu-hotunplug", "off" },
495e37
+    { TYPE_X86_CPU, "kvm-asyncpf-int", "off" },
495e37
+};
495e37
+const size_t pc_rhel_8_4_compat_len = G_N_ELEMENTS(pc_rhel_8_4_compat);
495e37
+
495e37
+GlobalProperty pc_rhel_8_3_compat[] = {
495e37
+    /* pc_rhel_8_3_compat from pc_compat_5_1 */
495e37
+    { "ICH9-LPC", "x-smi-cpu-hotplug", "off" },
495e37
+};
495e37
+const size_t pc_rhel_8_3_compat_len = G_N_ELEMENTS(pc_rhel_8_3_compat);
495e37
+
495e37
+GlobalProperty pc_rhel_8_2_compat[] = {
495e37
+    /* pc_rhel_8_2_compat from pc_compat_4_2 */
495e37
+    { "mch", "smbase-smram", "off" },
495e37
+};
495e37
+const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat);
495e37
+
495e37
+/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */
495e37
+GlobalProperty pc_rhel_8_1_compat[] = { };
495e37
+const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat);
495e37
+
495e37
+GlobalProperty pc_rhel_8_0_compat[] = {
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "intel-iommu", "dma-drain", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G4" "-" TYPE_X86_CPU, "npt", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G4" "-" TYPE_X86_CPU, "nrip-save", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G5" "-" TYPE_X86_CPU, "npt", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Opteron_G5" "-" TYPE_X86_CPU, "nrip-save", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "EPYC" "-" TYPE_X86_CPU, "npt", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "EPYC" "-" TYPE_X86_CPU, "nrip-save", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "EPYC-IBPB" "-" TYPE_X86_CPU, "npt", "off" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "EPYC-IBPB" "-" TYPE_X86_CPU, "nrip-save", "off" },
495e37
+    /** The mpx=on entries from pc_compat_3_1 are in pc_rhel_7_6_compat **/
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" },
495e37
+    /* pc_rhel_8_0_compat from pc_compat_3_1 */
495e37
+    { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" },
495e37
+};
495e37
+const size_t pc_rhel_8_0_compat_len = G_N_ELEMENTS(pc_rhel_8_0_compat);
495e37
+
495e37
+/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but:
495e37
+ * all of the 2_12 stuff was already in 7.6 from bz 1481253
495e37
+ * x-migrate-smi-count comes from PC_COMPAT_2_11 but
495e37
+ * is really tied to kernel version so keep it off on 7.x
495e37
+ * machine types irrespective of host.
495e37
+ */
495e37
+GlobalProperty pc_rhel_7_6_compat[] = {
495e37
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
495e37
+    { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
495e37
+    { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_3_0 */ 
495e37
+    { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { TYPE_X86_CPU, "x-migrate-smi-count", "off" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Skylake-Client" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Skylake-Client-IBRS" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Skylake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Cascadelake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+    /* pc_rhel_7_6_compat from pc_compat_2_11 */ 
495e37
+    { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" },
495e37
+};
495e37
+const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat);
495e37
+
495e37
+/*
495e37
+ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
495e37
+ * types as the PC_COMPAT_* do for upstream types.
495e37
+ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
495e37
+ */
495e37
+
495e37
 GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
495e37
 {
495e37
     GSIState *s;
ed5979
@@ -1907,6 +2050,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
495e37
     pcmc->pvh_enabled = true;
495e37
     pcmc->kvmclock_create_always = true;
495e37
     assert(!mc->get_hotplug_handler);
495e37
+    mc->async_pf_vmexit_disable = false;
495e37
     mc->get_hotplug_handler = pc_get_hotplug_handler;
495e37
     mc->hotplug_allowed = pc_hotplug_allowed;
495e37
     mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
ed5979
@@ -1917,7 +2061,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
495e37
     mc->has_hotpluggable_cpus = true;
495e37
     mc->default_boot_order = "cad";
495e37
     mc->block_default_type = IF_IDE;
495e37
-    mc->max_cpus = 255;
495e37
+    /* 240: max CPU count for RHEL */
495e37
+    mc->max_cpus = 240;
495e37
     mc->reset = pc_machine_reset;
495e37
     mc->wakeup = pc_machine_wakeup;
495e37
     hc->pre_plug = pc_machine_device_pre_plug_cb;
495e37
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
ed5979
index 0985ff67d2..173a1fd10b 100644
495e37
--- a/hw/i386/pc_piix.c
495e37
+++ b/hw/i386/pc_piix.c
ed5979
@@ -53,6 +53,7 @@
495e37
 #include "qapi/error.h"
495e37
 #include "qemu/error-report.h"
495e37
 #include "sysemu/xen.h"
495e37
+#include "migration/migration.h"
495e37
 #ifdef CONFIG_XEN
495e37
 #include <xen/hvm/hvm_info_table.h>
495e37
 #include "hw/xen/xen_pt.h"
ed5979
@@ -184,8 +185,8 @@ static void pc_init1(MachineState *machine,
495e37
     if (pcmc->smbios_defaults) {
495e37
         MachineClass *mc = MACHINE_GET_CLASS(machine);
495e37
         /* These values are guest ABI, do not change */
495e37
-        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
495e37
-                            mc->name, pcmc->smbios_legacy_mode,
495e37
+        smbios_set_defaults("Red Hat", "KVM",
495e37
+                            mc->desc, pcmc->smbios_legacy_mode,
495e37
                             pcmc->smbios_uuid_encoded,
495e37
                             pcmc->smbios_stream_product,
495e37
                             pcmc->smbios_stream_version,
ed5979
@@ -334,6 +335,7 @@ static void pc_init1(MachineState *machine,
495e37
  * hw_compat_*, pc_compat_*, or * pc_*_machine_options().
495e37
  */
495e37
 
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
 static void pc_compat_2_3_fn(MachineState *machine)
495e37
 {
495e37
     X86MachineState *x86ms = X86_MACHINE(machine);
ed5979
@@ -896,3 +898,83 @@ static void xenfv_3_1_machine_options(MachineClass *m)
495e37
 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
495e37
                   xenfv_3_1_machine_options);
495e37
 #endif
495e37
+#endif  /* Disabled for Red Hat Enterprise Linux */
495e37
+
495e37
+/* Red Hat Enterprise Linux machine types */
495e37
+
495e37
+/* Options for the latest rhel7 machine type */
495e37
+static void pc_machine_rhel7_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    m->family = "pc_piix_Y";
495e37
+    m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
495e37
+    pcmc->default_nic_model = "e1000";
495e37
+    pcmc->pci_root_uid = 0;
495e37
+    m->default_display = "std";
495e37
+    m->no_parallel = 1;
495e37
+    m->numa_mem_supported = true;
495e37
+    m->auto_enable_numa_with_memdev = false;
495e37
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
495e37
+    compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
495e37
+    m->alias = "pc";
495e37
+    m->is_default = 1;
586cba
+    m->smp_props.prefer_sockets = true;
495e37
+}
495e37
+
495e37
+static void pc_init_rhel760(MachineState *machine)
495e37
+{
495e37
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
495e37
+             TYPE_I440FX_PCI_DEVICE);
495e37
+}
495e37
+
495e37
+static void pc_machine_rhel760_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_machine_rhel7_options(m);
495e37
+    m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
495e37
+    m->async_pf_vmexit_disable = true;
495e37
+    m->smbus_no_migration_support = true;
586cba
+
586cba
+    /* All RHEL machines for prior major releases are deprecated */
586cba
+    m->deprecation_reason = rhel_old_machine_deprecation;
586cba
+
495e37
+    pcmc->pvh_enabled = false;
495e37
+    pcmc->default_cpu_version = CPU_VERSION_LEGACY;
495e37
+    pcmc->kvmclock_create_always = false;
495e37
+    /* From pc_i440fx_5_1_machine_options() */
495e37
+    pcmc->pci_root_uid = 1;
ed5979
+    pcmc->legacy_no_rng_seed = true;
ed5979
+    compat_props_add(m->compat_props, hw_compat_rhel_9_1,
ed5979
+                     hw_compat_rhel_9_1_len);
ed5979
+    compat_props_add(m->compat_props, hw_compat_rhel_9_0,
ed5979
+                     hw_compat_rhel_9_0_len);
ed5979
+    compat_props_add(m->compat_props, pc_rhel_9_0_compat,
ed5979
+                     pc_rhel_9_0_compat_len);
586cba
+    compat_props_add(m->compat_props, hw_compat_rhel_8_6,
586cba
+                     hw_compat_rhel_8_6_len);
586cba
+    compat_props_add(m->compat_props, hw_compat_rhel_8_5,
586cba
+                     hw_compat_rhel_8_5_len);
586cba
+    compat_props_add(m->compat_props, pc_rhel_8_5_compat,
586cba
+                     pc_rhel_8_5_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_4,
495e37
+                     hw_compat_rhel_8_4_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_4_compat,
495e37
+                     pc_rhel_8_4_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_3,
495e37
+                     hw_compat_rhel_8_3_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_3_compat,
495e37
+                     pc_rhel_8_3_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_2,
495e37
+                     hw_compat_rhel_8_2_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_2_compat,
495e37
+                     pc_rhel_8_2_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len);
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760,
495e37
+                  pc_machine_rhel760_options);
495e37
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
ed5979
index ea582254e3..97c3630021 100644
495e37
--- a/hw/i386/pc_q35.c
495e37
+++ b/hw/i386/pc_q35.c
ed5979
@@ -198,8 +198,8 @@ static void pc_q35_init(MachineState *machine)
495e37
 
495e37
     if (pcmc->smbios_defaults) {
495e37
         /* These values are guest ABI, do not change */
495e37
-        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
495e37
-                            mc->name, pcmc->smbios_legacy_mode,
495e37
+        smbios_set_defaults("Red Hat", "KVM",
495e37
+                            mc->desc, pcmc->smbios_legacy_mode,
495e37
                             pcmc->smbios_uuid_encoded,
495e37
                             pcmc->smbios_stream_product,
495e37
                             pcmc->smbios_stream_version,
ed5979
@@ -352,6 +352,7 @@ static void pc_q35_init(MachineState *machine)
495e37
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
495e37
 
495e37
 
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
 static void pc_q35_machine_options(MachineClass *m)
495e37
 {
495e37
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ed5979
@@ -666,3 +667,232 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
495e37
 
495e37
 DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
495e37
                    pc_q35_2_4_machine_options);
495e37
+#endif  /* Disabled for Red Hat Enterprise Linux */
495e37
+
495e37
+/* Red Hat Enterprise Linux machine types */
495e37
+
495e37
+/* Options for the latest rhel q35 machine type */
495e37
+static void pc_q35_machine_rhel_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pcmc->default_nic_model = "e1000e";
495e37
+    pcmc->pci_root_uid = 0;
495e37
+    m->family = "pc_q35_Z";
495e37
+    m->units_per_default_bus = 1;
495e37
+    m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
495e37
+    m->default_display = "std";
495e37
+    m->no_floppy = 1;
495e37
+    m->no_parallel = 1;
495e37
+    pcmc->default_cpu_version = 1;
495e37
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
495e37
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
495e37
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
495e37
+    m->alias = "q35";
495e37
+    m->max_cpus = 710;
495e37
+    compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
495e37
+}
495e37
+
586cba
+static void pc_q35_init_rhel900(MachineState *machine)
586cba
+{
586cba
+    pc_q35_init(machine);
586cba
+}
586cba
+
586cba
+static void pc_q35_machine_rhel900_options(MachineClass *m)
586cba
+{
586cba
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
586cba
+    pc_q35_machine_rhel_options(m);
586cba
+    m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)";
586cba
+    pcmc->smbios_stream_product = "RHEL";
586cba
+    pcmc->smbios_stream_version = "9.0.0";
ed5979
+    pcmc->legacy_no_rng_seed = true;
ed5979
+    compat_props_add(m->compat_props, hw_compat_rhel_9_1,
ed5979
+                     hw_compat_rhel_9_1_len);
ed5979
+    compat_props_add(m->compat_props, hw_compat_rhel_9_0,
ed5979
+                     hw_compat_rhel_9_0_len);
ed5979
+    compat_props_add(m->compat_props, pc_rhel_9_0_compat,
ed5979
+                     pc_rhel_9_0_compat_len);
586cba
+}
586cba
+
586cba
+DEFINE_PC_MACHINE(q35_rhel900, "pc-q35-rhel9.0.0", pc_q35_init_rhel900,
586cba
+                  pc_q35_machine_rhel900_options);
586cba
+
586cba
+static void pc_q35_init_rhel860(MachineState *machine)
586cba
+{
586cba
+    pc_q35_init(machine);
586cba
+}
586cba
+
586cba
+static void pc_q35_machine_rhel860_options(MachineClass *m)
586cba
+{
586cba
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
586cba
+    pc_q35_machine_rhel900_options(m);
586cba
+    m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
586cba
+    m->alias = NULL;
586cba
+
586cba
+    /* All RHEL machines for prior major releases are deprecated */
586cba
+    m->deprecation_reason = rhel_old_machine_deprecation;
586cba
+
586cba
+    pcmc->smbios_stream_product = "RHEL-AV";
586cba
+    pcmc->smbios_stream_version = "8.6.0";
586cba
+    compat_props_add(m->compat_props, hw_compat_rhel_8_6,
586cba
+                     hw_compat_rhel_8_6_len);
586cba
+}
586cba
+
586cba
+DEFINE_PC_MACHINE(q35_rhel860, "pc-q35-rhel8.6.0", pc_q35_init_rhel860,
586cba
+                  pc_q35_machine_rhel860_options);
586cba
+
586cba
+
495e37
+static void pc_q35_init_rhel850(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel850_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
586cba
+    pc_q35_machine_rhel860_options(m);
495e37
+    m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)";
586cba
+    m->alias = NULL;
495e37
+    pcmc->smbios_stream_product = "RHEL-AV";
495e37
+    pcmc->smbios_stream_version = "8.5.0";
586cba
+    compat_props_add(m->compat_props, hw_compat_rhel_8_5,
586cba
+                     hw_compat_rhel_8_5_len);
586cba
+    compat_props_add(m->compat_props, pc_rhel_8_5_compat,
586cba
+                     pc_rhel_8_5_compat_len);
586cba
+    m->smp_props.prefer_sockets = true;
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel850, "pc-q35-rhel8.5.0", pc_q35_init_rhel850,
495e37
+                  pc_q35_machine_rhel850_options);
495e37
+
495e37
+
495e37
+static void pc_q35_init_rhel840(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel840_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_q35_machine_rhel850_options(m);
495e37
+    m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)";
495e37
+    m->alias = NULL;
495e37
+    pcmc->smbios_stream_product = "RHEL-AV";
495e37
+    pcmc->smbios_stream_version = "8.4.0";
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_4,
495e37
+                     hw_compat_rhel_8_4_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_4_compat,
495e37
+                     pc_rhel_8_4_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel840, "pc-q35-rhel8.4.0", pc_q35_init_rhel840,
495e37
+                  pc_q35_machine_rhel840_options);
495e37
+
495e37
+
495e37
+static void pc_q35_init_rhel830(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel830_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_q35_machine_rhel840_options(m);
495e37
+    m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)";
586cba
+    m->alias = NULL;
495e37
+    pcmc->smbios_stream_product = "RHEL-AV";
495e37
+    pcmc->smbios_stream_version = "8.3.0";
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_3,
495e37
+                     hw_compat_rhel_8_3_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_3_compat,
495e37
+                     pc_rhel_8_3_compat_len);
495e37
+    /* From pc_q35_5_1_machine_options() */
495e37
+    pcmc->kvmclock_create_always = false;
495e37
+    /* From pc_q35_5_1_machine_options() */
495e37
+    pcmc->pci_root_uid = 1;
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel830, "pc-q35-rhel8.3.0", pc_q35_init_rhel830,
495e37
+                  pc_q35_machine_rhel830_options);
495e37
+
495e37
+static void pc_q35_init_rhel820(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel820_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_q35_machine_rhel830_options(m);
495e37
+    m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
586cba
+    m->alias = NULL;
495e37
+    m->numa_mem_supported = true;
495e37
+    m->auto_enable_numa_with_memdev = false;
495e37
+    pcmc->smbios_stream_product = "RHEL-AV";
495e37
+    pcmc->smbios_stream_version = "8.2.0";
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_2,
495e37
+                     hw_compat_rhel_8_2_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_2_compat,
495e37
+                     pc_rhel_8_2_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel820, "pc-q35-rhel8.2.0", pc_q35_init_rhel820,
495e37
+                  pc_q35_machine_rhel820_options);
495e37
+
495e37
+static void pc_q35_init_rhel810(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel810_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_q35_machine_rhel820_options(m);
495e37
+    m->desc = "RHEL-8.1.0 PC (Q35 + ICH9, 2009)";
495e37
+    m->alias = NULL;
495e37
+    pcmc->smbios_stream_product = NULL;
495e37
+    pcmc->smbios_stream_version = NULL;
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel810, "pc-q35-rhel8.1.0", pc_q35_init_rhel810,
495e37
+                  pc_q35_machine_rhel810_options);
495e37
+
495e37
+static void pc_q35_init_rhel800(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel800_options(MachineClass *m)
495e37
+{
495e37
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
495e37
+    pc_q35_machine_rhel810_options(m);
495e37
+    m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)";
495e37
+    m->smbus_no_migration_support = true;
495e37
+    m->alias = NULL;
495e37
+    pcmc->pvh_enabled = false;
495e37
+    pcmc->default_cpu_version = CPU_VERSION_LEGACY;
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel800, "pc-q35-rhel8.0.0", pc_q35_init_rhel800,
495e37
+                  pc_q35_machine_rhel800_options);
495e37
+
495e37
+static void pc_q35_init_rhel760(MachineState *machine)
495e37
+{
495e37
+    pc_q35_init(machine);
495e37
+}
495e37
+
495e37
+static void pc_q35_machine_rhel760_options(MachineClass *m)
495e37
+{
495e37
+    pc_q35_machine_rhel800_options(m);
495e37
+    m->alias = NULL;
495e37
+    m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)";
495e37
+    m->async_pf_vmexit_disable = true;
495e37
+    compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
495e37
+    compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len);
495e37
+}
495e37
+
495e37
+DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760,
495e37
+                  pc_q35_machine_rhel760_options);
586cba
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
ed5979
index 8d5221fbb1..ba640e3d9e 100644
586cba
--- a/hw/s390x/s390-virtio-ccw.c
586cba
+++ b/hw/s390x/s390-virtio-ccw.c
ed5979
@@ -1213,6 +1213,7 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
586cba
 static void ccw_machine_rhel860_class_options(MachineClass *mc)
586cba
 {
586cba
     ccw_machine_rhel900_class_options(mc);
586cba
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_6, hw_compat_rhel_8_6_len);
586cba
 
586cba
     /* All RHEL machines for prior major releases are deprecated */
586cba
     mc->deprecation_reason = rhel_old_machine_deprecation;
495e37
diff --git a/include/hw/boards.h b/include/hw/boards.h
ed5979
index 2209d4e416..fd75f551b1 100644
495e37
--- a/include/hw/boards.h
495e37
+++ b/include/hw/boards.h
586cba
@@ -266,6 +266,8 @@ struct MachineClass {
495e37
     strList *allowed_dynamic_sysbus_devices;
495e37
     bool auto_enable_numa_with_memhp;
495e37
     bool auto_enable_numa_with_memdev;
495e37
+    /* RHEL only */
495e37
+    bool async_pf_vmexit_disable;
495e37
     bool ignore_boot_device_suffixes;
495e37
     bool smbus_no_migration_support;
495e37
     bool nvdimm_supported;
495e37
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
ed5979
index 3754eaa97d..4266fe2fdb 100644
495e37
--- a/include/hw/i386/pc.h
495e37
+++ b/include/hw/i386/pc.h
ed5979
@@ -293,6 +293,33 @@ extern const size_t pc_compat_1_5_len;
495e37
 extern GlobalProperty pc_compat_1_4[];
495e37
 extern const size_t pc_compat_1_4_len;
495e37
 
495e37
+extern GlobalProperty pc_rhel_compat[];
495e37
+extern const size_t pc_rhel_compat_len;
495e37
+
ed5979
+extern GlobalProperty pc_rhel_9_0_compat[];
ed5979
+extern const size_t pc_rhel_9_0_compat_len;
ed5979
+
586cba
+extern GlobalProperty pc_rhel_8_5_compat[];
586cba
+extern const size_t pc_rhel_8_5_compat_len;
586cba
+
495e37
+extern GlobalProperty pc_rhel_8_4_compat[];
495e37
+extern const size_t pc_rhel_8_4_compat_len;
495e37
+
495e37
+extern GlobalProperty pc_rhel_8_3_compat[];
495e37
+extern const size_t pc_rhel_8_3_compat_len;
495e37
+
495e37
+extern GlobalProperty pc_rhel_8_2_compat[];
495e37
+extern const size_t pc_rhel_8_2_compat_len;
495e37
+
495e37
+extern GlobalProperty pc_rhel_8_1_compat[];
495e37
+extern const size_t pc_rhel_8_1_compat_len;
495e37
+
495e37
+extern GlobalProperty pc_rhel_8_0_compat[];
495e37
+extern const size_t pc_rhel_8_0_compat_len;
495e37
+
495e37
+extern GlobalProperty pc_rhel_7_6_compat[];
495e37
+extern const size_t pc_rhel_7_6_compat_len;
495e37
+
ed5979
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
ed5979
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
ed5979
     { \
ed5979
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ed5979
index 22b681ca37..f7c526cbe6 100644
ed5979
--- a/target/i386/cpu.c
ed5979
+++ b/target/i386/cpu.c
ed5979
@@ -1832,9 +1832,13 @@ static const CPUCaches epyc_milan_cache_info = {
ed5979
  *  PT in VMX operation
495e37
  */
ed5979
 
ed5979
+#define RHEL_CPU_DEPRECATION \
ed5979
+    "use at least 'Nehalem' / 'Opteron_G4', or 'host' / 'max'"
ed5979
+
ed5979
 static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     {
ed5979
         .name = "qemu64",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 0xd,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 15,
ed5979
@@ -1855,6 +1859,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "phenom",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 5,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 16,
ed5979
@@ -1887,6 +1892,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "core2duo",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 10,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -1929,6 +1935,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "kvm64",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 0xd,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 15,
ed5979
@@ -1970,6 +1977,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "qemu32",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 4,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -1984,6 +1992,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "kvm32",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 5,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 15,
ed5979
@@ -2014,6 +2023,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "coreduo",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 10,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -2047,6 +2057,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "486",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 1,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 4,
ed5979
@@ -2059,6 +2070,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "pentium",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 1,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 5,
ed5979
@@ -2071,6 +2083,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "pentium2",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 2,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -2083,6 +2096,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "pentium3",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 3,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -2095,6 +2109,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "athlon",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 2,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 6,
ed5979
@@ -2110,6 +2125,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "n270",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 10,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -2135,6 +2151,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "Conroe",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 10,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -2175,6 +2192,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "Penryn",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 10,
ed5979
         .vendor = CPUID_VENDOR_INTEL,
ed5979
         .family = 6,
ed5979
@@ -3762,6 +3780,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "Opteron_G1",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 5,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 15,
ed5979
@@ -3782,6 +3801,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "Opteron_G2",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 5,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 15,
ed5979
@@ -3804,6 +3824,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
ed5979
     },
ed5979
     {
ed5979
         .name = "Opteron_G3",
ed5979
+        .deprecation_note = RHEL_CPU_DEPRECATION,
ed5979
         .level = 5,
ed5979
         .vendor = CPUID_VENDOR_AMD,
ed5979
         .family = 16,
495e37
diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c
ed5979
index 7237378a7d..7b8a3d5af0 100644
495e37
--- a/target/i386/kvm/kvm-cpu.c
495e37
+++ b/target/i386/kvm/kvm-cpu.c
586cba
@@ -137,6 +137,7 @@ static PropValue kvm_default_props[] = {
495e37
     { "acpi", "off" },
495e37
     { "monitor", "off" },
495e37
     { "svm", "off" },
495e37
+    { "kvm-pv-unhalt", "on" },
495e37
     { NULL, NULL },
495e37
 };
495e37
 
495e37
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
ed5979
index a213209379..81526a1575 100644
495e37
--- a/target/i386/kvm/kvm.c
495e37
+++ b/target/i386/kvm/kvm.c
ed5979
@@ -3707,6 +3707,7 @@ static int kvm_get_msrs(X86CPU *cpu)
495e37
     struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries;
495e37
     int ret, i;
495e37
     uint64_t mtrr_top_bits;
495e37
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
495e37
 
495e37
     kvm_msr_buf_reset(cpu);
495e37
 
ed5979
@@ -4062,6 +4063,9 @@ static int kvm_get_msrs(X86CPU *cpu)
495e37
             break;
495e37
         case MSR_KVM_ASYNC_PF_EN:
495e37
             env->async_pf_en_msr = msrs[i].data;
495e37
+            if (mc->async_pf_vmexit_disable) {
495e37
+                env->async_pf_en_msr &= ~(1ULL << 2);
495e37
+            }
495e37
             break;
495e37
         case MSR_KVM_ASYNC_PF_INT:
495e37
             env->async_pf_int_msr = msrs[i].data;
495e37
diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c
ed5979
index bc7b7dfc39..96e6dee3a1 100644
495e37
--- a/tests/qtest/pvpanic-test.c
495e37
+++ b/tests/qtest/pvpanic-test.c
495e37
@@ -17,7 +17,7 @@ static void test_panic_nopause(void)
495e37
     QDict *response, *data;
495e37
     QTestState *qts;
495e37
 
495e37
-    qts = qtest_init("-device pvpanic -action panic=none");
495e37
+    qts = qtest_init("-M q35 -device pvpanic -action panic=none");
495e37
 
495e37
     val = qtest_inb(qts, 0x505);
495e37
     g_assert_cmpuint(val, ==, 3);
495e37
@@ -40,7 +40,8 @@ static void test_panic(void)
495e37
     QDict *response, *data;
495e37
     QTestState *qts;
495e37
 
495e37
-    qts = qtest_init("-device pvpanic -action panic=pause");
495e37
+    /* RHEL: Use q35 */
495e37
+    qts = qtest_init("-M q35 -device pvpanic -action panic=pause");
495e37
 
495e37
     val = qtest_inb(qts, 0x505);
495e37
     g_assert_cmpuint(val, ==, 3);
495e37
-- 
586cba
2.31.1
495e37