Blame SOURCES/0003-Add-RHEL-7-machine-types.patch

4a2fec
From 44f7e7595c416686a00015e317e74183037a8136 Mon Sep 17 00:00:00 2001
4a2fec
From: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
Date: Sun, 14 Dec 2014 18:32:18 +0100
4a2fec
Subject: Add RHEL 7 machine types
4a2fec
4a2fec
This commit adds all changes related to machine types applied in
4a2fec
qemu-kvm-rhev-2.1.2-16.el7.
4a2fec
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
Conflicts (on 2.3 rebase):
4a2fec
	default-configs/ppc64-softmmu.mak
4a2fec
	hw/arm/Makefile.objs
4a2fec
	hw/i386/pc_piix.c
4a2fec
	hw/i386/pc_q35.c
4a2fec
	hw/ppc/spapr.c
4a2fec
	savevm.c - has to change shadow_bios tail to rcu list handling
4a2fec
	target-i386/machine.c - use xmm instead of ymmh register
4a2fec
4a2fec
--
4a2fec
Rebase notes (2.10.0):
4a2fec
- Commented out new unused functions in hw/arm/virt.c
4a2fec
- savevm_skip_section_footers changed to COMPAT variable (upstream)
4a2fec
- global_state_set_optional changed to COMPAT variable (upstream)
4a2fec
- savevm_skip_configuration changed to COMPAT variable (upstream)
4a2fec
- move shadow_bios() to separate module with stub version available
4a2fec
- set possible_cpu_arch_ids and cpu_index_to_instance_props fields for arm machine type
4a2fec
- Re-enable older machine types for ppc64
4a2fec
- Commented 7.2 rebase error for compat qemu-extended-regs
4a2fec
4a2fec
Rebase notes (2.9.0):
4a2fec
- new header file for arm (upstream)
4a2fec
- query_hotpluggable_cpus renamed to has_hotpluggable_cpus (upstream)
4a2fec
- replace MAX_CPUMASK_BITS with max_cpus
4a2fec
- Adding rhel6-e1000.rom moved to Initial redhat commit
4a2fec
- Fixed conflict on cirrus_vga.c
4a2fec
4a2fec
Rebase notes (2.8.0):
4a2fec
- new "m->max_cpus = 288" in pc_q35_machine_options hw/i386/pc_q35.c
4a2fec
4a2fec
Rebase notes (2.7.0):
4a2fec
- Additional fsl-imx6.o sabrelito.o files in arm hw dir
4a2fec
4a2fec
Rebase notes (2.6.0):
4a2fec
- Changes in handling of some compat properties
4a2fec
- Fixes in x86_64 copmat models
4a2fec
- Added required devices for aarch64
4a2fec
- Fixes for ppc machine types
4a2fec
4a2fec
Rebase notes (2.5.0):
4a2fec
- changed cpu defaults structure
4a2fec
- chnaged cpu compat properties handling
4a2fec
- added fix for arm machine type
4a2fec
4a2fec
Rebase notes (2.4.0)
4a2fec
- Moved needed attribute (due to 5cd8cadae8db905afcbf877cae568c27d1d55a8a)
4a2fec
- Fixes to machine types changes
4a2fec
4a2fec
Merged patches (2.10.0)
4a2fec
- 5090ba1 Fix qemu-kvm does not quit when booting guest w/ 241 vcpus and "-no-kvm"
4a2fec
- 3c52050 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 288
4a2fec
- 0ed92ca x86: Work around SMI breakages
4a2fec
- f7b5a7f spapr: update SPAPR_COMPAT_RHEL7_3
4a2fec
- 04faf4d migration: update HW_COMPAT_RHEL7_3
4a2fec
- 9982768 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 384
4a2fec
- f5095ba re-enable DMA for 7.3 machine type
4a2fec
- d6ec65d x86 machine compat: 2.9 stragglers
4a2fec
- eda659a disable linuxboot_dma.bin option rom for 7.3 machine types
4a2fec
- 8c122a5 Revert "hw/pci: disable pci-bridge's shpc by default" (partial)
4a2fec
- 627adfa virtio_net: Bypass backends for MTU feature negotiation (partial)
4a2fec
- b430787 pc: Use "min[x]level" on compat_props on RHEL machine-types
4a2fec
- 8c3f45a AArch64: remove mach-virt-7.3 machine type
4a2fec
- d5df1ef Downstream: Update pseries machine types for RHEL-ALT-7.4
4a2fec
4a2fec
Merged patches (2.9.0)
4a2fec
- 8475d69 hw/arm/virt: Disable virtio-net-pci option ROM file loading
4a2fec
- 73fe1f6 Workaround rhel6 ctrl_guest_offloads machine type mismatch
4a2fec
- 21d32ca pc_piix: fix compat props typo for RHEL6 machine types
4a2fec
- 55a5002 compat: define HW_COMPAT_RHEL7_3
4a2fec
- 1b8e927 spapr: define pseries-rhel7.4.0 machine type
4a2fec
- cdb76ec hw/arm/virt: remove aarch64 rhel machine type
4a2fec
- 7dfa88b hw/arm/virt: create virt-rhel7.3.0 machine type
4a2fec
- 6894f91 hw/arm/virt: create virt-rhel7.4.0 machine type
4a2fec
- a9d2d39 x86: Split out options for the head rhel7 machine types
4a2fec
- fdafbdc x86: Create PC_RHEL7_3_COMPAT definition
4a2fec
- 3427c72 x86: Define pc-i440fx-rhel7.4.0
4a2fec
- aea20ab x86: Define pc-q35-rhel7.4.0
4a2fec
- 0185c0f x86: Remove downstream opteron rdtscp override
4a2fec
- 6b51073 fix abort in acpi_setup() since 2.8 with rhel6 machine types
4a2fec
- 954fc0d intel-hda: fix rhel6 compat property
4a2fec
- 1b57274 kvmclock: reduce kvmclock difference on migration (rhel only part)
4a2fec
4a2fec
Merged patches (2.8.0)
4a2fec
- a1da2f0 virtio-pci: reduce modern_mem_bar size (rhel only part)
4a2fec
4a2fec
Merged patches (2.7.0):
4a2fec
- fe9d1cf pc: Use right HW_COMPAT_* macros at PC_RHEL7* compat macros
4a2fec
- 3938189 compat: Add missing "any_layout" in HW_COMPAT_RHEL7_1
4a2fec
- 6dffc9d spapr: update RHEL-7.2 machine type
4a2fec
- c5d5910 migration: fix HW_COMPAT_RHEL7_2
4a2fec
- 2da9bb8 pc: New (default) pc-i440fx-rhel7.3.0 machine-type
4a2fec
- 0520d7e 7.3 mismerge fix: Fix ich9-intel-hda compatibility
4a2fec
- 89528b3 PC migration compat: Section footers/global state
4a2fec
- 2231e35 fw_cfg for 7.2 compatibility
4a2fec
- b8a3ade pc: Create new pc-q35-rhel7.3.0 machine-type
4a2fec
- 340929b q35: Remove 7.0, 7.1, 7.2 machine types
4a2fec
- bb7fc95 machine types: fix pc_machine_*_options chain
4a2fec
- d9fa9aa Fix rhel6 rom file
4a2fec
- dc39363 fix vga type for older machines
4a2fec
- 255a2d1 7.2 machine type compatibility
4a2fec
- 16c3d25 target-i386: Remove SSE4a from qemu64 CPU model (rhel only part)
4a2fec
- 76a1796 target-i386: Remove ABM from qemu64 CPU model (rhel only part)
4a2fec
- a9f8773 pc: Recover PC_RHEL7_1_COMPAT from RHEL-7.2 code
4a2fec
- 7a6ed67 pc: Include missing PC_COMPAT_2_3 entries in PC_RHEL7_2_COMPAT
4a2fec
- 07428f6 Revert "static checker: e1000-82540em got aliased to e1000"
4a2fec
- 446cf1f Revert "e1000: use alias for default model"
4a2fec
- 615096e 7.x compat: e1000-82540em
4a2fec
- 0855905 hw/arm/virt: kill 7.2 machine type
4a2fec
- 18bbea2 usbredir: turn off streams for rhel7.2 & older
4a2fec
- 910cf4a target-i386: Fill high bits of mtrr mask (rhel only part)
4a2fec
- 0e8ab1b target-i386: Enable host-phys-bits on RHEL
4a2fec
- 8c5f8a5 pc: Fix rhel6.3.0 compat_props setting
4a2fec
- 8f869f1 pc: use new CPU hotplug interface since 2.7 machine type (rhel only part)
4a2fec
- d9d646f machine: add properties to compat_props incrementaly (rhel only part)
4a2fec
- acb18fd apic: Use apic_id as apic's migration instance_id (rhel only part)
4a2fec
- c7e37d4 apic: fix broken migration for kvm-apic (rhel only part)
4a2fec
- eca64aee hw/virtio-pci: fix virtio behaviour
4a2fec
- c56b8F6e pc-rhel-7.2: pcie: fix link active status bit migration
4a2fec
- 5522aa3 q35-rhel: allow dynamic sysbus
4a2fec
4a2fec
Merged patches (2.6.0):
4a2fec
- f915d7f arm: virt: Add an abstract RHEL ARM virt machine type
4a2fec
- deffcc0 arm: virt: Add RHEL 7.3.0 virt machine type
4a2fec
- 04ca07d arm: virt: Consolidate the naming of RHEL virt machine types
4a2fec
- 2856ce2 Define HW_COMPAT_RHEL7_2
4a2fec
- 1869242 spapr: move pseries-2.5 machine to RHEL disabled machine zone
4a2fec
- cc59ce7 spapr: add RHEL-7.3 machine type
4a2fec
- 98549c5 pc: Fix property names on CPU compat code
4a2fec
- caa47bb Fix ich9-intel-hda compatibility
4a2fec
4a2fec
Merged patches (2.3.0):
4a2fec
- bb4e53c2 pc: add rhel6.6.0 machine type
4a2fec
- 129a2b3 Downstream-only: Restore "pseries" machine alias
4a2fec
4a2fec
Merged patches (2.4.0):
4a2fec
- 8e8107c numa: Don't allow memdev= on RHEL-6 machine-types
4a2fec
- 8b220c0 pc_sysfw: prevent pflash and/or mis-sized firmware for rhel6.x.0 machtypes
4a2fec
- 9dba3a5 Add pc-i440fx-rhel7.2.0 machine type
4a2fec
- 1c88ffa Add pc-q35-rhel7.2.0 machine type
4a2fec
- 6f74d0c Downstream-only: Add rhel7.2.0 machine type
4a2fec
- a7d6105 Add flag for pre-2.2 migration compatibility
4a2fec
- 17f9a18 Serial: Migration compatibility pre 2.2/7.2
4a2fec
- 3799a57 Migration compat for mc146818rtc/irq_reinject_on_ack_count subsection
4a2fec
- 5668cc1 Fix reported machine type
4a2fec
- 2417534 386: drop FDC in pc-q35-rhel7.2.0 if neither it nor fl. drives are anted
4a2fec
- f42eee5 global_state: Make section optional
4a2fec
- 8640f84 migration: Add configuration section
4a2fec
- 48c857b pc: memhotplug: fix incorrectly set reserved-memory-end
4a2fec
- f33f0b6 pc: memhotplug: keep reserved-memory-end broken on rhel71 and earlier machines
4a2fec
4a2fec
(cherry picked from commit d682dec685d0a342b990068b20dbef5aebc30a23)
4a2fec
---
4a2fec
 default-configs/aarch64-softmmu.mak |   2 +
4a2fec
 default-configs/arm-softmmu.mak     |   1 -
4a2fec
 hw/acpi/piix4.c                     |   6 +-
4a2fec
 hw/arm/Makefile.objs                |  19 +-
4a2fec
 hw/arm/virt.c                       | 120 +++++-
4a2fec
 hw/char/serial.c                    |  28 ++
4a2fec
 hw/display/cirrus_vga.c             |   4 +-
4a2fec
 hw/display/vga-isa.c                |   2 +-
4a2fec
 hw/i386/Makefile.objs               |   1 +
4a2fec
 hw/i386/pc.c                        |   3 +-
4a2fec
 hw/i386/pc_piix.c                   | 772 +++++++++++++++++++++++++++++++++++-
4a2fec
 hw/i386/pc_q35.c                    |  55 ++-
4a2fec
 hw/i386/pc_sysfw.c                  |  16 +
4a2fec
 hw/i386/shadow-bios.c               |  64 +++
4a2fec
 hw/net/e1000.c                      |  20 +-
4a2fec
 hw/net/ne2000.c                     |   2 +-
4a2fec
 hw/net/pcnet-pci.c                  |   2 +-
4a2fec
 hw/net/rtl8139.c                    |   2 +-
4a2fec
 hw/ppc/Makefile.objs                |   2 +-
4a2fec
 hw/ppc/spapr.c                      | 124 ++++++
4a2fec
 hw/smbios/smbios.c                  |   1 +
4a2fec
 hw/timer/i8254_common.c             |   2 +-
4a2fec
 hw/timer/mc146818rtc.c              |   6 +
4a2fec
 hw/usb/hcd-uhci.c                   |  15 +-
4a2fec
 hw/usb/hcd-xhci.c                   |  18 +
4a2fec
 hw/usb/hcd-xhci.h                   |   2 +
4a2fec
 hw/virtio/virtio-pci.c              |   2 +-
4a2fec
 hw/virtio/virtio.c                  |  22 +-
4a2fec
 include/hw/arm/virt.h               |  22 +
4a2fec
 include/hw/compat.h                 | 180 +++++++++
4a2fec
 include/hw/i386/pc.h                | 442 +++++++++++++++++++++
4a2fec
 include/hw/usb.h                    |   7 +
4a2fec
 include/hw/virtio/virtio.h          |   1 +
4a2fec
 include/sysemu/sysemu.h             |   2 +
4a2fec
 migration/migration.c               |   2 +
4a2fec
 migration/migration.h               |   6 +
4a2fec
 migration/savevm.c                  |   9 +
4a2fec
 numa.c                              |  13 +
4a2fec
 qdev-monitor.c                      |   1 -
4a2fec
 redhat/qemu-kvm.spec.template       |  11 +-
4a2fec
 scripts/vmstate-static-checker.py   |   1 -
4a2fec
 stubs/Makefile.objs                 |   1 +
4a2fec
 stubs/shadow-bios.c                 |   7 +
4a2fec
 target/i386/cpu.c                   |  51 ++-
4a2fec
 target/i386/machine.c               |  21 +
4a2fec
 45 files changed, 2030 insertions(+), 60 deletions(-)
4a2fec
 create mode 100644 hw/i386/shadow-bios.c
4a2fec
 create mode 100644 stubs/shadow-bios.c
4a2fec
4a2fec
diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak
4a2fec
index 2449483..abd18c2 100644
4a2fec
--- a/default-configs/aarch64-softmmu.mak
4a2fec
+++ b/default-configs/aarch64-softmmu.mak
4a2fec
@@ -7,3 +7,5 @@ CONFIG_AUX=y
4a2fec
 CONFIG_DDC=y
4a2fec
 CONFIG_DPCD=y
4a2fec
 CONFIG_XLNX_ZYNQMP=y
4a2fec
+CONFIG_PL061=y
4a2fec
+CONFIG_GPIO_KEY=y
4a2fec
diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
4a2fec
index bbdd3c1..05aaf8f 100644
4a2fec
--- a/default-configs/arm-softmmu.mak
4a2fec
+++ b/default-configs/arm-softmmu.mak
4a2fec
@@ -76,7 +76,6 @@ CONFIG_ARM11SCU=y
4a2fec
 CONFIG_A9SCU=y
4a2fec
 CONFIG_DIGIC=y
4a2fec
 CONFIG_MARVELL_88W8618=y
4a2fec
-CONFIG_OMAP=y
4a2fec
 CONFIG_TSC210X=y
4a2fec
 CONFIG_BLIZZARD=y
4a2fec
 CONFIG_ONENAND=y
4a2fec
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
4a2fec
index f276967..efd80d1 100644
4a2fec
--- a/hw/acpi/piix4.c
4a2fec
+++ b/hw/acpi/piix4.c
4a2fec
@@ -311,7 +311,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
4a2fec
 static const VMStateDescription vmstate_acpi = {
4a2fec
     .name = "piix4_pm",
4a2fec
     .version_id = 3,
4a2fec
-    .minimum_version_id = 3,
4a2fec
+    .minimum_version_id = 2,
4a2fec
     .minimum_version_id_old = 1,
4a2fec
     .load_state_old = acpi_load_old,
4a2fec
     .post_load = vmstate_acpi_post_load,
4a2fec
@@ -675,8 +675,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
4a2fec
 
4a2fec
 static Property piix4_pm_properties[] = {
4a2fec
     DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
4a2fec
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
4a2fec
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
4a2fec
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
4a2fec
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
4a2fec
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
4a2fec
     DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
4a2fec
                      use_acpi_pci_hotplug, true),
4a2fec
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
4a2fec
index a2e56ec..906367c 100644
4a2fec
--- a/hw/arm/Makefile.objs
4a2fec
+++ b/hw/arm/Makefile.objs
4a2fec
@@ -1,21 +1,4 @@
4a2fec
-obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o
4a2fec
-obj-$(CONFIG_DIGIC) += digic_boards.o
4a2fec
-obj-y += integratorcp.o mainstone.o musicpal.o nseries.o
4a2fec
-obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o
4a2fec
-obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o
4a2fec
 obj-$(CONFIG_ACPI) += virt-acpi-build.o
4a2fec
-obj-y += netduino2.o
4a2fec
 obj-y += sysbus-fdt.o
4a2fec
 
4a2fec
-obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
4a2fec
-obj-$(CONFIG_DIGIC) += digic.o
4a2fec
-obj-y += omap1.o omap2.o strongarm.o
4a2fec
-obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
4a2fec
-obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
4a2fec
-obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
4a2fec
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o
4a2fec
-obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
4a2fec
-obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
4a2fec
-obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
4a2fec
-obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o
4a2fec
-obj-$(CONFIG_MPS2) += mps2.o
4a2fec
+obj-y += boot.o virt.o
4a2fec
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
4a2fec
index 6b7a0fe..b14e16d 100644
4a2fec
--- a/hw/arm/virt.c
4a2fec
+++ b/hw/arm/virt.c
4a2fec
@@ -57,6 +57,7 @@
4a2fec
 #include "qapi/visitor.h"
4a2fec
 #include "standard-headers/linux/input.h"
4a2fec
 
4a2fec
+#if 0 /* disabled Red Hat Enterprise Linux */
4a2fec
 #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \
4a2fec
     static void virt_##major##_##minor##_class_init(ObjectClass *oc, \
4a2fec
                                                     void *data) \
4a2fec
@@ -84,7 +85,36 @@
4a2fec
     DEFINE_VIRT_MACHINE_LATEST(major, minor, true)
4a2fec
 #define DEFINE_VIRT_MACHINE(major, minor) \
4a2fec
     DEFINE_VIRT_MACHINE_LATEST(major, minor, false)
4a2fec
-
4a2fec
+#endif /* disabled for RHEL */
4a2fec
+
4a2fec
+#define DEFINE_RHEL_MACHINE_LATEST(m, n, s, latest)                     \
4a2fec
+    static void rhel##m##n##s##_virt_class_init(ObjectClass *oc,        \
4a2fec
+                                                void *data)             \
4a2fec
+    {                                                                   \
4a2fec
+        MachineClass *mc = MACHINE_CLASS(oc);                           \
4a2fec
+        rhel##m##n##s##_virt_options(mc);                               \
4a2fec
+        mc->desc = "RHEL " # m "." # n "." # s " ARM Virtual Machine";  \
4a2fec
+        if (latest) {                                                   \
4a2fec
+            mc->alias = "virt";                                         \
4a2fec
+            mc->is_default = 1;                                         \
4a2fec
+        }                                                               \
4a2fec
+    }                                                                   \
4a2fec
+    static const TypeInfo rhel##m##n##s##_machvirt_info = {             \
4a2fec
+        .name = MACHINE_TYPE_NAME("virt-rhel" # m "." # n "." # s),     \
4a2fec
+        .parent = TYPE_RHEL_MACHINE,                                    \
4a2fec
+        .instance_init = rhel##m##n##s##_virt_instance_init,            \
4a2fec
+        .class_init = rhel##m##n##s##_virt_class_init,                  \
4a2fec
+    };                                                                  \
4a2fec
+    static void rhel##m##n##s##_machvirt_init(void)                     \
4a2fec
+    {                                                                   \
4a2fec
+        type_register_static(&rhel##m##n##s##_machvirt_info);           \
4a2fec
+    }                                                                   \
4a2fec
+    type_init(rhel##m##n##s##_machvirt_init);
4a2fec
+
4a2fec
+#define DEFINE_RHEL_MACHINE_AS_LATEST(major, minor, subminor)   \
4a2fec
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true)
4a2fec
+#define DEFINE_RHEL_MACHINE(major, minor, subminor)             \
4a2fec
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false)
4a2fec
 
4a2fec
 /* Number of external interrupt lines to configure the GIC with */
4a2fec
 #define NUM_IRQS 256
4a2fec
@@ -1484,6 +1514,7 @@ static void machvirt_init(MachineState *machine)
4a2fec
     create_platform_bus(vms, pic);
4a2fec
 }
4a2fec
 
4a2fec
+#if 0 /* disabled for RHEL */
4a2fec
 static bool virt_get_secure(Object *obj, Error **errp)
4a2fec
 {
4a2fec
     VirtMachineState *vms = VIRT_MACHINE(obj);
4a2fec
@@ -1512,6 +1543,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
4a2fec
     vms->virt = value;
4a2fec
 }
4a2fec
 
4a2fec
+#endif /* disabled for RHEL */
4a2fec
 static bool virt_get_highmem(Object *obj, Error **errp)
4a2fec
 {
4a2fec
     VirtMachineState *vms = VIRT_MACHINE(obj);
4a2fec
@@ -1604,6 +1636,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
4a2fec
     return ms->possible_cpus;
4a2fec
 }
4a2fec
 
4a2fec
+#if 0 /* disabled for RHEL */
4a2fec
 static void virt_machine_class_init(ObjectClass *oc, void *data)
4a2fec
 {
4a2fec
     MachineClass *mc = MACHINE_CLASS(oc);
4a2fec
@@ -1780,3 +1813,88 @@ static void virt_machine_2_6_options(MachineClass *mc)
4a2fec
     vmc->no_pmu = true;
4a2fec
 }
4a2fec
 DEFINE_VIRT_MACHINE(2, 6)
4a2fec
+#endif /* disabled for RHEL */
4a2fec
+
4a2fec
+static void rhel_machine_class_init(ObjectClass *oc, void *data)
4a2fec
+{
4a2fec
+    MachineClass *mc = MACHINE_CLASS(oc);
4a2fec
+
4a2fec
+    mc->family = "virt-rhel-Z";
4a2fec
+    mc->init = machvirt_init;
4a2fec
+    /* Start max_cpus at the maximum QEMU supports. We'll further restrict
4a2fec
+     * it later in machvirt_init, where we have more information about the
4a2fec
+     * configuration of the particular instance.
4a2fec
+     */
4a2fec
+    mc->max_cpus = 255;
4a2fec
+    mc->has_dynamic_sysbus = false;
4a2fec
+    mc->block_default_type = IF_VIRTIO;
4a2fec
+    mc->no_cdrom = 1;
4a2fec
+    mc->pci_allow_0_address = true;
4a2fec
+    /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */
4a2fec
+    mc->minimum_page_bits = 12;
4a2fec
+    mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids;
4a2fec
+    mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
4a2fec
+}
4a2fec
+
4a2fec
+static const TypeInfo rhel_machine_info = {
4a2fec
+    .name          = TYPE_RHEL_MACHINE,
4a2fec
+    .parent        = TYPE_MACHINE,
4a2fec
+    .abstract      = true,
4a2fec
+    .instance_size = sizeof(VirtMachineState),
4a2fec
+    .class_size    = sizeof(VirtMachineClass),
4a2fec
+    .class_init    = rhel_machine_class_init,
4a2fec
+};
4a2fec
+
4a2fec
+static void rhel_machine_init(void)
4a2fec
+{
4a2fec
+    type_register_static(&rhel_machine_info);
4a2fec
+}
4a2fec
+type_init(rhel_machine_init);
4a2fec
+
4a2fec
+static void rhel740_virt_instance_init(Object *obj)
4a2fec
+{
4a2fec
+    VirtMachineState *vms = VIRT_MACHINE(obj);
4a2fec
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
4a2fec
+
4a2fec
+    /* EL3 is disabled by default and non-configurable for RHEL */
4a2fec
+    vms->secure = false;
4a2fec
+    /* EL2 is disabled by default and non-configurable for RHEL */
4a2fec
+    vms->virt = false;
4a2fec
+    /* High memory is enabled by default for RHEL */
4a2fec
+    vms->highmem = true;
4a2fec
+    object_property_add_bool(obj, "highmem", virt_get_highmem,
4a2fec
+                             virt_set_highmem, NULL);
4a2fec
+    object_property_set_description(obj, "highmem",
4a2fec
+                                    "Set on/off to enable/disable using "
4a2fec
+                                    "physical address space above 32 bits",
4a2fec
+                                    NULL);
4a2fec
+    /* Default GIC type is still v2, but became configurable for RHEL */
4a2fec
+    vms->gic_version = 2;
4a2fec
+    object_property_add_str(obj, "gic-version", virt_get_gic_version,
4a2fec
+                        virt_set_gic_version, NULL);
4a2fec
+    object_property_set_description(obj, "gic-version",
4a2fec
+                                    "Set GIC version. "
4a2fec
+                                    "Valid values are 2, 3 and host", NULL);
4a2fec
+
4a2fec
+    if (vmc->no_its) {
4a2fec
+        vms->its = false;
4a2fec
+    } else {
4a2fec
+        /* Default allows ITS instantiation */
4a2fec
+        vms->its = true;
4a2fec
+        object_property_add_bool(obj, "its", virt_get_its,
4a2fec
+                                 virt_set_its, NULL);
4a2fec
+        object_property_set_description(obj, "its",
4a2fec
+                                        "Set on/off to enable/disable "
4a2fec
+                                        "ITS instantiation",
4a2fec
+                                        NULL);
4a2fec
+    }
4a2fec
+
4a2fec
+    vms->memmap=a15memmap;
4a2fec
+    vms->irqmap=a15irqmap;
4a2fec
+}
4a2fec
+
4a2fec
+static void rhel740_virt_options(MachineClass *mc)
4a2fec
+{
4a2fec
+    SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
4a2fec
+}
4a2fec
+DEFINE_RHEL_MACHINE_AS_LATEST(7, 4, 0)
4a2fec
diff --git a/hw/char/serial.c b/hw/char/serial.c
4a2fec
index 9aec6c6..fe4f41d 100644
4a2fec
--- a/hw/char/serial.c
4a2fec
+++ b/hw/char/serial.c
4a2fec
@@ -30,6 +30,7 @@
4a2fec
 #include "qemu/timer.h"
4a2fec
 #include "exec/address-spaces.h"
4a2fec
 #include "qemu/error-report.h"
4a2fec
+#include "migration/migration.h"
4a2fec
 
4a2fec
 //#define DEBUG_SERIAL
4a2fec
 
4a2fec
@@ -689,6 +690,9 @@ static int serial_post_load(void *opaque, int version_id)
4a2fec
 static bool serial_thr_ipending_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
 
4a2fec
     if (s->ier & UART_IER_THRI) {
4a2fec
         bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
4a2fec
@@ -716,6 +720,10 @@ static const VMStateDescription vmstate_serial_thr_ipending = {
4a2fec
 static bool serial_tsr_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return s->tsr_retry != 0;
4a2fec
 }
4a2fec
 
4a2fec
@@ -735,6 +743,10 @@ static const VMStateDescription vmstate_serial_tsr = {
4a2fec
 static bool serial_recv_fifo_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return !fifo8_is_empty(&s->recv_fifo);
4a2fec
 
4a2fec
 }
4a2fec
@@ -753,6 +765,10 @@ static const VMStateDescription vmstate_serial_recv_fifo = {
4a2fec
 static bool serial_xmit_fifo_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return !fifo8_is_empty(&s->xmit_fifo);
4a2fec
 }
4a2fec
 
4a2fec
@@ -770,6 +786,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
4a2fec
 static bool serial_fifo_timeout_timer_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return timer_pending(s->fifo_timeout_timer);
4a2fec
 }
4a2fec
 
4a2fec
@@ -787,6 +807,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
4a2fec
 static bool serial_timeout_ipending_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return s->timeout_ipending != 0;
4a2fec
 }
4a2fec
 
4a2fec
@@ -804,6 +828,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
4a2fec
 static bool serial_poll_needed(void *opaque)
4a2fec
 {
4a2fec
     SerialState *s = (SerialState *)opaque;
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return s->poll_msl >= 0;
4a2fec
 }
4a2fec
 
4a2fec
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
4a2fec
index afc290a..14008aa 100644
4a2fec
--- a/hw/display/cirrus_vga.c
4a2fec
+++ b/hw/display/cirrus_vga.c
4a2fec
@@ -3063,7 +3063,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
4a2fec
 
4a2fec
 static Property isa_cirrus_vga_properties[] = {
4a2fec
     DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState,
4a2fec
-                       cirrus_vga.vga.vram_size_mb, 4),
4a2fec
+                       cirrus_vga.vga.vram_size_mb, 16),
4a2fec
     DEFINE_PROP_BOOL("blitter", struct ISACirrusVGAState,
4a2fec
                        cirrus_vga.enable_blitter, true),
4a2fec
     DEFINE_PROP_END_OF_LIST(),
4a2fec
@@ -3134,7 +3134,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
4a2fec
 
4a2fec
 static Property pci_vga_cirrus_properties[] = {
4a2fec
     DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState,
4a2fec
-                       cirrus_vga.vga.vram_size_mb, 4),
4a2fec
+                       cirrus_vga.vga.vram_size_mb, 16),
4a2fec
     DEFINE_PROP_BOOL("blitter", struct PCICirrusVGAState,
4a2fec
                      cirrus_vga.enable_blitter, true),
4a2fec
     DEFINE_PROP_END_OF_LIST(),
4a2fec
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
4a2fec
index 1af9556..91a675d 100644
4a2fec
--- a/hw/display/vga-isa.c
4a2fec
+++ b/hw/display/vga-isa.c
4a2fec
@@ -80,7 +80,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
4a2fec
 }
4a2fec
 
4a2fec
 static Property vga_isa_properties[] = {
4a2fec
-    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
4a2fec
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
4a2fec
     DEFINE_PROP_END_OF_LIST(),
4a2fec
 };
4a2fec
 
4a2fec
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
4a2fec
index c14559b..9b5686b 100644
4a2fec
--- a/hw/i386/Makefile.objs
4a2fec
+++ b/hw/i386/Makefile.objs
4a2fec
@@ -10,3 +10,4 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/
4a2fec
 obj-y += kvmvapic.o
4a2fec
 obj-y += acpi-build.o
4a2fec
 obj-y += pci-assign-load-rom.o
4a2fec
+obj-y += shadow-bios.o
4a2fec
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
4a2fec
index 2108104..64929ea 100644
4a2fec
--- a/hw/i386/pc.c
4a2fec
+++ b/hw/i386/pc.c
4a2fec
@@ -2353,7 +2353,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
4a2fec
     mc->default_boot_order = "cad";
4a2fec
     mc->hot_add_cpu = pc_hot_add_cpu;
4a2fec
     mc->block_default_type = IF_IDE;
4a2fec
-    mc->max_cpus = 255;
4a2fec
+    /* 240: max CPU count for RHEL */
4a2fec
+    mc->max_cpus = 240;
4a2fec
     mc->reset = pc_machine_reset;
4a2fec
     hc->pre_plug = pc_machine_device_pre_plug_cb;
4a2fec
     hc->plug = pc_machine_device_plug_cb;
4a2fec
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
4a2fec
index 46dfd2c..7f12ce3 100644
4a2fec
--- a/hw/i386/pc_piix.c
4a2fec
+++ b/hw/i386/pc_piix.c
4a2fec
@@ -48,6 +48,7 @@
4a2fec
 #include "hw/acpi/acpi.h"
4a2fec
 #include "cpu.h"
4a2fec
 #include "qemu/error-report.h"
4a2fec
+#include "migration/migration.h"
4a2fec
 #ifdef CONFIG_XEN
4a2fec
 #include <xen/hvm/hvm_info_table.h>
4a2fec
 #include "hw/xen/xen_pt.h"
4a2fec
@@ -168,8 +169,8 @@ static void pc_init1(MachineState *machine,
4a2fec
     if (pcmc->smbios_defaults) {
4a2fec
         MachineClass *mc = MACHINE_GET_CLASS(machine);
4a2fec
         /* These values are guest ABI, do not change */
4a2fec
-        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
4a2fec
-                            mc->name, pcmc->smbios_legacy_mode,
4a2fec
+        smbios_set_defaults("Red Hat", "KVM",
4a2fec
+                            mc->desc, pcmc->smbios_legacy_mode,
4a2fec
                             pcmc->smbios_uuid_encoded,
4a2fec
                             SMBIOS_ENTRY_POINT_21);
4a2fec
     }
4a2fec
@@ -311,6 +312,7 @@ static void pc_init1(MachineState *machine,
4a2fec
  * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options().
4a2fec
  */
4a2fec
 
4a2fec
+#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
 static void pc_compat_2_3(MachineState *machine)
4a2fec
 {
4a2fec
     PCMachineState *pcms = PC_MACHINE(machine);
4a2fec
@@ -1122,3 +1124,769 @@ static void xenfv_machine_options(MachineClass *m)
4a2fec
 DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
4a2fec
                   xenfv_machine_options);
4a2fec
 #endif
4a2fec
+machine_init(pc_machine_init);
4a2fec
+
4a2fec
+#endif  /* Disabled for Red Hat Enterprise Linux */
4a2fec
+
4a2fec
+/* Red Hat Enterprise Linux machine types */
4a2fec
+
4a2fec
+/* Options for the latest rhel7 machine type */
4a2fec
+static void pc_machine_rhel7_options(MachineClass *m)
4a2fec
+{
4a2fec
+    m->family = "pc_piix_Y";
4a2fec
+    m->default_machine_opts = "firmware=bios-256k.bin";
4a2fec
+    m->default_display = "std";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
4a2fec
+    m->alias = "pc";
4a2fec
+    m->is_default = 1;
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel740(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_machine_rhel740_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel7_options(m);
4a2fec
+    m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
4a2fec
+                  pc_machine_rhel740_options);
4a2fec
+
4a2fec
+static void pc_init_rhel730(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_machine_rhel730_options(MachineClass *m)
4a2fec
+{
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
4a2fec
+    pc_machine_rhel740_options(m);
4a2fec
+    m->alias = NULL;
4a2fec
+    m->is_default = 0;
4a2fec
+    m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)";
4a2fec
+    pcmc->linuxboot_dma_enabled = false;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730,
4a2fec
+                  pc_machine_rhel730_options);
4a2fec
+
4a2fec
+
4a2fec
+static void pc_init_rhel720(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_machine_rhel720_options(MachineClass *m)
4a2fec
+{
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
4a2fec
+    pc_machine_rhel730_options(m);
4a2fec
+    m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)";
4a2fec
+    /* From pc_i440fx_2_5_machine_options */
4a2fec
+    pcmc->save_tsc_khz = false;
4a2fec
+    m->legacy_fw_cfg_order = 1;
4a2fec
+    /* Note: broken_reserved_end was already in 7.2 */
4a2fec
+    /* From pc_i440fx_2_6_machine_options */
4a2fec
+    pcmc->legacy_cpu_hotplug = true;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL7_2_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720,
4a2fec
+                  pc_machine_rhel720_options);
4a2fec
+
4a2fec
+static void pc_compat_rhel710(MachineState *machine)
4a2fec
+{
4a2fec
+    PCMachineState *pcms = PC_MACHINE(machine);
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
4a2fec
+
4a2fec
+    /* From pc_compat_2_2 */
4a2fec
+    pcmc->rsdp_in_ram = false;
4a2fec
+    machine->suppress_vmdesc = true;
4a2fec
+
4a2fec
+    /* From pc_compat_2_1 */
4a2fec
+    pcmc->smbios_uuid_encoded = false;
4a2fec
+    x86_cpu_change_kvm_default("svm", NULL);
4a2fec
+    pcmc->enforce_aligned_dimm = false;
4a2fec
+
4a2fec
+    /* Disable all the extra subsections that were added in 2.2 */
4a2fec
+    migrate_pre_2_2 = true;
4a2fec
+
4a2fec
+    /* From pc_i440fx_2_4_machine_options */
4a2fec
+    pcmc->broken_reserved_end = true;
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel710(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel710(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_machine_rhel710_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel720_options(m);
4a2fec
+    m->family = "pc_piix_Y";
4a2fec
+    m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)";
4a2fec
+    m->default_display = "cirrus";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL7_1_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
4a2fec
+                  pc_machine_rhel710_options);
4a2fec
+
4a2fec
+static void pc_compat_rhel700(MachineState *machine)
4a2fec
+{
4a2fec
+    PCMachineState *pcms = PC_MACHINE(machine);
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
4a2fec
+
4a2fec
+    pc_compat_rhel710(machine);
4a2fec
+
4a2fec
+    /* Upstream enables it for everyone, we're a little more selective */
4a2fec
+    x86_cpu_change_kvm_default("x2apic", NULL);
4a2fec
+    x86_cpu_change_kvm_default("svm", NULL);
4a2fec
+    pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
4a2fec
+    pcmc->smbios_legacy_mode = true;
4a2fec
+    pcmc->has_reserved_memory = false;
4a2fec
+    migrate_cve_2014_5263_xhci_fields = true;
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel700(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel700(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_machine_rhel700_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel710_options(m);
4a2fec
+    m->family = "pc_piix_Y";
4a2fec
+    m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL7_0_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
4a2fec
+                  pc_machine_rhel700_options);
4a2fec
+
4a2fec
+#define PC_RHEL6_6_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "scsi-hd",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "scsi-cd",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "scsi-disk",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "ide-hd",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "ide-cd",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "ide-drive",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-blk-pci",\
4a2fec
+            .property = "discard_granularity",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-serial-pci",\
4a2fec
+            .property = "vectors",\
4a2fec
+            /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
4a2fec
+            .value    = stringify(0xFFFFFFFF),\
4a2fec
+        },{\
4a2fec
+            .driver   = "486-" TYPE_X86_CPU,\
4a2fec
+            .property = "model",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-tablet",\
4a2fec
+            .property = "usb_version",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "mq",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "VGA",\
4a2fec
+            .property = "mmio",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-blk-pci",\
4a2fec
+            .property = "config-wce",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = TYPE_ISA_FDC,\
4a2fec
+            .property = "check_media_rate",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-balloon-pci",\
4a2fec
+            .property = "class",\
4a2fec
+            .value    = stringify(PCI_CLASS_MEMORY_RAM),\
4a2fec
+        },{\
4a2fec
+            .driver   = TYPE_PCI_DEVICE,\
4a2fec
+            .property = "command_serr_enable",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "AC97",\
4a2fec
+            .property = "use_broken_id",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "intel-hda",\
4a2fec
+            .property = "msi",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver = "qemu32-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver = "486-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "qemu32-" TYPE_X86_CPU,\
4a2fec
+            .property = "model",\
4a2fec
+            .value    = stringify(3),\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-ccid",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "1",\
4a2fec
+        },{\
4a2fec
+            .driver   = "ne2k_pci",\
4a2fec
+            .property = "romfile",\
4a2fec
+            .value    = "rhel6-ne2k_pci.rom",\
4a2fec
+        },{\
4a2fec
+            .driver   = "pcnet",\
4a2fec
+            .property = "romfile",\
4a2fec
+            .value    = "rhel6-pcnet.rom",\
4a2fec
+        },{\
4a2fec
+            .driver   = "rtl8139",\
4a2fec
+            .property = "romfile",\
4a2fec
+            .value    = "rhel6-rtl8139.rom",\
4a2fec
+        },{\
4a2fec
+            .driver   = "e1000",\
4a2fec
+            .property = "romfile",\
4a2fec
+            .value    = "rhel6-e1000.rom",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "romfile",\
4a2fec
+            .value    = "rhel6-virtio.rom",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "pentium" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "apic",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "pentium2" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "apic",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "pentium3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "apic",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Conroe" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Penryn" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Nehalem" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "pclmulqdq",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "fxsr",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "mmx",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "pat",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "cmov",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "pge",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "cx8",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "mce",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "pae",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "msr",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "tsc",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "pse",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "de",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "fpu",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "rdtscp",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "smap",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "rdtscp",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "on",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "x2apic",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "3dnow",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "3dnowext",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "virtio-net-pci",\
4a2fec
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
4a2fec
+            .value = "on",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel660(MachineState *machine)
4a2fec
+{
4a2fec
+    PCMachineState *pcms = PC_MACHINE(machine);
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
4a2fec
+
4a2fec
+    pc_compat_rhel700(machine);
4a2fec
+    if (!machine->cpu_model) {
4a2fec
+        machine->cpu_model = "cpu64-rhel6";
4a2fec
+    }
4a2fec
+
4a2fec
+    x86_cpu_change_kvm_default("kvm-pv-unhalt", NULL);
4a2fec
+
4a2fec
+    pcmc->gigabyte_align = false;
4a2fec
+    shadow_bios_after_incoming = true;
4a2fec
+    ich9_uhci123_irqpin_override = true;
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel660(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel660(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel660_options(MachineClass *m)
4a2fec
+{
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
4a2fec
+    pc_machine_rhel700_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.6.0 PC";
4a2fec
+    m->rom_file_has_mr = false;
4a2fec
+    m->default_machine_opts = "firmware=bios.bin";
4a2fec
+    pcmc->has_acpi_build = false;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_6_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel660, "rhel6.6.0", pc_init_rhel660,
4a2fec
+                  pc_machine_rhel660_options);
4a2fec
+
4a2fec
+#define PC_RHEL6_5_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = TYPE_USB_DEVICE,\
4a2fec
+            .property = "msos-desc",\
4a2fec
+            .value    = "no",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel650(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel660(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel650(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel650(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel650_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel660_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.5.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_5_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel650, "rhel6.5.0", pc_init_rhel650,
4a2fec
+                  pc_machine_rhel650_options);
4a2fec
+
4a2fec
+#define PC_RHEL6_4_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "virtio-scsi-pci",\
4a2fec
+            .property = "vectors",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "hda-micro",\
4a2fec
+            .property = "mixer",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "hda-duplex",\
4a2fec
+            .property = "mixer",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "hda-output",\
4a2fec
+            .property = "mixer",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "ctrl_mac_addr",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "sep",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "virtio-net-pci",\
4a2fec
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
4a2fec
+            .value = "off",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel640(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel650(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel640(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel640(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel640_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel650_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.4.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_4_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640,
4a2fec
+                  pc_machine_rhel640_options);
4a2fec
+
4a2fec
+#define PC_RHEL6_3_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "Conroe-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "Penryn-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "e1000",\
4a2fec
+            .property = "autonegotiation",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "qxl",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(3),\
4a2fec
+        },{\
4a2fec
+            .driver   = "qxl-vga",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(3),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-scsi-pci",\
4a2fec
+            .property = "hotplug",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-scsi-pci",\
4a2fec
+            .property = "param_change",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "pmu",\
4a2fec
+            .value = "on",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-hub",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "314159",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-storage",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "1",\
4a2fec
+        },\
4a2fec
+        {\
4a2fec
+            .driver = "SandyBridge" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "tsc-deadline",\
4a2fec
+            .value = "off",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel630(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel640(machine);
4a2fec
+    x86_cpu_change_kvm_default("kvm-pv-eoi",NULL);
4a2fec
+    enable_compat_apic_id_mode();
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel630(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel630(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel630_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel640_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.3.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_3_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel630, "rhel6.3.0", pc_init_rhel630,
4a2fec
+                  pc_machine_rhel630_options);
4a2fec
+
4a2fec
+
4a2fec
+#define PC_RHEL6_2_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "pmu",\
4a2fec
+            .value = "off",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel620(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel630(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel620(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel620(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel620_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel630_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.2.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_2_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel620, "rhel6.2.0", pc_init_rhel620,
4a2fec
+                  pc_machine_rhel620_options);
4a2fec
+
4a2fec
+/*
4a2fec
+ * NOTE: We don't have the event_idx compat entry for the
4a2fec
+ * virtio-balloon-pci driver because RHEL6 doesn't disable
4a2fec
+ * it either due to a bug (see RHBZ 1029539 fo more info)
4a2fec
+ */
4a2fec
+#define PC_RHEL6_1_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "PIIX4_PM",\
4a2fec
+            .property = "disable_s3",\
4a2fec
+            .value    = "0",\
4a2fec
+        },{\
4a2fec
+            .driver   = "PIIX4_PM",\
4a2fec
+            .property = "disable_s4",\
4a2fec
+            .value    = "0",\
4a2fec
+        },{\
4a2fec
+            .driver   = "qxl",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "qxl-vga",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-blk-pci",\
4a2fec
+            .property = "event_idx",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-serial-pci",\
4a2fec
+            .property = "event_idx",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "event_idx",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-kbd",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "1",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-mouse",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "1",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-tablet",\
4a2fec
+            .property = "serial",\
4a2fec
+            .value    = "1",\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel610(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel620(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel610(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel610(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel610_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel620_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.1.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_1_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel610, "rhel6.1.0", pc_init_rhel610,
4a2fec
+                  pc_machine_rhel610_options);
4a2fec
+
4a2fec
+#define PC_RHEL6_0_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "qxl",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "qxl-vga",\
4a2fec
+            .property = "revision",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "VGA",\
4a2fec
+            .property = "rombar",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },
4a2fec
+
4a2fec
+static void pc_compat_rhel600(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel610(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_init_rhel600(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_compat_rhel600(machine);
4a2fec
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
4a2fec
+             TYPE_I440FX_PCI_DEVICE);}
4a2fec
+
4a2fec
+static void pc_machine_rhel600_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_machine_rhel610_options(m);
4a2fec
+    m->family = "pc_piix_Z";
4a2fec
+    m->desc = "RHEL 6.0.0 PC";
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL6_0_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(rhel600, "rhel6.0.0", pc_init_rhel600,
4a2fec
+                  pc_machine_rhel600_options);
4a2fec
+
4a2fec
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
4a2fec
index 169a214..575d407 100644
4a2fec
--- a/hw/i386/pc_q35.c
4a2fec
+++ b/hw/i386/pc_q35.c
4a2fec
@@ -137,8 +137,8 @@ static void pc_q35_init(MachineState *machine)
4a2fec
 
4a2fec
     if (pcmc->smbios_defaults) {
4a2fec
         /* These values are guest ABI, do not change */
4a2fec
-        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
4a2fec
-                            mc->name, pcmc->smbios_legacy_mode,
4a2fec
+        smbios_set_defaults("Red Hat", "KVM",
4a2fec
+                            mc->desc, pcmc->smbios_legacy_mode,
4a2fec
                             pcmc->smbios_uuid_encoded,
4a2fec
                             SMBIOS_ENTRY_POINT_21);
4a2fec
     }
4a2fec
@@ -289,6 +289,7 @@ static void pc_q35_init(MachineState *machine)
4a2fec
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
4a2fec
 
4a2fec
 
4a2fec
+#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
 static void pc_q35_machine_options(MachineClass *m)
4a2fec
 {
4a2fec
     m->family = "pc_q35";
4a2fec
@@ -300,6 +301,7 @@ static void pc_q35_machine_options(MachineClass *m)
4a2fec
     m->no_floppy = 1;
4a2fec
     m->has_dynamic_sysbus = true;
4a2fec
     m->max_cpus = 288;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
4a2fec
 }
4a2fec
 
4a2fec
 static void pc_q35_2_10_machine_options(MachineClass *m)
4a2fec
@@ -376,3 +378,52 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
4a2fec
 
4a2fec
 DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
4a2fec
                    pc_q35_2_4_machine_options);
4a2fec
+#endif  /* Disabled for Red Hat Enterprise Linux */
4a2fec
+
4a2fec
+/* Red Hat Enterprise Linux machine types */
4a2fec
+
4a2fec
+/* Options for the latest rhel7 q35 machine type */
4a2fec
+static void pc_q35_machine_rhel7_options(MachineClass *m)
4a2fec
+{
4a2fec
+    m->family = "pc_q35_Z";
4a2fec
+    m->default_machine_opts = "firmware=bios-256k.bin";
4a2fec
+    m->default_display = "std";
4a2fec
+    m->no_floppy = 1;
4a2fec
+    m->has_dynamic_sysbus = true;
4a2fec
+    m->alias = "q35";
4a2fec
+    m->max_cpus = 384;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_q35_init_rhel740(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_q35_init(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_q35_machine_rhel740_options(MachineClass *m)
4a2fec
+{
4a2fec
+    pc_q35_machine_rhel7_options(m);
4a2fec
+    m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
4a2fec
+                  pc_q35_machine_rhel740_options);
4a2fec
+
4a2fec
+static void pc_q35_init_rhel730(MachineState *machine)
4a2fec
+{
4a2fec
+    pc_q35_init(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void pc_q35_machine_rhel730_options(MachineClass *m)
4a2fec
+{
4a2fec
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
4a2fec
+    pc_q35_machine_rhel740_options(m);
4a2fec
+    m->alias = NULL;
4a2fec
+    m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)";
4a2fec
+    m->max_cpus = 255;
4a2fec
+    pcmc->linuxboot_dma_enabled = false;
4a2fec
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
4a2fec
+                  pc_q35_machine_rhel730_options);
4a2fec
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
4a2fec
index 6b18374..04db39a 100644
4a2fec
--- a/hw/i386/pc_sysfw.c
4a2fec
+++ b/hw/i386/pc_sysfw.c
4a2fec
@@ -193,6 +193,13 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
4a2fec
         (bios_size % 65536) != 0) {
4a2fec
         goto bios_error;
4a2fec
     }
4a2fec
+    if (shadow_bios_after_incoming && bios_size != 128 * 1024) {
4a2fec
+        MachineClass *mc;
4a2fec
+
4a2fec
+        mc = MACHINE_GET_CLASS(current_machine);
4a2fec
+        error_report("machine %s only supports a 128KB BIOS image", mc->name);
4a2fec
+        exit(1);
4a2fec
+    }
4a2fec
     bios = g_malloc(sizeof(*bios));
4a2fec
     memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal);
4a2fec
     if (!isapc_ram_fw) {
4a2fec
@@ -240,6 +247,15 @@ void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
4a2fec
         return;
4a2fec
     }
4a2fec
 
4a2fec
+    if (shadow_bios_after_incoming) {
4a2fec
+        MachineClass *mc;
4a2fec
+
4a2fec
+        mc = MACHINE_GET_CLASS(current_machine);
4a2fec
+        error_report("flash-based firmware is not supported by machine %s",
4a2fec
+                     mc->name);
4a2fec
+        exit(1);
4a2fec
+    }
4a2fec
+
4a2fec
     if (kvm_enabled() && !kvm_readonly_mem_enabled()) {
4a2fec
         /* Older KVM cannot execute from device memory. So, flash memory
4a2fec
          * cannot be used unless the readonly memory kvm capability is present. */
4a2fec
diff --git a/hw/i386/shadow-bios.c b/hw/i386/shadow-bios.c
4a2fec
new file mode 100644
4a2fec
index 0000000..65a4cb8
4a2fec
--- /dev/null
4a2fec
+++ b/hw/i386/shadow-bios.c
4a2fec
@@ -0,0 +1,64 @@
4a2fec
+#include "qemu/osdep.h"
4a2fec
+#include "sysemu/sysemu.h"
4a2fec
+#include "target/i386/cpu.h"
4a2fec
+#include "exec/ram_addr.h"
4a2fec
+#include "qemu/cutils.h"
4a2fec
+
4a2fec
+void shadow_bios(void)
4a2fec
+{
4a2fec
+    RAMBlock *block, *ram, *oprom, *bios;
4a2fec
+    size_t one_meg, oprom_size, bios_size;
4a2fec
+    uint8_t *cd_seg_host, *ef_seg_host;
4a2fec
+
4a2fec
+    ram = NULL;
4a2fec
+    oprom = NULL;
4a2fec
+    bios = NULL;
4a2fec
+    rcu_read_lock();
4a2fec
+    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
4a2fec
+        if (strcmp("pc.ram", block->idstr) == 0) {
4a2fec
+            assert(ram == NULL);
4a2fec
+            ram = block;
4a2fec
+        } else if (strcmp("pc.rom", block->idstr) == 0) {
4a2fec
+            assert(oprom == NULL);
4a2fec
+            oprom = block;
4a2fec
+        } else if (strcmp("pc.bios", block->idstr) == 0) {
4a2fec
+            assert(bios == NULL);
4a2fec
+            bios = block;
4a2fec
+        }
4a2fec
+    }
4a2fec
+    assert(ram != NULL);
4a2fec
+    assert(oprom != NULL);
4a2fec
+    assert(bios != NULL);
4a2fec
+    assert(memory_region_is_ram(ram->mr));
4a2fec
+    assert(memory_region_is_ram(oprom->mr));
4a2fec
+    assert(memory_region_is_ram(bios->mr));
4a2fec
+    assert(int128_eq(ram->mr->size, int128_make64(ram->used_length)));
4a2fec
+    assert(int128_eq(oprom->mr->size, int128_make64(oprom->used_length)));
4a2fec
+    assert(int128_eq(bios->mr->size, int128_make64(bios->used_length)));
4a2fec
+
4a2fec
+    one_meg = 1024 * 1024;
4a2fec
+    oprom_size = 128 * 1024;
4a2fec
+    bios_size = 128 * 1024;
4a2fec
+    assert(ram->used_length >= one_meg);
4a2fec
+    assert(oprom->used_length == oprom_size);
4a2fec
+    assert(bios->used_length == bios_size);
4a2fec
+
4a2fec
+    ef_seg_host = memory_region_get_ram_ptr(ram->mr) + (one_meg - bios_size);
4a2fec
+    cd_seg_host = ef_seg_host - oprom_size;
4a2fec
+
4a2fec
+    /* This is a crude hack, but we must distinguish a rhel6.x.0 machtype guest
4a2fec
+     * coming in from a RHEL-6 emulator (where shadowing has had no effect on
4a2fec
+     * "pc.ram") from a similar guest coming in from a RHEL-7 emulator (where
4a2fec
+     * shadowing has worked). In the latter case we must not trample the live
4a2fec
+     * SeaBIOS variables in "pc.ram".
4a2fec
+     */
4a2fec
+    if (buffer_is_zero(ef_seg_host, bios_size)) {
4a2fec
+        fprintf(stderr, "copying E and F segments from pc.bios to pc.ram\n");
4a2fec
+        memcpy(ef_seg_host, memory_region_get_ram_ptr(bios->mr), bios_size);
4a2fec
+    }
4a2fec
+    if (buffer_is_zero(cd_seg_host, oprom_size)) {
4a2fec
+        fprintf(stderr, "copying C and D segments from pc.rom to pc.ram\n");
4a2fec
+        memcpy(cd_seg_host, memory_region_get_ram_ptr(oprom->mr), oprom_size);
4a2fec
+    }
4a2fec
+    rcu_read_unlock();
4a2fec
+}
4a2fec
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
4a2fec
index f2e5072..3d86146 100644
4a2fec
--- a/hw/net/e1000.c
4a2fec
+++ b/hw/net/e1000.c
4a2fec
@@ -1595,6 +1595,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
4a2fec
 
4a2fec
     pci_conf = pci_dev->config;
4a2fec
 
4a2fec
+    if (!(d->compat_flags & E1000_FLAG_AUTONEG)) {
4a2fec
+        /*
4a2fec
+         * We have no capabilities, so capability list bit should normally be 0.
4a2fec
+         * Keep it on for compat machine types to avoid breaking migration.
4a2fec
+         * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for
4a2fec
+         * the machine types that need this.
4a2fec
+         */
4a2fec
+        pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
4a2fec
+    }
4a2fec
+
4a2fec
     /* TODO: RST# value should be 0, PCI spec 6.2.4 */
4a2fec
     pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
4a2fec
 
4a2fec
@@ -1657,7 +1667,7 @@ static void e1000_class_init(ObjectClass *klass, void *data)
4a2fec
 
4a2fec
     k->realize = pci_e1000_realize;
4a2fec
     k->exit = pci_e1000_uninit;
4a2fec
-    k->romfile = "efi-e1000.rom";
4a2fec
+    k->romfile = "pxe-e1000.rom";
4a2fec
     k->vendor_id = PCI_VENDOR_ID_INTEL;
4a2fec
     k->device_id = info->device_id;
4a2fec
     k->revision = info->revision;
4a2fec
@@ -1689,7 +1699,7 @@ static const TypeInfo e1000_base_info = {
4a2fec
 
4a2fec
 static const E1000Info e1000_devices[] = {
4a2fec
     {
4a2fec
-        .name      = "e1000",
4a2fec
+        .name      = "e1000-82540em",
4a2fec
         .device_id = E1000_DEV_ID_82540EM,
4a2fec
         .revision  = 0x03,
4a2fec
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
4a2fec
@@ -1708,6 +1718,11 @@ static const E1000Info e1000_devices[] = {
4a2fec
     },
4a2fec
 };
4a2fec
 
4a2fec
+static const TypeInfo e1000_default_info = {
4a2fec
+    .name          = "e1000",
4a2fec
+    .parent        = "e1000-82540em",
4a2fec
+};
4a2fec
+
4a2fec
 static void e1000_register_types(void)
4a2fec
 {
4a2fec
     int i;
4a2fec
@@ -1725,6 +1740,7 @@ static void e1000_register_types(void)
4a2fec
 
4a2fec
         type_register(&type_info);
4a2fec
     }
4a2fec
+    type_register_static(&e1000_default_info);
4a2fec
 }
4a2fec
 
4a2fec
 type_init(e1000_register_types)
4a2fec
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
4a2fec
index 798d681..8660955 100644
4a2fec
--- a/hw/net/ne2000.c
4a2fec
+++ b/hw/net/ne2000.c
4a2fec
@@ -771,7 +771,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
4a2fec
 
4a2fec
     k->realize = pci_ne2000_realize;
4a2fec
     k->exit = pci_ne2000_exit;
4a2fec
-    k->romfile = "efi-ne2k_pci.rom",
4a2fec
+    k->romfile = "pxe-ne2k_pci.rom",
4a2fec
     k->vendor_id = PCI_VENDOR_ID_REALTEK;
4a2fec
     k->device_id = PCI_DEVICE_ID_REALTEK_8029;
4a2fec
     k->class_id = PCI_CLASS_NETWORK_ETHERNET;
4a2fec
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
4a2fec
index 0acf8a4..eeab4ca 100644
4a2fec
--- a/hw/net/pcnet-pci.c
4a2fec
+++ b/hw/net/pcnet-pci.c
4a2fec
@@ -348,7 +348,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data)
4a2fec
 
4a2fec
     k->realize = pci_pcnet_realize;
4a2fec
     k->exit = pci_pcnet_uninit;
4a2fec
-    k->romfile = "efi-pcnet.rom",
4a2fec
+    k->romfile = "pxe-pcnet.rom",
4a2fec
     k->vendor_id = PCI_VENDOR_ID_AMD;
4a2fec
     k->device_id = PCI_DEVICE_ID_AMD_LANCE;
4a2fec
     k->revision = 0x10;
4a2fec
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
4a2fec
index 671c7e4..450658c 100644
4a2fec
--- a/hw/net/rtl8139.c
4a2fec
+++ b/hw/net/rtl8139.c
4a2fec
@@ -3472,7 +3472,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
4a2fec
 
4a2fec
     k->realize = pci_rtl8139_realize;
4a2fec
     k->exit = pci_rtl8139_uninit;
4a2fec
-    k->romfile = "efi-rtl8139.rom";
4a2fec
+    k->romfile = "pxe-rtl8139.rom";
4a2fec
     k->vendor_id = PCI_VENDOR_ID_REALTEK;
4a2fec
     k->device_id = PCI_DEVICE_ID_REALTEK_8139;
4a2fec
     k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */
4a2fec
diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs
4a2fec
index 7efc686..645ffdf 100644
4a2fec
--- a/hw/ppc/Makefile.objs
4a2fec
+++ b/hw/ppc/Makefile.objs
4a2fec
@@ -12,7 +12,7 @@ obj-y += spapr_pci_vfio.o
4a2fec
 endif
4a2fec
 obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o
4a2fec
 # PowerPC 4xx boards
4a2fec
-obj-y += ppc405_boards.o ppc4xx_devs.o ppc405_uc.o ppc440_bamboo.o
4a2fec
+obj-y += ppc4xx_devs.o ppc405_uc.o
4a2fec
 obj-y += ppc4xx_pci.o
4a2fec
 # PReP
4a2fec
 obj-$(CONFIG_PREP) += prep.o
4a2fec
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
4a2fec
index cec441c..268fd44 100644
4a2fec
--- a/hw/ppc/spapr.c
4a2fec
+++ b/hw/ppc/spapr.c
4a2fec
@@ -3537,6 +3537,7 @@ static const TypeInfo spapr_machine_info = {
4a2fec
     }                                                                \
4a2fec
     type_init(spapr_machine_register_##suffix)
4a2fec
 
4a2fec
+#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
 /*
4a2fec
  * pseries-2.10
4a2fec
  */
4a2fec
@@ -3630,6 +3631,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
4a2fec
         .property = "pre-2.8-migration",            \
4a2fec
         .value    = "on",                           \
4a2fec
     },
4a2fec
+#endif
4a2fec
 
4a2fec
 static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
4a2fec
                               uint64_t *buid, hwaddr *pio,
4a2fec
@@ -3680,6 +3682,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
4a2fec
      */
4a2fec
 }
4a2fec
 
4a2fec
+#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
 static void spapr_machine_2_7_instance_options(MachineState *machine)
4a2fec
 {
4a2fec
     sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
4a2fec
@@ -3839,6 +3842,127 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
4a2fec
     SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
4a2fec
 }
4a2fec
 DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
4a2fec
+#endif
4a2fec
+
4a2fec
+/*
4a2fec
+ * pseries-rhel7.4.0alt
4a2fec
+ */
4a2fec
+static void spapr_machine_rhel740alt_instance_options(MachineState *machine)
4a2fec
+{
4a2fec
+}
4a2fec
+
4a2fec
+static void spapr_machine_rhel740alt_class_options(MachineClass *mc)
4a2fec
+{
4a2fec
+    /* Defaults for the latest behaviour inherited from the base class */
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_SPAPR_MACHINE(rhel740alt, "rhel7.4.0alt", true);
4a2fec
+
4a2fec
+
4a2fec
+/*
4a2fec
+ * pseries-rhel7.4.0
4a2fec
+ */
4a2fec
+
4a2fec
+static void spapr_machine_rhel740_instance_options(MachineState *machine)
4a2fec
+{
4a2fec
+    spapr_machine_rhel740alt_instance_options(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void spapr_machine_rhel740_class_options(MachineClass *mc)
4a2fec
+{
4a2fec
+    spapr_machine_rhel740alt_class_options(mc);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false);
4a2fec
+
4a2fec
+/*
4a2fec
+ * pseries-rhel7.3.0
4a2fec
+ * like SPAPR_COMPAT_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3
4a2fec
+ */
4a2fec
+#define SPAPR_COMPAT_RHEL7_3 \
4a2fec
+    HW_COMPAT_RHEL7_3                               \
4a2fec
+    {                                               \
4a2fec
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
4a2fec
+        .property = "mem_win_size",                 \
4a2fec
+        .value    = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\
4a2fec
+    },                                              \
4a2fec
+    {                                               \
4a2fec
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
4a2fec
+        .property = "mem64_win_size",               \
4a2fec
+        .value    = "0",                            \
4a2fec
+    },                                              \
4a2fec
+    {                                               \
4a2fec
+        .driver = TYPE_POWERPC_CPU,                 \
4a2fec
+        .property = "pre-2.8-migration",            \
4a2fec
+        .value    = "on",                           \
4a2fec
+    },                                              \
4a2fec
+    {                                               \
4a2fec
+        .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,       \
4a2fec
+        .property = "pre-2.8-migration",            \
4a2fec
+        .value    = "on",                           \
4a2fec
+    },                                              \
4a2fec
+    {                                               \
4a2fec
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
4a2fec
+        .property = "pcie-extended-configuration-space",\
4a2fec
+        .value    = "off",                          \
4a2fec
+    },
4a2fec
+
4a2fec
+static void spapr_machine_rhel730_instance_options(MachineState *machine)
4a2fec
+{
4a2fec
+    sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
4a2fec
+
4a2fec
+    spapr_machine_rhel740_instance_options(machine);
4a2fec
+    spapr->use_hotplug_event_source = false;
4a2fec
+}
4a2fec
+
4a2fec
+static void spapr_machine_rhel730_class_options(MachineClass *mc)
4a2fec
+{
4a2fec
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
4a2fec
+
4a2fec
+    spapr_machine_rhel740_class_options(mc);
4a2fec
+    smc->tcg_default_cpu = "POWER7";
4a2fec
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_3);
4a2fec
+    smc->phb_placement = phb_placement_2_7;
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false);
4a2fec
+
4a2fec
+/*
4a2fec
+ * pseries-rhel7.2.0
4a2fec
+ */
4a2fec
+/* Should be like SPAPR_COMPAT_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration"
4a2fec
+ * has been backported to RHEL7_2 so we don't need it here.
4a2fec
+ */
4a2fec
+
4a2fec
+#define SPAPR_COMPAT_RHEL7_2 \
4a2fec
+    HW_COMPAT_RHEL7_2 \
4a2fec
+    { \
4a2fec
+        .driver   = "spapr-vlan", \
4a2fec
+        .property = "use-rx-buffer-pools", \
4a2fec
+        .value    = "off", \
4a2fec
+    },{ \
4a2fec
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
4a2fec
+        .property = "ddw",\
4a2fec
+        .value    = stringify(off),\
4a2fec
+    },
4a2fec
+
4a2fec
+
4a2fec
+static void spapr_machine_rhel720_instance_options(MachineState *machine)
4a2fec
+{
4a2fec
+    spapr_machine_rhel730_instance_options(machine);
4a2fec
+}
4a2fec
+
4a2fec
+static void spapr_machine_rhel720_class_options(MachineClass *mc)
4a2fec
+{
4a2fec
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
4a2fec
+
4a2fec
+    spapr_machine_rhel730_class_options(mc);
4a2fec
+    smc->use_ohci_by_default = true;
4a2fec
+    mc->has_hotpluggable_cpus = NULL;
4a2fec
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_2);
4a2fec
+}
4a2fec
+
4a2fec
+DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false);
4a2fec
 
4a2fec
 static void spapr_machine_register_types(void)
4a2fec
 {
4a2fec
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
4a2fec
index 1a5437a..cd9cdfa 100644
4a2fec
--- a/hw/smbios/smbios.c
4a2fec
+++ b/hw/smbios/smbios.c
4a2fec
@@ -743,6 +743,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
4a2fec
     SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer);
4a2fec
     SMBIOS_SET_DEFAULT(type1.product, product);
4a2fec
     SMBIOS_SET_DEFAULT(type1.version, version);
4a2fec
+    SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux");
4a2fec
     SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer);
4a2fec
     SMBIOS_SET_DEFAULT(type2.product, product);
4a2fec
     SMBIOS_SET_DEFAULT(type2.version, version);
4a2fec
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
4a2fec
index 976d520..339f336 100644
4a2fec
--- a/hw/timer/i8254_common.c
4a2fec
+++ b/hw/timer/i8254_common.c
4a2fec
@@ -267,7 +267,7 @@ static const VMStateDescription vmstate_pit_common = {
4a2fec
     .pre_save = pit_dispatch_pre_save,
4a2fec
     .post_load = pit_dispatch_post_load,
4a2fec
     .fields = (VMStateField[]) {
4a2fec
-        VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
4a2fec
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
4a2fec
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
4a2fec
                              vmstate_pit_channel, PITChannelState),
4a2fec
         VMSTATE_INT64(channels[0].next_transition_time,
4a2fec
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
4a2fec
index 82843ed..f2ed447 100644
4a2fec
--- a/hw/timer/mc146818rtc.c
4a2fec
+++ b/hw/timer/mc146818rtc.c
4a2fec
@@ -32,6 +32,7 @@
4a2fec
 #include "qapi/visitor.h"
4a2fec
 #include "qapi-event.h"
4a2fec
 #include "qmp-commands.h"
4a2fec
+#include "migration/migration.h"
4a2fec
 
4a2fec
 #ifdef TARGET_I386
4a2fec
 #include "hw/i386/apic.h"
4a2fec
@@ -835,6 +836,11 @@ static int rtc_post_load(void *opaque, int version_id)
4a2fec
 static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
4a2fec
 {
4a2fec
     RTCState *s = (RTCState *)opaque;
4a2fec
+
4a2fec
+    if (migrate_pre_2_2) {
4a2fec
+        return false;
4a2fec
+    }
4a2fec
+
4a2fec
     return s->irq_reinject_on_ack_count != 0;
4a2fec
 }
4a2fec
 
4a2fec
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
4a2fec
index e3562a4..465ed42 100644
4a2fec
--- a/hw/usb/hcd-uhci.c
4a2fec
+++ b/hw/usb/hcd-uhci.c
4a2fec
@@ -152,6 +152,8 @@ typedef struct UHCI_QH {
4a2fec
     uint32_t el_link;
4a2fec
 } UHCI_QH;
4a2fec
 
4a2fec
+bool ich9_uhci123_irqpin_override;
4a2fec
+
4a2fec
 static void uhci_async_cancel(UHCIAsync *async);
4a2fec
 static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td);
4a2fec
 static void uhci_resume(void *opaque);
4a2fec
@@ -1214,12 +1216,23 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
4a2fec
     UHCIState *s = UHCI(dev);
4a2fec
     uint8_t *pci_conf = s->dev.config;
4a2fec
     int i;
4a2fec
+    int irq_pin;
4a2fec
 
4a2fec
     pci_conf[PCI_CLASS_PROG] = 0x00;
4a2fec
     /* TODO: reset value should be 0. */
4a2fec
     pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
4a2fec
 
4a2fec
-    pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
4a2fec
+    if (ich9_uhci123_irqpin_override &&
4a2fec
+        u->info.vendor_id == PCI_VENDOR_ID_INTEL &&
4a2fec
+        (u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI1 ||
4a2fec
+         u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI2 ||
4a2fec
+         u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI3)) {
4a2fec
+        fprintf(stderr, "RHEL-6 compat: %s: irq_pin = 3\n", u->info.name);
4a2fec
+        irq_pin = 3;
4a2fec
+    } else {
4a2fec
+        irq_pin = u->info.irq_pin;
4a2fec
+    }
4a2fec
+    pci_config_set_interrupt_pin(pci_conf, irq_pin + 1);
4a2fec
 
4a2fec
     if (s->masterbus) {
4a2fec
         USBPort *ports[NB_PORTS];
4a2fec
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
4a2fec
index 204ea69..10848db 100644
4a2fec
--- a/hw/usb/hcd-xhci.c
4a2fec
+++ b/hw/usb/hcd-xhci.c
4a2fec
@@ -3555,9 +3555,25 @@ static const VMStateDescription vmstate_xhci_slot = {
4a2fec
     }
4a2fec
 };
4a2fec
 
4a2fec
+static void xhci_event_pre_save(void *opaque)
4a2fec
+{
4a2fec
+    XHCIEvent *s = opaque;
4a2fec
+
4a2fec
+    s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
4a2fec
+    s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
4a2fec
+}
4a2fec
+
4a2fec
+bool migrate_cve_2014_5263_xhci_fields;
4a2fec
+
4a2fec
+static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
4a2fec
+{
4a2fec
+    return migrate_cve_2014_5263_xhci_fields;
4a2fec
+}
4a2fec
+
4a2fec
 static const VMStateDescription vmstate_xhci_event = {
4a2fec
     .name = "xhci-event",
4a2fec
     .version_id = 1,
4a2fec
+    .pre_save = xhci_event_pre_save,
4a2fec
     .fields = (VMStateField[]) {
4a2fec
         VMSTATE_UINT32(type,   XHCIEvent),
4a2fec
         VMSTATE_UINT32(ccode,  XHCIEvent),
4a2fec
@@ -3566,6 +3582,8 @@ static const VMStateDescription vmstate_xhci_event = {
4a2fec
         VMSTATE_UINT32(flags,  XHCIEvent),
4a2fec
         VMSTATE_UINT8(slotid,  XHCIEvent),
4a2fec
         VMSTATE_UINT8(epid,    XHCIEvent),
4a2fec
+        VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
4a2fec
+        VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
4a2fec
         VMSTATE_END_OF_LIST()
4a2fec
     }
4a2fec
 };
4a2fec
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
4a2fec
index fc36a4c..89d4cf7 100644
4a2fec
--- a/hw/usb/hcd-xhci.h
4a2fec
+++ b/hw/usb/hcd-xhci.h
4a2fec
@@ -153,6 +153,8 @@ typedef struct XHCIEvent {
4a2fec
     uint32_t flags;
4a2fec
     uint8_t slotid;
4a2fec
     uint8_t epid;
4a2fec
+    uint8_t cve_2014_5263_a;
4a2fec
+    uint8_t cve_2014_5263_b;
4a2fec
 } XHCIEvent;
4a2fec
 
4a2fec
 typedef struct XHCIInterrupter {
4a2fec
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
4a2fec
index 8b0d6b6..eccf809 100644
4a2fec
--- a/hw/virtio/virtio-pci.c
4a2fec
+++ b/hw/virtio/virtio-pci.c
4a2fec
@@ -2394,7 +2394,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data)
4a2fec
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
4a2fec
     VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass);
4a2fec
 
4a2fec
-    k->romfile = "efi-virtio.rom";
4a2fec
+    k->romfile = "pxe-virtio.rom";
4a2fec
     k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
4a2fec
     k->device_id = PCI_DEVICE_ID_VIRTIO_NET;
4a2fec
     k->revision = VIRTIO_PCI_ABI_VERSION;
4a2fec
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
4a2fec
index 464947f..e7a2bc2 100644
4a2fec
--- a/hw/virtio/virtio.c
4a2fec
+++ b/hw/virtio/virtio.c
4a2fec
@@ -24,6 +24,7 @@
4a2fec
 #include "hw/virtio/virtio-access.h"
4a2fec
 #include "sysemu/dma.h"
4a2fec
 
4a2fec
+#include "standard-headers/linux/virtio_net.h"
4a2fec
 /*
4a2fec
  * The alignment to use between consumer and producer parts of vring.
4a2fec
  * x86 pagesize again. This is the default, used by transports like PCI
4a2fec
@@ -1984,7 +1985,24 @@ const VMStateInfo  virtio_vmstate_info = {
4a2fec
 static int virtio_set_features_nocheck(VirtIODevice *vdev, uint64_t val)
4a2fec
 {
4a2fec
     VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
4a2fec
-    bool bad = (val & ~(vdev->host_features)) != 0;
4a2fec
+    bool bad;
4a2fec
+    uint64_t ctrl_guest_mask = 1ull << VIRTIO_NET_F_CTRL_GUEST_OFFLOADS;
4a2fec
+
4a2fec
+    if (vdev->rhel6_ctrl_guest_workaround && (val & ctrl_guest_mask) &&
4a2fec
+          !(vdev->host_features & ctrl_guest_mask)) {
4a2fec
+        /*
4a2fec
+         * This works around a mistake in the definition of the rhel6.[56].0
4a2fec
+         * machinetypes, ctrl-guest-offload was not set in qemu-kvm-rhev for
4a2fec
+         * those machine types, but is set on the rhel6 qemu-kvm-rhev build.
4a2fec
+         * If an incoming rhel6 guest uses it then we need to allow it.
4a2fec
+         * Note: There's a small race where a guest read the flag but didn't
4a2fec
+         * declare it's useage yet.
4a2fec
+         */
4a2fec
+        fprintf(stderr, "RHEL6 ctrl_guest_offload workaround\n");
4a2fec
+        vdev->host_features |= ctrl_guest_mask;
4a2fec
+    }
4a2fec
+
4a2fec
+    bad = (val & ~(vdev->host_features)) != 0;
4a2fec
 
4a2fec
     val &= vdev->host_features;
4a2fec
     if (k->set_features) {
4a2fec
@@ -2548,6 +2566,8 @@ static void virtio_device_instance_finalize(Object *obj)
4a2fec
 
4a2fec
 static Property virtio_properties[] = {
4a2fec
     DEFINE_VIRTIO_COMMON_FEATURES(VirtIODevice, host_features),
4a2fec
+    DEFINE_PROP_BOOL("__com.redhat_rhel6_ctrl_guest_workaround", VirtIODevice,
4a2fec
+                     rhel6_ctrl_guest_workaround, false),
4a2fec
     DEFINE_PROP_END_OF_LIST(),
4a2fec
 };
4a2fec
 
4a2fec
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
4a2fec
index 33b0ff3..a1f533d 100644
4a2fec
--- a/include/hw/arm/virt.h
4a2fec
+++ b/include/hw/arm/virt.h
4a2fec
@@ -108,6 +108,7 @@ typedef struct {
4a2fec
     int psci_conduit;
4a2fec
 } VirtMachineState;
4a2fec
 
4a2fec
+#if 0 /* disabled for Red Hat Enterprise Linux */
4a2fec
 #define TYPE_VIRT_MACHINE   MACHINE_TYPE_NAME("virt")
4a2fec
 #define VIRT_MACHINE(obj) \
4a2fec
     OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
4a2fec
@@ -116,6 +117,27 @@ typedef struct {
4a2fec
 #define VIRT_MACHINE_CLASS(klass) \
4a2fec
     OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE)
4a2fec
 
4a2fec
+#else
4a2fec
+#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel")
4a2fec
+#define VIRT_MACHINE(obj) \
4a2fec
+    OBJECT_CHECK(VirtMachineState, (obj), TYPE_RHEL_MACHINE)
4a2fec
+#define VIRT_MACHINE_GET_CLASS(obj) \
4a2fec
+    OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_RHEL_MACHINE)
4a2fec
+#define VIRT_MACHINE_CLASS(klass) \
4a2fec
+    OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE)
4a2fec
+#endif
4a2fec
+
4a2fec
+/* This macro is for changes to properties that are RHEL specific,
4a2fec
+ * different to the current upstream and to be applied to the latest
4a2fec
+ * machine type.
4a2fec
+ */
4a2fec
+#define ARM_RHEL_COMPAT \
4a2fec
+    {\
4a2fec
+        .driver   = "virtio-net-pci",\
4a2fec
+        .property = "romfile",\
4a2fec
+        .value    = "",\
4a2fec
+    },
4a2fec
+
4a2fec
 void virt_acpi_setup(VirtMachineState *vms);
4a2fec
 
4a2fec
 #endif /* QEMU_ARM_VIRT_H */
4a2fec
diff --git a/include/hw/compat.h b/include/hw/compat.h
4a2fec
index 08f3600..bb138cd 100644
4a2fec
--- a/include/hw/compat.h
4a2fec
+++ b/include/hw/compat.h
4a2fec
@@ -227,6 +227,186 @@
4a2fec
         .driver   = "virtio-pci",\
4a2fec
         .property = "virtio-pci-bus-master-bug-migration",\
4a2fec
         .value    = "on",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-net-device",\
4a2fec
+        .property = "x-mtu-bypass-backend",\
4a2fec
+        .value    = "off",\
4a2fec
+    },
4a2fec
+
4a2fec
+/* Mostly like HW_COMPAT_2_1 but:
4a2fec
+ *    we don't need virtio-scsi-pci since 7.0 already had that on
4a2fec
+ *
4a2fec
+ * RH: Note, qemu-extended-regs should have been enabled in the 7.1 
4a2fec
+ * machine type, but was accidentally turned off in 7.2 onwards.
4a2fec
+ *
4a2fec
+ */
4a2fec
+#define HW_COMPAT_RHEL7_1 \
4a2fec
+        { /* COMPAT_RHEL7.1 */ \
4a2fec
+            .driver   = "intel-hda-generic",\
4a2fec
+            .property = "old_msi_addr",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{\
4a2fec
+            .driver   = "VGA",\
4a2fec
+            .property = "qemu-extended-regs",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "secondary-vga",\
4a2fec
+            .property = "qemu-extended-regs",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-mouse",\
4a2fec
+            .property = "usb_version",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "usb-kbd",\
4a2fec
+            .property = "usb_version",\
4a2fec
+            .value    = stringify(1),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "virtio-pci-bus-master-bug-migration",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-blk-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-balloon-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-serial-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-9p-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-rng-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ \
4a2fec
+            .driver   = "migration",\
4a2fec
+            .property = "send-configuration",\
4a2fec
+            .value    = "off",\
4a2fec
+        },
4a2fec
+
4a2fec
+/* Mostly like HW_COMPAT_2_4 + 2_3 but:
4a2fec
+ *  we don't need "any_layout" as it has been backported to 7.2
4a2fec
+ */
4a2fec
+
4a2fec
+#define HW_COMPAT_RHEL7_2 \
4a2fec
+        {\
4a2fec
+            .driver   = "virtio-blk-device",\
4a2fec
+            .property = "scsi",\
4a2fec
+            .value    = "true",\
4a2fec
+        },{\
4a2fec
+            .driver   = "e1000-82540em",\
4a2fec
+            .property = "extra_mac_registers",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "x-disable-pcie",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "migrate-extra",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "fw_cfg_mem",\
4a2fec
+            .property = "dma_enabled",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "fw_cfg_io",\
4a2fec
+            .property = "dma_enabled",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "isa-fdc",\
4a2fec
+            .property = "fallback",\
4a2fec
+            .value    = "144",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "disable-modern",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "disable-legacy",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = TYPE_PCI_DEVICE,\
4a2fec
+            .property = "x-pcie-lnksta-dllla",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 */ \
4a2fec
+            .driver   = "virtio-pci",\
4a2fec
+            .property = "page-per-vq",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 from HW_COMPAT_2_4 added in 2.9 */ \
4a2fec
+            .driver   = "vmgenid",\
4a2fec
+            .property = "x-write-pointer-available",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
4a2fec
+            .driver   = "migration",\
4a2fec
+            .property = "send-section-footer",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
4a2fec
+            .driver   = "migration",\
4a2fec
+            .property = "store-global-state",\
4a2fec
+            .value    = "off",\
4a2fec
+        },
4a2fec
+
4a2fec
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
4a2fec
+ * disable-modern, disable-legacy, page-per-vq have already been
4a2fec
+ * backported to RHEL7.3
4a2fec
+ */
4a2fec
+#define HW_COMPAT_RHEL7_3 \
4a2fec
+    { /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-mmio",\
4a2fec
+        .property = "format_transport_address",\
4a2fec
+        .value    = "off",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-serial-device",\
4a2fec
+        .property = "emergency-write",\
4a2fec
+        .value    = "off",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "ioapic",\
4a2fec
+        .property = "version",\
4a2fec
+        .value    = "0x11",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "intel-iommu",\
4a2fec
+        .property = "x-buggy-eim",\
4a2fec
+        .value    = "true",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-pci",\
4a2fec
+        .property = "x-ignore-backend-features",\
4a2fec
+        .value    = "on",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "fw_cfg_mem",\
4a2fec
+        .property = "x-file-slots",\
4a2fec
+        .value    = stringify(0x10),\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "fw_cfg_io",\
4a2fec
+        .property = "x-file-slots",\
4a2fec
+        .value    = stringify(0x10),\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "pflash_cfi01",\
4a2fec
+        .property = "old-multiple-chip-handling",\
4a2fec
+        .value    = "on",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = TYPE_PCI_DEVICE,\
4a2fec
+        .property = "x-pcie-extcap-init",\
4a2fec
+        .value    = "off",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-pci",\
4a2fec
+        .property = "x-pcie-deverr-init",\
4a2fec
+        .value    = "off",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-pci",\
4a2fec
+        .property = "x-pcie-lnkctl-init",\
4a2fec
+        .value    = "off",\
4a2fec
+    },{ /* HW_COMPAT_RHEL7_3 */ \
4a2fec
+        .driver   = "virtio-pci",\
4a2fec
+        .property = "x-pcie-pm-init",\
4a2fec
+        .value    = "off",\
4a2fec
     },
4a2fec
 
4a2fec
 #endif /* HW_COMPAT_H */
4a2fec
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
4a2fec
index d80859b..b808a9b 100644
4a2fec
--- a/include/hw/i386/pc.h
4a2fec
+++ b/include/hw/i386/pc.h
4a2fec
@@ -987,4 +987,446 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
4a2fec
     type_init(pc_machine_init_##suffix)
4a2fec
 
4a2fec
 extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
4a2fec
+
4a2fec
+/* See include/hw/compat.h for shared compatibility lists */
4a2fec
+
4a2fec
+/* This macro is for changes to properties that are RHEL specific,
4a2fec
+ * different to the current upstream and to be applied to the latest
4a2fec
+ * machine type.
4a2fec
+ */
4a2fec
+#define PC_RHEL_COMPAT \
4a2fec
+        { /* PC_RHEL_COMPAT */ \
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "host-phys-bits",\
4a2fec
+            .value = "on",\
4a2fec
+        },
4a2fec
+
4a2fec
+#define PC_RHEL7_3_COMPAT \
4a2fec
+        HW_COMPAT_RHEL7_3 \
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
4a2fec
+             .driver   = "kvmclock",\
4a2fec
+             .property = "x-mach-use-reliable-get-clock",\
4a2fec
+             .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "l3-cache",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "full-cpuid-auto-level",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "family",\
4a2fec
+            .value    = "15",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "model",\
4a2fec
+            .value    = "6",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "stepping",\
4a2fec
+            .value    = "1",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
4a2fec
+            .driver   = "isa-pcspk",\
4a2fec
+            .property = "migrate",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "cpuid-0xb",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
4a2fec
+            .driver   = "ICH9-LPC",\
4a2fec
+            .property = "x-smi-broadcast",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "vmware-cpuid-freq",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
4a2fec
+            .driver   = "Haswell-" TYPE_X86_CPU,\
4a2fec
+            .property = "stepping",\
4a2fec
+            .value    = "1",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_3 added in 2.9 */ \
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "kvm-no-smi-migration",\
4a2fec
+            .value    = "on",\
4a2fec
+        },
4a2fec
+
4a2fec
+#define PC_RHEL7_2_COMPAT \
4a2fec
+        HW_COMPAT_RHEL7_2 \
4a2fec
+	{\
4a2fec
+		.driver = "phenom" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "rdtscp",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "sse4a",\
4a2fec
+            .value    = "on",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "abm",\
4a2fec
+            .value    = "on",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "Haswell-" TYPE_X86_CPU,\
4a2fec
+            .property = "abm",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "Haswell-noTSX-" TYPE_X86_CPU,\
4a2fec
+            .property = "abm",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "Broadwell-" TYPE_X86_CPU,\
4a2fec
+            .property = "abm",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "Broadwell-noTSX-" TYPE_X86_CPU,\
4a2fec
+            .property = "abm",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "host" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "host-cache-info",\
4a2fec
+            .value    = "on",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "check",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "qemu32" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "popcnt",\
4a2fec
+            .value    = "on",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = TYPE_X86_CPU,\
4a2fec
+            .property = "arat",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "usb-redir",\
4a2fec
+            .property = "streams",\
4a2fec
+            .value    = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver = TYPE_X86_CPU,\
4a2fec
+            .property = "fill-mtrr-mask",\
4a2fec
+            .value = "off",\
4a2fec
+        },\
4a2fec
+        { /* PC_RHEL7_2_COMPAT */ \
4a2fec
+            .driver   = "apic-common",\
4a2fec
+            .property = "legacy-instance-id",\
4a2fec
+            .value    = "on",\
4a2fec
+        },
4a2fec
+
4a2fec
+
4a2fec
+
4a2fec
+#define PC_RHEL7_1_COMPAT \
4a2fec
+        HW_COMPAT_RHEL7_1 \
4a2fec
+	{\
4a2fec
+		.driver = "kvm64" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "kvm32" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Conroe" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Penryn" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Nehalem" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "SandyBridge" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G1" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G2" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G4" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G5" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vme",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "f16c",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "rdrand",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "f16c",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "rdrand",\
4a2fec
+		.value = "off",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "coreduo" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vmx",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "core2duo" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "vmx",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+        { /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(4),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "kvm64" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(5),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "pentium3" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(2),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "n270" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(5),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Conroe" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(4),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Penryn" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(4),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Nehalem" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-level",\
4a2fec
+            .value    = stringify(4),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "n270" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Penryn" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Conroe" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Nehalem" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "SandyBridge" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "IvyBridge" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Haswell" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Haswell-noTSX" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Broadwell" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },{ /* PC_RHEL7_1_COMPAT */ \
4a2fec
+            .driver   = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
4a2fec
+            .property = "min-xlevel",\
4a2fec
+            .value    = stringify(0x8000000a),\
4a2fec
+        },
4a2fec
+
4a2fec
+/*
4a2fec
+ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
4a2fec
+ * types as the PC_COMPAT_* do for upstream types.
4a2fec
+ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
4a2fec
+ * PC_RHEL6_*_COMPAT apply to i440fx types only, and therefore live
4a2fec
+ * in pc_piix.c.
4a2fec
+ */
4a2fec
+
4a2fec
+/*
4a2fec
+ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_*
4a2fec
+ * between our base and 1.5, less stuff backported to RHEL-7.0
4a2fec
+ * (usb-device.msos-desc), less stuff for devices we changed
4a2fec
+ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x,
4a2fec
+ * pci-serial-4x) in 7.0.
4a2fec
+ */
4a2fec
+#define PC_RHEL7_0_COMPAT \
4a2fec
+        {\
4a2fec
+            .driver   = "virtio-scsi-pci",\
4a2fec
+            .property = "any_layout",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "PIIX4_PM",\
4a2fec
+            .property = "memory-hotplug-support",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "apic",\
4a2fec
+            .property = "version",\
4a2fec
+            .value    = stringify(0x11),\
4a2fec
+        },{\
4a2fec
+            .driver   = "nec-usb-xhci",\
4a2fec
+            .property = "superspeed-ports-first",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "nec-usb-xhci",\
4a2fec
+            .property = "force-pcie-endcap",\
4a2fec
+            .value    = "on",\
4a2fec
+        },{\
4a2fec
+            .driver   = "pci-serial",\
4a2fec
+            .property = "prog_if",\
4a2fec
+            .value    = stringify(0),\
4a2fec
+        },{\
4a2fec
+            .driver   = "virtio-net-pci",\
4a2fec
+            .property = "guest_announce",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "ICH9-LPC",\
4a2fec
+            .property = "memory-hotplug-support",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "xio3130-downstream",\
4a2fec
+            .property = COMPAT_PROP_PCP,\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "ioh3420",\
4a2fec
+            .property = COMPAT_PROP_PCP,\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "PIIX4_PM",\
4a2fec
+            .property = "acpi-pci-hotplug-with-bridge-support",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{\
4a2fec
+            .driver   = "e1000",\
4a2fec
+            .property = "mitigation",\
4a2fec
+            .value    = "off",\
4a2fec
+        },{ \
4a2fec
+            .driver   = "virtio-net-pci", \
4a2fec
+            .property = "ctrl_guest_offloads", \
4a2fec
+            .value    = "off", \
4a2fec
+        },\
4a2fec
+	{\
4a2fec
+		.driver = "Conroe" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Penryn" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Nehalem" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Westmere" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G1" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G2" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G4" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},\
4a2fec
+	{\
4a2fec
+		.driver = "Opteron_G5" "-" TYPE_X86_CPU,\
4a2fec
+		.property = "x2apic",\
4a2fec
+		.value = "on",\
4a2fec
+	},
4a2fec
 #endif
4a2fec
diff --git a/include/hw/usb.h b/include/hw/usb.h
4a2fec
index eb28655..e2d3d77 100644
4a2fec
--- a/include/hw/usb.h
4a2fec
+++ b/include/hw/usb.h
4a2fec
@@ -608,4 +608,11 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
4a2fec
                    uint8_t interface_class, uint8_t interface_subclass,
4a2fec
                    uint8_t interface_protocol);
4a2fec
 
4a2fec
+
4a2fec
+/* hcd-uhci.c -- RHEL-6 machine type compatibility */
4a2fec
+extern bool ich9_uhci123_irqpin_override;
4a2fec
+
4a2fec
+/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
4a2fec
+extern bool migrate_cve_2014_5263_xhci_fields;
4a2fec
+
4a2fec
 #endif
4a2fec
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
4a2fec
index 80c45c3..5faa359 100644
4a2fec
--- a/include/hw/virtio/virtio.h
4a2fec
+++ b/include/hw/virtio/virtio.h
4a2fec
@@ -95,6 +95,7 @@ struct VirtIODevice
4a2fec
     uint8_t device_endian;
4a2fec
     bool use_guest_notifier_mask;
4a2fec
     AddressSpace *dma_as;
4a2fec
+    bool rhel6_ctrl_guest_workaround;
4a2fec
     QLIST_HEAD(, VirtQueue) *vector_queues;
4a2fec
 };
4a2fec
 
4a2fec
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
4a2fec
index b213696..9caaacf 100644
4a2fec
--- a/include/sysemu/sysemu.h
4a2fec
+++ b/include/sysemu/sysemu.h
4a2fec
@@ -92,6 +92,8 @@ void qemu_add_machine_init_done_notifier(Notifier *notify);
4a2fec
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
4a2fec
 
4a2fec
 void qemu_announce_self(void);
4a2fec
+extern bool shadow_bios_after_incoming;
4a2fec
+void shadow_bios(void);
4a2fec
 
4a2fec
 extern int autostart;
4a2fec
 
4a2fec
diff --git a/migration/migration.c b/migration/migration.c
4a2fec
index c3fe0ed..c7b4d3d 100644
4a2fec
--- a/migration/migration.c
4a2fec
+++ b/migration/migration.c
4a2fec
@@ -96,6 +96,8 @@ enum mig_rp_message_type {
4a2fec
     MIG_RP_MSG_MAX
4a2fec
 };
4a2fec
 
4a2fec
+bool migrate_pre_2_2;
4a2fec
+
4a2fec
 /* When we add fault tolerance, we could have several
4a2fec
    migrations at once.  For now we don't need to add
4a2fec
    dynamic creation of migration */
4a2fec
diff --git a/migration/migration.h b/migration/migration.h
4a2fec
index 148c9fa..8771ab0 100644
4a2fec
--- a/migration/migration.h
4a2fec
+++ b/migration/migration.h
4a2fec
@@ -193,4 +193,10 @@ void migrate_send_rp_pong(MigrationIncomingState *mis,
4a2fec
 void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rbname,
4a2fec
                               ram_addr_t start, size_t len);
4a2fec
 
4a2fec
+/*
4a2fec
+ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards
4a2fec
+ * migration compatibility.
4a2fec
+ */
4a2fec
+extern bool migrate_pre_2_2;
4a2fec
+
4a2fec
 #endif
4a2fec
diff --git a/migration/savevm.c b/migration/savevm.c
4a2fec
index fdd15fa..5eb3504 100644
4a2fec
--- a/migration/savevm.c
4a2fec
+++ b/migration/savevm.c
4a2fec
@@ -42,6 +42,7 @@
4a2fec
 #include "postcopy-ram.h"
4a2fec
 #include "qapi/qmp/qerror.h"
4a2fec
 #include "qemu/error-report.h"
4a2fec
+#include "qemu/rcu_queue.h"
4a2fec
 #include "sysemu/cpus.h"
4a2fec
 #include "exec/memory.h"
4a2fec
 #include "exec/target_page.h"
4a2fec
@@ -80,6 +81,7 @@ enum qemu_vm_cmd {
4a2fec
     MIG_CMD_PACKAGED,          /* Send a wrapped stream within this stream */
4a2fec
     MIG_CMD_MAX
4a2fec
 };
4a2fec
+bool shadow_bios_after_incoming;
4a2fec
 
4a2fec
 #define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24)
4a2fec
 static struct mig_cmd_args {
4a2fec
@@ -2079,6 +2081,13 @@ int qemu_loadvm_state(QEMUFile *f)
4a2fec
     }
4a2fec
 
4a2fec
     qemu_loadvm_state_cleanup();
4a2fec
+    /* Supplement SeaBIOS's shadowing now, because it was useless when the
4a2fec
+     * incoming VM started on the RHEL-6 emulator.
4a2fec
+     */
4a2fec
+    if (shadow_bios_after_incoming) {
4a2fec
+        shadow_bios();
4a2fec
+    }
4a2fec
+
4a2fec
     cpu_synchronize_all_post_init();
4a2fec
 
4a2fec
     return ret;
4a2fec
diff --git a/numa.c b/numa.c
4a2fec
index e32af04..be78167 100644
4a2fec
--- a/numa.c
4a2fec
+++ b/numa.c
4a2fec
@@ -566,6 +566,19 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
4a2fec
         return;
4a2fec
     }
4a2fec
 
4a2fec
+    /* The shadow_bios_after_incoming hack at savevm.c:shadow_bios() is not
4a2fec
+     * able to handle the multiple memory blocks added when using NUMA
4a2fec
+     * memdevs. We can disallow -numa memdev= when using rhel6.* machine-types
4a2fec
+     * because RHEL-6 didn't support the NUMA memdev option.
4a2fec
+     */
4a2fec
+    if (shadow_bios_after_incoming) {
4a2fec
+        MachineClass *mc;
4a2fec
+        mc = MACHINE_GET_CLASS(current_machine);
4a2fec
+        error_report("-numa memdev is not supported by machine %s",
4a2fec
+                     mc->name);
4a2fec
+        exit(1);
4a2fec
+    }
4a2fec
+
4a2fec
     memory_region_init(mr, owner, name, ram_size);
4a2fec
     for (i = 0; i < MAX_NODES; i++) {
4a2fec
         uint64_t size = numa_info[i].node_mem;
4a2fec
diff --git a/qdev-monitor.c b/qdev-monitor.c
4a2fec
index 8fd6df9..b05ae6d 100644
4a2fec
--- a/qdev-monitor.c
4a2fec
+++ b/qdev-monitor.c
4a2fec
@@ -44,7 +44,6 @@ typedef struct QDevAlias
4a2fec
 
4a2fec
 /* Please keep this table sorted by typename. */
4a2fec
 static const QDevAlias qdev_alias_table[] = {
4a2fec
-    { "e1000", "e1000-82540em" },
4a2fec
     { "ich9-ahci", "ahci" },
4a2fec
     { "kvm-pci-assign", "pci-assign" },
4a2fec
     { "lsi53c895a", "lsi" },
4a2fec
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
4a2fec
index bcef7ee..ffb13d1 100755
4a2fec
--- a/scripts/vmstate-static-checker.py
4a2fec
+++ b/scripts/vmstate-static-checker.py
4a2fec
@@ -104,7 +104,6 @@ def get_changed_sec_name(sec):
4a2fec
     # Section names can change -- see commit 292b1634 for an example.
4a2fec
     changes = {
4a2fec
         "ICH9 LPC": "ICH9-LPC",
4a2fec
-        "e1000-82540em": "e1000",
4a2fec
     }
4a2fec
 
4a2fec
     for item in changes:
4a2fec
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
4a2fec
index e69c217..b24da3b 100644
4a2fec
--- a/stubs/Makefile.objs
4a2fec
+++ b/stubs/Makefile.objs
4a2fec
@@ -40,3 +40,4 @@ stub-obj-y += pc_madt_cpu_entry.o
4a2fec
 stub-obj-y += vmgenid.o
4a2fec
 stub-obj-y += xen-common.o
4a2fec
 stub-obj-y += xen-hvm.o
4a2fec
+stub-obj-y += shadow-bios.o
4a2fec
diff --git a/stubs/shadow-bios.c b/stubs/shadow-bios.c
4a2fec
new file mode 100644
4a2fec
index 0000000..c77cd7a
4a2fec
--- /dev/null
4a2fec
+++ b/stubs/shadow-bios.c
4a2fec
@@ -0,0 +1,7 @@
4a2fec
+#include "qemu/osdep.h"
4a2fec
+#include "sysemu/sysemu.h"
4a2fec
+
4a2fec
+void shadow_bios(void)
4a2fec
+{
4a2fec
+  abort();
4a2fec
+}
4a2fec
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
4a2fec
index ddc45ab..7f52680 100644
4a2fec
--- a/target/i386/cpu.c
4a2fec
+++ b/target/i386/cpu.c
4a2fec
@@ -754,20 +754,29 @@ struct X86CPUDefinition {
4a2fec
 
4a2fec
 static X86CPUDefinition builtin_x86_defs[] = {
4a2fec
     {
4a2fec
+        /* qemu64 is the default CPU model for all *-rhel7.* machine-types.
4a2fec
+         * The default on RHEL-6 was cpu64-rhel6.
4a2fec
+         * libvirt assumes that qemu64 is the default for _all_ machine-types,
4a2fec
+         * so we should try to keep qemu64 and cpu64-rhel6 as similar as
4a2fec
+         * possible.
4a2fec
+         */
4a2fec
         .name = "qemu64",
4a2fec
         .level = 0xd,
4a2fec
         .vendor = CPUID_VENDOR_AMD,
4a2fec
         .family = 6,
4a2fec
-        .model = 6,
4a2fec
+        .model = 13,
4a2fec
         .stepping = 3,
4a2fec
-        .features[FEAT_1_EDX] =
4a2fec
-            PPRO_FEATURES |
4a2fec
-            CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA |
4a2fec
-            CPUID_PSE36,
4a2fec
-        .features[FEAT_1_ECX] =
4a2fec
-            CPUID_EXT_SSE3 | CPUID_EXT_CX16,
4a2fec
-        .features[FEAT_8000_0001_EDX] =
4a2fec
-            CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
4a2fec
+        .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR |
4a2fec
+            CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |
4a2fec
+            CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC |
4a2fec
+            CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC |
4a2fec
+            CPUID_PSE | CPUID_DE | CPUID_FP87,
4a2fec
+        .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3,
4a2fec
+        .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR |
4a2fec
+            CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV |
4a2fec
+            CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
4a2fec
+            CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |
4a2fec
+            CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU,
4a2fec
         .features[FEAT_8000_0001_ECX] =
4a2fec
             CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM,
4a2fec
         .xlevel = 0x8000000A,
4a2fec
@@ -993,6 +1002,29 @@ static X86CPUDefinition builtin_x86_defs[] = {
4a2fec
         .model_id = "Intel(R) Atom(TM) CPU N270   @ 1.60GHz",
4a2fec
     },
4a2fec
     {
4a2fec
+        .name = "cpu64-rhel6",
4a2fec
+        .level = 4,
4a2fec
+        .vendor = CPUID_VENDOR_AMD,
4a2fec
+        .family = 6,
4a2fec
+        .model = 13,
4a2fec
+        .stepping = 3,
4a2fec
+        .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR |
4a2fec
+             CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |
4a2fec
+             CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC |
4a2fec
+             CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC |
4a2fec
+             CPUID_PSE | CPUID_DE | CPUID_FP87,
4a2fec
+        .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3,
4a2fec
+        .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR |
4a2fec
+             CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV |
4a2fec
+             CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
4a2fec
+             CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |
4a2fec
+             CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU,
4a2fec
+        .features[FEAT_8000_0001_ECX] = CPUID_EXT3_SSE4A | CPUID_EXT3_ABM |
4a2fec
+             CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
4a2fec
+        .xlevel = 0x8000000A,
4a2fec
+        .model_id = "QEMU Virtual CPU version (cpu64-rhel6)",
4a2fec
+    },
4a2fec
+    {
4a2fec
         .name = "Conroe",
4a2fec
         .level = 10,
4a2fec
         .vendor = CPUID_VENDOR_INTEL,
4a2fec
@@ -1542,6 +1574,7 @@ static PropValue kvm_default_props[] = {
4a2fec
     { "acpi", "off" },
4a2fec
     { "monitor", "off" },
4a2fec
     { "svm", "off" },
4a2fec
+    { "kvm-pv-unhalt", "on" },
4a2fec
     { NULL, NULL },
4a2fec
 };
4a2fec
 
4a2fec
diff --git a/target/i386/machine.c b/target/i386/machine.c
4a2fec
index eab3372..6156626 100644
4a2fec
--- a/target/i386/machine.c
4a2fec
+++ b/target/i386/machine.c
4a2fec
@@ -818,6 +818,26 @@ static const VMStateDescription vmstate_mcg_ext_ctl = {
4a2fec
     }
4a2fec
 };
4a2fec
 
4a2fec
+static bool vmstate_xsave_needed(void *opaque)
4a2fec
+{
4a2fec
+    /* The xsave state is already on the main "cpu" section */
4a2fec
+    return false;
4a2fec
+}
4a2fec
+
4a2fec
+static const VMStateDescription vmstate_xsave ={
4a2fec
+    .name = "cpu/xsave",
4a2fec
+    .version_id = 1,
4a2fec
+    .minimum_version_id = 1,
4a2fec
+    .minimum_version_id_old = 1,
4a2fec
+    .needed = vmstate_xsave_needed,
4a2fec
+    .fields      = (VMStateField []) {
4a2fec
+    VMSTATE_UINT64_V(env.xcr0, X86CPU, 1),
4a2fec
+    VMSTATE_UINT64_V(env.xstate_bv, X86CPU, 1),
4a2fec
+    VMSTATE_YMMH_REGS_VARS(env.xmm_regs, X86CPU, CPU_NB_REGS, 1),
4a2fec
+    VMSTATE_END_OF_LIST()
4a2fec
+    }
4a2fec
+};
4a2fec
+
4a2fec
 VMStateDescription vmstate_x86_cpu = {
4a2fec
     .name = "cpu",
4a2fec
     .version_id = 12,
4a2fec
@@ -937,6 +957,7 @@ VMStateDescription vmstate_x86_cpu = {
4a2fec
         &vmstate_pkru,
4a2fec
 #endif
4a2fec
         &vmstate_mcg_ext_ctl,
4a2fec
+        &vmstate_xsave,
4a2fec
         NULL
4a2fec
     }
4a2fec
 };
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec