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

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