ae23c9
From 6f781f8512bbc6ae19184c8e26c96c48ffa31d93 Mon Sep 17 00:00:00 2001
ae23c9
From: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
Date: Sun, 14 Dec 2014 18:32:18 +0100
ae23c9
Subject: Add RHEL 7 machine types
ae23c9
ae23c9
This commit adds all changes related to machine types applied since
ae23c9
qemu-kvm-rhev-2.1.2-16.el7.
ae23c9
ae23c9
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
ae23c9
--
ae23c9
ae23c9
Rebase notes for RHEL-8 (2.12.0):
ae23c9
- replace has_dynamic_sysbus with list of dynamic devices (upstream)
ae23c9
- Changed force_rev1_fadt handling
ae23c9
- Added default nic to machine options for pc_piix and pc_q35
ae23c9
- Disabled m48t59-test for ppc64
ae23c9
- Disabled unsupported machine types in boot-serial-test
ae23c9
- Disabled pseries-rhel7.2.0 machine type for cpu-plug-test
ae23c9
ae23c9
Rebase notes for RHEL-8 (2.11.0):
ae23c9
- Removed references to rhel6 rom files (virtio.rom, pcnet, rtl3193,
ae23c9
                                         net2k_pci e1000)
ae23c9
- Removed CONFIG_RHV usage from hw/ppc/spapr.c
ae23c9
- Removed x-write-pointer-available property from compat.h
ae23c9
ae23c9
Rebase notes (2.11.0):
ae23c9
- Return type for VMStateDescription.pre_save changed (upstream)
ae23c9
- Use default_cpu_type instead of tcg_default_cpu for sPAPRMachineClass
ae23c9
- Use virt_get_default_cpu_node_id in arm rhel machine type
ae23c9
- Set default_cpu_type to cortex-a57
ae23c9
- Disable options for arm boards instead of object file remove
ae23c9
- Changed order with device disable commit - removed unnecessary changes
ae23c9
ae23c9
Rebase notes (2.10.0):
ae23c9
- Commented out new unused functions in hw/arm/virt.c
ae23c9
- savevm_skip_section_footers changed to COMPAT variable (upstream)
ae23c9
- global_state_set_optional changed to COMPAT variable (upstream)
ae23c9
- savevm_skip_configuration changed to COMPAT variable (upstream)
ae23c9
- move shadow_bios() to separate module with stub version available
ae23c9
- set possible_cpu_arch_ids and cpu_index_to_instance_props fields for arm machine type
ae23c9
- Re-enable older machine types for ppc64
ae23c9
- Commented 7.2 rebase error for compat qemu-extended-regs
ae23c9
ae23c9
Rebase notes (2.9.0):
ae23c9
- new header file for arm (upstream)
ae23c9
- query_hotpluggable_cpus renamed to has_hotpluggable_cpus (upstream)
ae23c9
- replace MAX_CPUMASK_BITS with max_cpus
ae23c9
- Adding rhel6-e1000.rom moved to Initial redhat commit
ae23c9
- Fixed conflict on cirrus_vga.c
ae23c9
ae23c9
Rebase notes (2.8.0):
ae23c9
- new "m->max_cpus = 288" in pc_q35_machine_options hw/i386/pc_q35.c
ae23c9
ae23c9
Rebase notes (2.7.0):
ae23c9
- Additional fsl-imx6.o sabrelito.o files in arm hw dir
ae23c9
ae23c9
Rebase notes (2.6.0):
ae23c9
- Changes in handling of some compat properties
ae23c9
- Fixes in x86_64 copmat models
ae23c9
- Added required devices for aarch64
ae23c9
- Fixes for ppc machine types
ae23c9
ae23c9
Rebase notes (2.5.0):
ae23c9
- changed cpu defaults structure
ae23c9
- chnaged cpu compat properties handling
ae23c9
- added fix for arm machine type
ae23c9
ae23c9
Rebase notes (2.4.0)
ae23c9
- Moved needed attribute (due to 5cd8cadae8db905afcbf877cae568c27d1d55a8a)
ae23c9
- Fixes to machine types changes
ae23c9
ae23c9
Merged patches (2.12.0):
ae23c9
- 402de2c redhat: Define the pseries-rhel7.5-sxxm machine type
ae23c9
- a232ba5 redhat: Define the pseries-rhel7.4-sxxm machine type
ae23c9
- 54f90c2 redhat: Define the pseries-rhel7.3-sxxm machine type
ae23c9
- 3fe3c44 Disable GeForce quirks in vfio-pci for RHEL machines
ae23c9
- 4780659 target-i386: cpu: add new CPU models for indirect branch predictor restrictions
ae23c9
- d486f00 hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation
ae23c9
- cc06449 spapr: Handle Decimal Floating Point (DFP) as an optional capability
ae23c9
- 64ef8ed spapr: Handle VMX/VSX presence as an spapr capability flag
ae23c9
- acad5a1 spapr: Treat Hardware Transactional Memory (HTM) as an optional capability
ae23c9
- b1163e4 serial: always transmit send/receive buffers on migration
ae23c9
ae23c9
Merged patches (2.11.0):
ae23c9
- 58702e8dbb redhat: fix HW_COMPAT_RHEL7_3
ae23c9
- ea157600da redhat: define HW_COMPAT_RHEL7_4
ae23c9
- 86ef5cd189 redhat: define pseries-rhel7.5.0 machine type
ae23c9
- d8bf28e9ec qemu-kvm-ma: define only pseries-rhel7.5.0 machine type for -ma
ae23c9
- 9b07271835 Create x86 7.5.0 machine types
ae23c9
- e63d707db9 acpi: Force rev1 FADT on old q35 machine types
ae23c9
- c091cd7a1b pc: make pc_rom RO only on new machine types
ae23c9
- 082bd3ba3d arm/virt: Add RHEL 7.5 machine typei
ae23c9
- 8663586f2b qemu-kvm-rhev: only allows pseries-rhel7.5.0 machine type with POWER9 guest
ae23c9
- 229441f111 machine compat: pci_bridge/shpc always enable
ae23c9
- 917c9e7df7 pcie_root_port: Fix x-migrate-msix compat
ae23c9
- b0c0614041 q35: Fix mismerge
ae23c9
- 888e98c6d6 hw/pci-host: Fix x86 Host Bridges 64bit PCI hole (partial)
ae23c9
- b2f9f4fcaa i386/cpu/hyperv: support over 64 vcpus for windows guests (partial)
ae23c9
- cc306393d7 migcompat/e1000e: Work around 7.3 msi/intr_state field
ae23c9
- c4753f76a3 migcompat/rtl8139: Work around version bump
ae23c9
ae23c9
Merged patches (2.10.0)
ae23c9
- 5090ba1 Fix qemu-kvm does not quit when booting guest w/ 241 vcpus and "-no-kvm"
ae23c9
- 3c52050 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 288
ae23c9
- 0ed92ca x86: Work around SMI breakages
ae23c9
- f7b5a7f spapr: update SPAPR_COMPAT_RHEL7_3
ae23c9
- 04faf4d migration: update HW_COMPAT_RHEL7_3
ae23c9
- 9982768 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 384
ae23c9
- f5095ba re-enable DMA for 7.3 machine type
ae23c9
- d6ec65d x86 machine compat: 2.9 stragglers
ae23c9
- eda659a disable linuxboot_dma.bin option rom for 7.3 machine types
ae23c9
- 8c122a5 Revert "hw/pci: disable pci-bridge's shpc by default" (partial)
ae23c9
- 627adfa virtio_net: Bypass backends for MTU feature negotiation (partial)
ae23c9
- b430787 pc: Use "min[x]level" on compat_props on RHEL machine-types
ae23c9
- 8c3f45a AArch64: remove mach-virt-7.3 machine type
ae23c9
- d5df1ef Downstream: Update pseries machine types for RHEL-ALT-7.4
ae23c9
ae23c9
Merged patches (2.9.0)
ae23c9
- 8475d69 hw/arm/virt: Disable virtio-net-pci option ROM file loading
ae23c9
- 73fe1f6 Workaround rhel6 ctrl_guest_offloads machine type mismatch
ae23c9
- 21d32ca pc_piix: fix compat props typo for RHEL6 machine types
ae23c9
- 55a5002 compat: define HW_COMPAT_RHEL7_3
ae23c9
- 1b8e927 spapr: define pseries-rhel7.4.0 machine type
ae23c9
- cdb76ec hw/arm/virt: remove aarch64 rhel machine type
ae23c9
- 7dfa88b hw/arm/virt: create virt-rhel7.3.0 machine type
ae23c9
- 6894f91 hw/arm/virt: create virt-rhel7.4.0 machine type
ae23c9
- a9d2d39 x86: Split out options for the head rhel7 machine types
ae23c9
- fdafbdc x86: Create PC_RHEL7_3_COMPAT definition
ae23c9
- 3427c72 x86: Define pc-i440fx-rhel7.4.0
ae23c9
- aea20ab x86: Define pc-q35-rhel7.4.0
ae23c9
- 0185c0f x86: Remove downstream opteron rdtscp override
ae23c9
- 6b51073 fix abort in acpi_setup() since 2.8 with rhel6 machine types
ae23c9
- 954fc0d intel-hda: fix rhel6 compat property
ae23c9
- 1b57274 kvmclock: reduce kvmclock difference on migration (rhel only part)
ae23c9
ae23c9
Merged patches (2.8.0)
ae23c9
- a1da2f0 virtio-pci: reduce modern_mem_bar size (rhel only part)
ae23c9
ae23c9
Merged patches (2.7.0):
ae23c9
- fe9d1cf pc: Use right HW_COMPAT_* macros at PC_RHEL7* compat macros
ae23c9
- 3938189 compat: Add missing "any_layout" in HW_COMPAT_RHEL7_1
ae23c9
- 6dffc9d spapr: update RHEL-7.2 machine type
ae23c9
- c5d5910 migration: fix HW_COMPAT_RHEL7_2
ae23c9
- 2da9bb8 pc: New (default) pc-i440fx-rhel7.3.0 machine-type
ae23c9
- 0520d7e 7.3 mismerge fix: Fix ich9-intel-hda compatibility
ae23c9
- 89528b3 PC migration compat: Section footers/global state
ae23c9
- 2231e35 fw_cfg for 7.2 compatibility
ae23c9
- b8a3ade pc: Create new pc-q35-rhel7.3.0 machine-type
ae23c9
- 340929b q35: Remove 7.0, 7.1, 7.2 machine types
ae23c9
- bb7fc95 machine types: fix pc_machine_*_options chain
ae23c9
- d9fa9aa Fix rhel6 rom file
ae23c9
- dc39363 fix vga type for older machines
ae23c9
- 255a2d1 7.2 machine type compatibility
ae23c9
- 16c3d25 target-i386: Remove SSE4a from qemu64 CPU model (rhel only part)
ae23c9
- 76a1796 target-i386: Remove ABM from qemu64 CPU model (rhel only part)
ae23c9
- a9f8773 pc: Recover PC_RHEL7_1_COMPAT from RHEL-7.2 code
ae23c9
- 7a6ed67 pc: Include missing PC_COMPAT_2_3 entries in PC_RHEL7_2_COMPAT
ae23c9
- 07428f6 Revert "static checker: e1000-82540em got aliased to e1000"
ae23c9
- 446cf1f Revert "e1000: use alias for default model"
ae23c9
- 615096e 7.x compat: e1000-82540em
ae23c9
- 0855905 hw/arm/virt: kill 7.2 machine type
ae23c9
- 18bbea2 usbredir: turn off streams for rhel7.2 & older
ae23c9
- 910cf4a target-i386: Fill high bits of mtrr mask (rhel only part)
ae23c9
- 0e8ab1b target-i386: Enable host-phys-bits on RHEL
ae23c9
- 8c5f8a5 pc: Fix rhel6.3.0 compat_props setting
ae23c9
- 8f869f1 pc: use new CPU hotplug interface since 2.7 machine type (rhel only part)
ae23c9
- d9d646f machine: add properties to compat_props incrementaly (rhel only part)
ae23c9
- acb18fd apic: Use apic_id as apic's migration instance_id (rhel only part)
ae23c9
- c7e37d4 apic: fix broken migration for kvm-apic (rhel only part)
ae23c9
- eca64aee hw/virtio-pci: fix virtio behaviour
ae23c9
- c56b8F6e pc-rhel-7.2: pcie: fix link active status bit migration
ae23c9
- 5522aa3 q35-rhel: allow dynamic sysbus
ae23c9
ae23c9
Merged patches (2.6.0):
ae23c9
- f915d7f arm: virt: Add an abstract RHEL ARM virt machine type
ae23c9
- deffcc0 arm: virt: Add RHEL 7.3.0 virt machine type
ae23c9
- 04ca07d arm: virt: Consolidate the naming of RHEL virt machine types
ae23c9
- 2856ce2 Define HW_COMPAT_RHEL7_2
ae23c9
- 1869242 spapr: move pseries-2.5 machine to RHEL disabled machine zone
ae23c9
- cc59ce7 spapr: add RHEL-7.3 machine type
ae23c9
- 98549c5 pc: Fix property names on CPU compat code
ae23c9
- caa47bb Fix ich9-intel-hda compatibility
ae23c9
ae23c9
Merged patches (2.3.0):
ae23c9
- bb4e53c2 pc: add rhel6.6.0 machine type
ae23c9
- 129a2b3 Downstream-only: Restore "pseries" machine alias
ae23c9
ae23c9
Merged patches (2.4.0):
ae23c9
- 8e8107c numa: Don't allow memdev= on RHEL-6 machine-types
ae23c9
- 8b220c0 pc_sysfw: prevent pflash and/or mis-sized firmware for rhel6.x.0 machtypes
ae23c9
- 9dba3a5 Add pc-i440fx-rhel7.2.0 machine type
ae23c9
- 1c88ffa Add pc-q35-rhel7.2.0 machine type
ae23c9
- 6f74d0c Downstream-only: Add rhel7.2.0 machine type
ae23c9
- a7d6105 Add flag for pre-2.2 migration compatibility
ae23c9
- 17f9a18 Serial: Migration compatibility pre 2.2/7.2
ae23c9
- 3799a57 Migration compat for mc146818rtc/irq_reinject_on_ack_count subsection
ae23c9
- 5668cc1 Fix reported machine type
ae23c9
- 2417534 386: drop FDC in pc-q35-rhel7.2.0 if neither it nor fl. drives are anted
ae23c9
- f42eee5 global_state: Make section optional
ae23c9
- 8640f84 migration: Add configuration section
ae23c9
- 48c857b pc: memhotplug: fix incorrectly set reserved-memory-end
ae23c9
- f33f0b6 pc: memhotplug: keep reserved-memory-end broken on rhel71 and earlier machines
ae23c9
ae23c9
(cherry picked from commit 44f7e7595c416686a00015e317e74183037a8136)
ae23c9
ae23c9
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
ae23c9
Message-id: <20180111135644.16253-1-pbonzini@redhat.com>
ae23c9
Patchwork-id: 78551
ae23c9
O-Subject: [RHEL7.5 qemu-kvm-rhev PATCH v2] serial: always transmit send/receive buffers on migration
ae23c9
Bugzilla: 1459945
ae23c9
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
ae23c9
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
ae23c9
When subsections were added in qemu 2.3, they were all disabled
ae23c9
for machine types that require pre-2.3 compatibility.  The commit
ae23c9
message says "disabling these subsections on older machine types should
ae23c9
leave it no worse than existing qemu", but actually migrating from
ae23c9
new QEMU to new QEMU (but with old machine type) will detect an
ae23c9
inconsistent migration state and fail the migration:
ae23c9
ae23c9
   qemu-system-x86_64: inconsistent state in serial device (tsr not empty, tsr_retry=0
ae23c9
   qemu-system-x86_64: Failed to load serial:state
ae23c9
   qemu-system-x86_64: error while loading state for instance 0x0 of device 'serial'
ae23c9
ae23c9
In fact, this shows that migration from new source to old destination
ae23c9
might have also eaten the data in the FIFO or transmit/receive buffers.
ae23c9
ae23c9
It's actually pretty easy to trigger the failure by connecting a console
ae23c9
to a hung-up reader (not a *disconnected* reader!).  The fix is to
ae23c9
handle the subsections the same as we did in the qemu-kvm BZ1452067.
ae23c9
The data registers are migrated, which may indeed cause some more migrations
ae23c9
to fail to old qemu-kvm-rhev, but it will fix migration to new qemu-kvm-rhev.
ae23c9
Some subsections are still keyed on migrate_pre_2_2; from the commit message
ae23c9
of downstream commit 7d2e8f9662feb64c0b15b6fd53e06e3c56921f27:
ae23c9
ae23c9
    thr_ipending can be reconstructed fairly
ae23c9
    reliably by serial_post_load.  The others are features that are
ae23c9
    unlikely to be used in RHEL, respectively receive timeout (Linux
ae23c9
    does not even have the UART_IIR_CTI symbol in the driver) and
ae23c9
    physical serial ports connected to a modem
ae23c9
ae23c9
I consider this okay because nobody has yet complained about it for
ae23c9
qemu-kvm.  It's also safer because the failure avoids serial data loss
ae23c9
on migration.  This is consistent with the intended use of subsections.
ae23c9
ae23c9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ae23c9
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
(cherry picked from commit 10564d0bb819113f925e32b989b24fb26dca45ef)
ae23c9
(cherry picked from commit 9e1104c955c05c7b850cda3a02f69bf3e931c765)
ae23c9
---
ae23c9
 hw/acpi/ich9.c                    |  16 +
ae23c9
 hw/acpi/piix4.c                   |   6 +-
ae23c9
 hw/arm/virt.c                     | 121 +++++-
ae23c9
 hw/char/serial.c                  |  16 +
ae23c9
 hw/display/cirrus_vga.c           |   4 +-
ae23c9
 hw/display/vga-isa.c              |   2 +-
ae23c9
 hw/i386/Makefile.objs             |   1 +
ae23c9
 hw/i386/acpi-build.c              |   3 +
ae23c9
 hw/i386/pc.c                      |   7 +-
ae23c9
 hw/i386/pc_piix.c                 | 872 +++++++++++++++++++++++++++++++++++++-
ae23c9
 hw/i386/pc_q35.c                  |  74 +++-
ae23c9
 hw/i386/pc_sysfw.c                |  16 +
ae23c9
 hw/i386/shadow-bios.c             |  64 +++
ae23c9
 hw/net/e1000.c                    |  18 +-
ae23c9
 hw/net/e1000e.c                   |  21 +
ae23c9
 hw/net/rtl8139.c                  |   4 +-
ae23c9
 hw/ppc/spapr.c                    | 208 +++++++++
ae23c9
 hw/ppc/spapr_cpu_core.c           |  13 +
ae23c9
 hw/s390x/s390-virtio-ccw.c        |  17 +-
ae23c9
 hw/smbios/smbios.c                |   1 +
ae23c9
 hw/timer/i8254_common.c           |   2 +-
ae23c9
 hw/timer/mc146818rtc.c            |   6 +
ae23c9
 hw/usb/hcd-uhci.c                 |  15 +-
ae23c9
 hw/usb/hcd-xhci.c                 |  20 +
ae23c9
 hw/usb/hcd-xhci.h                 |   2 +
ae23c9
 hw/virtio/virtio.c                |  22 +-
ae23c9
 include/hw/acpi/ich9.h            |   3 +
ae23c9
 include/hw/arm/virt.h             |  22 +
ae23c9
 include/hw/compat.h               | 191 +++++++++
ae23c9
 include/hw/i386/pc.h              | 554 ++++++++++++++++++++++++
ae23c9
 include/hw/ppc/spapr.h            |   1 +
ae23c9
 include/hw/usb.h                  |   7 +
ae23c9
 include/hw/virtio/virtio.h        |   1 +
ae23c9
 include/sysemu/sysemu.h           |   2 +
ae23c9
 migration/migration.c             |   2 +
ae23c9
 migration/migration.h             |   5 +
ae23c9
 migration/savevm.c                |   9 +
ae23c9
 numa.c                            |  13 +
ae23c9
 qdev-monitor.c                    |   1 -
ae23c9
 scripts/vmstate-static-checker.py |   1 -
ae23c9
 stubs/Makefile.objs               |   1 +
ae23c9
 stubs/shadow-bios.c               |   7 +
ae23c9
 target/i386/cpu.c                 |   9 +-
ae23c9
 target/i386/machine.c             |  21 +
ae23c9
 target/ppc/compat.c               |  11 +
ae23c9
 target/ppc/cpu.h                  |   1 +
ae23c9
 tests/Makefile.include            |   8 +-
ae23c9
 tests/cpu-plug-test.c             |   3 +-
ae23c9
 48 files changed, 2397 insertions(+), 27 deletions(-)
ae23c9
 create mode 100644 hw/i386/shadow-bios.c
ae23c9
 create mode 100644 stubs/shadow-bios.c
ae23c9
ae23c9
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
ae23c9
index a4e87b8..23a7baa 100644
ae23c9
--- a/hw/acpi/ich9.c
ae23c9
+++ b/hw/acpi/ich9.c
ae23c9
@@ -441,6 +441,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
ae23c9
     s->pm.enable_tco = value;
ae23c9
 }
ae23c9
 
ae23c9
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
ae23c9
+{
ae23c9
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
ae23c9
+    return s->pm.force_rev1_fadt;
ae23c9
+}
ae23c9
+
ae23c9
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
ae23c9
+{
ae23c9
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
ae23c9
+    s->pm.force_rev1_fadt = value;
ae23c9
+}
ae23c9
+
ae23c9
 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
ae23c9
 {
ae23c9
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
ae23c9
@@ -465,6 +477,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
ae23c9
                              ich9_pm_get_cpu_hotplug_legacy,
ae23c9
                              ich9_pm_set_cpu_hotplug_legacy,
ae23c9
                              NULL);
ae23c9
+    object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
ae23c9
+                             ich9_pm_get_force_rev1_fadt,
ae23c9
+                             ich9_pm_set_force_rev1_fadt,
ae23c9
+                             NULL);
ae23c9
     object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
ae23c9
                         ich9_pm_get_disable_s3,
ae23c9
                         ich9_pm_set_disable_s3,
ae23c9
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
ae23c9
index 8b70345..d706360 100644
ae23c9
--- a/hw/acpi/piix4.c
ae23c9
+++ b/hw/acpi/piix4.c
ae23c9
@@ -311,7 +311,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
ae23c9
 static const VMStateDescription vmstate_acpi = {
ae23c9
     .name = "piix4_pm",
ae23c9
     .version_id = 3,
ae23c9
-    .minimum_version_id = 3,
ae23c9
+    .minimum_version_id = 2,
ae23c9
     .minimum_version_id_old = 1,
ae23c9
     .load_state_old = acpi_load_old,
ae23c9
     .post_load = vmstate_acpi_post_load,
ae23c9
@@ -671,8 +671,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
ae23c9
 
ae23c9
 static Property piix4_pm_properties[] = {
ae23c9
     DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
ae23c9
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
ae23c9
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
ae23c9
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
ae23c9
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
ae23c9
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
ae23c9
     DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
ae23c9
                      use_acpi_pci_hotplug, true),
ae23c9
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
ae23c9
index 94dcb12..806eb1e 100644
ae23c9
--- a/hw/arm/virt.c
ae23c9
+++ b/hw/arm/virt.c
ae23c9
@@ -59,6 +59,7 @@
ae23c9
 #include "qapi/visitor.h"
ae23c9
 #include "standard-headers/linux/input.h"
ae23c9
 
ae23c9
+#if 0 /* disabled Red Hat Enterprise Linux */
ae23c9
 #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \
ae23c9
     static void virt_##major##_##minor##_class_init(ObjectClass *oc, \
ae23c9
                                                     void *data) \
ae23c9
@@ -86,7 +87,36 @@
ae23c9
     DEFINE_VIRT_MACHINE_LATEST(major, minor, true)
ae23c9
 #define DEFINE_VIRT_MACHINE(major, minor) \
ae23c9
     DEFINE_VIRT_MACHINE_LATEST(major, minor, false)
ae23c9
-
ae23c9
+#endif /* disabled for RHEL */
ae23c9
+
ae23c9
+#define DEFINE_RHEL_MACHINE_LATEST(m, n, s, latest)                     \
ae23c9
+    static void rhel##m##n##s##_virt_class_init(ObjectClass *oc,        \
ae23c9
+                                                void *data)             \
ae23c9
+    {                                                                   \
ae23c9
+        MachineClass *mc = MACHINE_CLASS(oc);                           \
ae23c9
+        rhel##m##n##s##_virt_options(mc);                               \
ae23c9
+        mc->desc = "RHEL " # m "." # n "." # s " ARM Virtual Machine";  \
ae23c9
+        if (latest) {                                                   \
ae23c9
+            mc->alias = "virt";                                         \
ae23c9
+            mc->is_default = 1;                                         \
ae23c9
+        }                                                               \
ae23c9
+    }                                                                   \
ae23c9
+    static const TypeInfo rhel##m##n##s##_machvirt_info = {             \
ae23c9
+        .name = MACHINE_TYPE_NAME("virt-rhel" # m "." # n "." # s),     \
ae23c9
+        .parent = TYPE_RHEL_MACHINE,                                    \
ae23c9
+        .instance_init = rhel##m##n##s##_virt_instance_init,            \
ae23c9
+        .class_init = rhel##m##n##s##_virt_class_init,                  \
ae23c9
+    };                                                                  \
ae23c9
+    static void rhel##m##n##s##_machvirt_init(void)                     \
ae23c9
+    {                                                                   \
ae23c9
+        type_register_static(&rhel##m##n##s##_machvirt_info);           \
ae23c9
+    }                                                                   \
ae23c9
+    type_init(rhel##m##n##s##_machvirt_init);
ae23c9
+
ae23c9
+#define DEFINE_RHEL_MACHINE_AS_LATEST(major, minor, subminor)   \
ae23c9
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true)
ae23c9
+#define DEFINE_RHEL_MACHINE(major, minor, subminor)             \
ae23c9
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false)
ae23c9
 
ae23c9
 /* Number of external interrupt lines to configure the GIC with */
ae23c9
 #define NUM_IRQS 256
ae23c9
@@ -1416,6 +1446,7 @@ static void machvirt_init(MachineState *machine)
ae23c9
     create_platform_bus(vms, pic);
ae23c9
 }
ae23c9
 
ae23c9
+#if 0 /* disabled for RHEL */
ae23c9
 static bool virt_get_secure(Object *obj, Error **errp)
ae23c9
 {
ae23c9
     VirtMachineState *vms = VIRT_MACHINE(obj);
ae23c9
@@ -1444,6 +1475,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
ae23c9
     vms->virt = value;
ae23c9
 }
ae23c9
 
ae23c9
+#endif /* disabled for RHEL */
ae23c9
 static bool virt_get_highmem(Object *obj, Error **errp)
ae23c9
 {
ae23c9
     VirtMachineState *vms = VIRT_MACHINE(obj);
ae23c9
@@ -1536,6 +1568,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
ae23c9
     return ms->possible_cpus;
ae23c9
 }
ae23c9
 
ae23c9
+#if 0 /* disabled for RHEL */
ae23c9
 static void virt_machine_class_init(ObjectClass *oc, void *data)
ae23c9
 {
ae23c9
     MachineClass *mc = MACHINE_CLASS(oc);
ae23c9
@@ -1748,3 +1781,89 @@ static void virt_machine_2_6_options(MachineClass *mc)
ae23c9
     vmc->no_pmu = true;
ae23c9
 }
ae23c9
 DEFINE_VIRT_MACHINE(2, 6)
ae23c9
+#endif /* disabled for RHEL */
ae23c9
+
ae23c9
+static void rhel_machine_class_init(ObjectClass *oc, void *data)
ae23c9
+{
ae23c9
+    MachineClass *mc = MACHINE_CLASS(oc);
ae23c9
+
ae23c9
+    mc->family = "virt-rhel-Z";
ae23c9
+    mc->init = machvirt_init;
ae23c9
+    /* Start max_cpus at the maximum QEMU supports. We'll further restrict
ae23c9
+     * it later in machvirt_init, where we have more information about the
ae23c9
+     * configuration of the particular instance.
ae23c9
+     */
ae23c9
+    mc->max_cpus = 255;
ae23c9
+    mc->block_default_type = IF_VIRTIO;
ae23c9
+    mc->no_cdrom = 1;
ae23c9
+    mc->pci_allow_0_address = true;
ae23c9
+    /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */
ae23c9
+    mc->minimum_page_bits = 12;
ae23c9
+    mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids;
ae23c9
+    mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
ae23c9
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57");
ae23c9
+    mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
ae23c9
+}
ae23c9
+
ae23c9
+static const TypeInfo rhel_machine_info = {
ae23c9
+    .name          = TYPE_RHEL_MACHINE,
ae23c9
+    .parent        = TYPE_MACHINE,
ae23c9
+    .abstract      = true,
ae23c9
+    .instance_size = sizeof(VirtMachineState),
ae23c9
+    .class_size    = sizeof(VirtMachineClass),
ae23c9
+    .class_init    = rhel_machine_class_init,
ae23c9
+};
ae23c9
+
ae23c9
+static void rhel_machine_init(void)
ae23c9
+{
ae23c9
+    type_register_static(&rhel_machine_info);
ae23c9
+}
ae23c9
+type_init(rhel_machine_init);
ae23c9
+
ae23c9
+static void rhel750_virt_instance_init(Object *obj)
ae23c9
+{
ae23c9
+    VirtMachineState *vms = VIRT_MACHINE(obj);
ae23c9
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
ae23c9
+
ae23c9
+    /* EL3 is disabled by default and non-configurable for RHEL */
ae23c9
+    vms->secure = false;
ae23c9
+    /* EL2 is disabled by default and non-configurable for RHEL */
ae23c9
+    vms->virt = false;
ae23c9
+    /* High memory is enabled by default for RHEL */
ae23c9
+    vms->highmem = true;
ae23c9
+    object_property_add_bool(obj, "highmem", virt_get_highmem,
ae23c9
+                             virt_set_highmem, NULL);
ae23c9
+    object_property_set_description(obj, "highmem",
ae23c9
+                                    "Set on/off to enable/disable using "
ae23c9
+                                    "physical address space above 32 bits",
ae23c9
+                                    NULL);
ae23c9
+    /* Default GIC type is still v2, but became configurable for RHEL */
ae23c9
+    vms->gic_version = 2;
ae23c9
+    object_property_add_str(obj, "gic-version", virt_get_gic_version,
ae23c9
+                        virt_set_gic_version, NULL);
ae23c9
+    object_property_set_description(obj, "gic-version",
ae23c9
+                                    "Set GIC version. "
ae23c9
+                                    "Valid values are 2, 3 and host", NULL);
ae23c9
+
ae23c9
+    if (vmc->no_its) {
ae23c9
+        vms->its = false;
ae23c9
+    } else {
ae23c9
+        /* Default allows ITS instantiation */
ae23c9
+        vms->its = true;
ae23c9
+        object_property_add_bool(obj, "its", virt_get_its,
ae23c9
+                                 virt_set_its, NULL);
ae23c9
+        object_property_set_description(obj, "its",
ae23c9
+                                        "Set on/off to enable/disable "
ae23c9
+                                        "ITS instantiation",
ae23c9
+                                        NULL);
ae23c9
+    }
ae23c9
+
ae23c9
+    vms->memmap=a15memmap;
ae23c9
+    vms->irqmap=a15irqmap;
ae23c9
+}
ae23c9
+
ae23c9
+static void rhel750_virt_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
ae23c9
+}
ae23c9
+DEFINE_RHEL_MACHINE_AS_LATEST(7, 5, 0)
ae23c9
diff --git a/hw/char/serial.c b/hw/char/serial.c
ae23c9
index eb72191..d6d9b18 100644
ae23c9
--- a/hw/char/serial.c
ae23c9
+++ b/hw/char/serial.c
ae23c9
@@ -30,6 +30,7 @@
ae23c9
 #include "qemu/timer.h"
ae23c9
 #include "exec/address-spaces.h"
ae23c9
 #include "qemu/error-report.h"
ae23c9
+#include "migration/migration.h"
ae23c9
 
ae23c9
 //#define DEBUG_SERIAL
ae23c9
 
ae23c9
@@ -691,6 +692,9 @@ static int serial_post_load(void *opaque, int version_id)
ae23c9
 static bool serial_thr_ipending_needed(void *opaque)
ae23c9
 {
ae23c9
     SerialState *s = opaque;
ae23c9
+    if (migrate_pre_2_2) {
ae23c9
+        return false;
ae23c9
+    }
ae23c9
 
ae23c9
     if (s->ier & UART_IER_THRI) {
ae23c9
         bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
ae23c9
@@ -772,6 +776,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
ae23c9
 static bool serial_fifo_timeout_timer_needed(void *opaque)
ae23c9
 {
ae23c9
     SerialState *s = (SerialState *)opaque;
ae23c9
+    if (migrate_pre_2_2) {
ae23c9
+        return false;
ae23c9
+    }
ae23c9
+
ae23c9
     return timer_pending(s->fifo_timeout_timer);
ae23c9
 }
ae23c9
 
ae23c9
@@ -789,6 +797,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
ae23c9
 static bool serial_timeout_ipending_needed(void *opaque)
ae23c9
 {
ae23c9
     SerialState *s = (SerialState *)opaque;
ae23c9
+    if (migrate_pre_2_2) {
ae23c9
+        return false;
ae23c9
+    }
ae23c9
+
ae23c9
     return s->timeout_ipending != 0;
ae23c9
 }
ae23c9
 
ae23c9
@@ -806,6 +818,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
ae23c9
 static bool serial_poll_needed(void *opaque)
ae23c9
 {
ae23c9
     SerialState *s = (SerialState *)opaque;
ae23c9
+    if (migrate_pre_2_2) {
ae23c9
+        return false;
ae23c9
+    }
ae23c9
+
ae23c9
     return s->poll_msl >= 0;
ae23c9
 }
ae23c9
 
ae23c9
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
ae23c9
index d116651..feacb45 100644
ae23c9
--- a/hw/display/cirrus_vga.c
ae23c9
+++ b/hw/display/cirrus_vga.c
ae23c9
@@ -3060,7 +3060,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
ae23c9
 
ae23c9
 static Property isa_cirrus_vga_properties[] = {
ae23c9
     DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState,
ae23c9
-                       cirrus_vga.vga.vram_size_mb, 4),
ae23c9
+                       cirrus_vga.vga.vram_size_mb, 16),
ae23c9
     DEFINE_PROP_BOOL("blitter", struct ISACirrusVGAState,
ae23c9
                        cirrus_vga.enable_blitter, true),
ae23c9
     DEFINE_PROP_END_OF_LIST(),
ae23c9
@@ -3133,7 +3133,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
ae23c9
 
ae23c9
 static Property pci_vga_cirrus_properties[] = {
ae23c9
     DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState,
ae23c9
-                       cirrus_vga.vga.vram_size_mb, 4),
ae23c9
+                       cirrus_vga.vga.vram_size_mb, 16),
ae23c9
     DEFINE_PROP_BOOL("blitter", struct PCICirrusVGAState,
ae23c9
                      cirrus_vga.enable_blitter, true),
ae23c9
     DEFINE_PROP_END_OF_LIST(),
ae23c9
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
ae23c9
index 469834a..eb44d21 100644
ae23c9
--- a/hw/display/vga-isa.c
ae23c9
+++ b/hw/display/vga-isa.c
ae23c9
@@ -79,7 +79,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
ae23c9
 }
ae23c9
 
ae23c9
 static Property vga_isa_properties[] = {
ae23c9
-    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
ae23c9
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
ae23c9
     DEFINE_PROP_END_OF_LIST(),
ae23c9
 };
ae23c9
 
ae23c9
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
ae23c9
index fa87a14..8c25538 100644
ae23c9
--- a/hw/i386/Makefile.objs
ae23c9
+++ b/hw/i386/Makefile.objs
ae23c9
@@ -10,3 +10,4 @@ obj-$(CONFIG_VMMOUSE) += vmmouse.o
ae23c9
 
ae23c9
 obj-y += kvmvapic.o
ae23c9
 obj-y += acpi-build.o
ae23c9
+obj-y += shadow-bios.o
ae23c9
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
ae23c9
index 3cf2a16..976d151 100644
ae23c9
--- a/hw/i386/acpi-build.c
ae23c9
+++ b/hw/i386/acpi-build.c
ae23c9
@@ -183,6 +183,9 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
ae23c9
         pm->fadt.reset_reg = r;
ae23c9
         pm->fadt.reset_val = 0xf;
ae23c9
         pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
ae23c9
+        if (object_property_get_bool(lpc,
ae23c9
+                                     "__com.redhat_force-rev1-fadt", NULL))
ae23c9
+            pm->fadt.rev = 1;
ae23c9
         pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
ae23c9
     }
ae23c9
     assert(obj);
ae23c9
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
ae23c9
index fdad4bb..6f686c7 100644
ae23c9
--- a/hw/i386/pc.c
ae23c9
+++ b/hw/i386/pc.c
ae23c9
@@ -1417,7 +1417,8 @@ void pc_memory_init(PCMachineState *pcms,
ae23c9
     option_rom_mr = g_malloc(sizeof(*option_rom_mr));
ae23c9
     memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
ae23c9
                            &error_fatal);
ae23c9
-    if (pcmc->pci_enabled) {
ae23c9
+    /* RH difference: See bz 1489800, explicitly make ROM ro */
ae23c9
+    if (pcmc->pc_rom_ro) {
ae23c9
         memory_region_set_readonly(option_rom_mr, true);
ae23c9
     }
ae23c9
     memory_region_add_subregion_overlap(rom_memory,
ae23c9
@@ -2361,6 +2362,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
ae23c9
     pcmc->acpi_data_size = 0x20000 + 0x8000;
ae23c9
     pcmc->save_tsc_khz = true;
ae23c9
     pcmc->linuxboot_dma_enabled = true;
ae23c9
+    pcmc->pc_rom_ro = true;
ae23c9
     mc->get_hotplug_handler = pc_get_hotpug_handler;
ae23c9
     mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
ae23c9
     mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
ae23c9
@@ -2370,7 +2372,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
ae23c9
     mc->default_boot_order = "cad";
ae23c9
     mc->hot_add_cpu = pc_hot_add_cpu;
ae23c9
     mc->block_default_type = IF_IDE;
ae23c9
-    mc->max_cpus = 255;
ae23c9
+    /* 240: max CPU count for RHEL */
ae23c9
+    mc->max_cpus = 240;
ae23c9
     mc->reset = pc_machine_reset;
ae23c9
     hc->pre_plug = pc_machine_device_pre_plug_cb;
ae23c9
     hc->plug = pc_machine_device_plug_cb;
ae23c9
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
ae23c9
index 729a050..cc72512 100644
ae23c9
--- a/hw/i386/pc_piix.c
ae23c9
+++ b/hw/i386/pc_piix.c
ae23c9
@@ -48,6 +48,7 @@
ae23c9
 #include "cpu.h"
ae23c9
 #include "qapi/error.h"
ae23c9
 #include "qemu/error-report.h"
ae23c9
+#include "migration/migration.h"
ae23c9
 #ifdef CONFIG_XEN
ae23c9
 #include <xen/hvm/hvm_info_table.h>
ae23c9
 #include "hw/xen/xen_pt.h"
ae23c9
@@ -168,8 +169,8 @@ static void pc_init1(MachineState *machine,
ae23c9
     if (pcmc->smbios_defaults) {
ae23c9
         MachineClass *mc = MACHINE_GET_CLASS(machine);
ae23c9
         /* These values are guest ABI, do not change */
ae23c9
-        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
ae23c9
-                            mc->name, pcmc->smbios_legacy_mode,
ae23c9
+        smbios_set_defaults("Red Hat", "KVM",
ae23c9
+                            mc->desc, pcmc->smbios_legacy_mode,
ae23c9
                             pcmc->smbios_uuid_encoded,
ae23c9
                             SMBIOS_ENTRY_POINT_21);
ae23c9
     }
ae23c9
@@ -307,6 +308,7 @@ static void pc_init1(MachineState *machine,
ae23c9
  * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options().
ae23c9
  */
ae23c9
 
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ae23c9
 static void pc_compat_2_3(MachineState *machine)
ae23c9
 {
ae23c9
     PCMachineState *pcms = PC_MACHINE(machine);
ae23c9
@@ -1135,3 +1137,869 @@ static void xenfv_machine_options(MachineClass *m)
ae23c9
 DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
ae23c9
                   xenfv_machine_options);
ae23c9
 #endif
ae23c9
+machine_init(pc_machine_init);
ae23c9
+
ae23c9
+#endif  /* Disabled for Red Hat Enterprise Linux */
ae23c9
+
ae23c9
+/* Red Hat Enterprise Linux machine types */
ae23c9
+
ae23c9
+/* Options for the latest rhel7 machine type */
ae23c9
+static void pc_machine_rhel7_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    m->family = "pc_piix_Y";
ae23c9
+    m->default_machine_opts = "firmware=bios-256k.bin";
ae23c9
+    pcmc->default_nic_model = "e1000";
ae23c9
+    m->default_display = "std";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
ae23c9
+    m->alias = "pc";
ae23c9
+    m->is_default = 1;
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel750(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel750_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel7_options(m);
ae23c9
+    m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)";
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
ae23c9
+                  pc_machine_rhel750_options);
ae23c9
+
ae23c9
+static void pc_init_rhel740(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel740_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_machine_rhel750_options(m);
ae23c9
+    m->alias = NULL;
ae23c9
+    m->is_default = 0;
ae23c9
+    m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
ae23c9
+    pcmc->pc_rom_ro = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
ae23c9
+                  pc_machine_rhel740_options);
ae23c9
+
ae23c9
+static void pc_init_rhel730(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel730_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_machine_rhel740_options(m);
ae23c9
+    m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    pcmc->linuxboot_dma_enabled = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730,
ae23c9
+                  pc_machine_rhel730_options);
ae23c9
+
ae23c9
+
ae23c9
+static void pc_init_rhel720(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel720_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_machine_rhel730_options(m);
ae23c9
+    m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    /* From pc_i440fx_2_5_machine_options */
ae23c9
+    pcmc->save_tsc_khz = false;
ae23c9
+    m->legacy_fw_cfg_order = 1;
ae23c9
+    /* Note: broken_reserved_end was already in 7.2 */
ae23c9
+    /* From pc_i440fx_2_6_machine_options */
ae23c9
+    pcmc->legacy_cpu_hotplug = true;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_2_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720,
ae23c9
+                  pc_machine_rhel720_options);
ae23c9
+
ae23c9
+static void pc_compat_rhel710(MachineState *machine)
ae23c9
+{
ae23c9
+    PCMachineState *pcms = PC_MACHINE(machine);
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
ae23c9
+
ae23c9
+    /* From pc_compat_2_2 */
ae23c9
+    pcmc->rsdp_in_ram = false;
ae23c9
+    machine->suppress_vmdesc = true;
ae23c9
+
ae23c9
+    /* From pc_compat_2_1 */
ae23c9
+    pcmc->smbios_uuid_encoded = false;
ae23c9
+    x86_cpu_change_kvm_default("svm", NULL);
ae23c9
+    pcmc->enforce_aligned_dimm = false;
ae23c9
+
ae23c9
+    /* Disable all the extra subsections that were added in 2.2 */
ae23c9
+    migrate_pre_2_2 = true;
ae23c9
+
ae23c9
+    /* From pc_i440fx_2_4_machine_options */
ae23c9
+    pcmc->broken_reserved_end = true;
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel710(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel710(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel710_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel720_options(m);
ae23c9
+    m->family = "pc_piix_Y";
ae23c9
+    m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    m->default_display = "cirrus";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_1_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
ae23c9
+                  pc_machine_rhel710_options);
ae23c9
+
ae23c9
+static void pc_compat_rhel700(MachineState *machine)
ae23c9
+{
ae23c9
+    PCMachineState *pcms = PC_MACHINE(machine);
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
ae23c9
+
ae23c9
+    pc_compat_rhel710(machine);
ae23c9
+
ae23c9
+    /* Upstream enables it for everyone, we're a little more selective */
ae23c9
+    x86_cpu_change_kvm_default("x2apic", NULL);
ae23c9
+    x86_cpu_change_kvm_default("svm", NULL);
ae23c9
+    pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
ae23c9
+    pcmc->smbios_legacy_mode = true;
ae23c9
+    pcmc->has_reserved_memory = false;
ae23c9
+    migrate_cve_2014_5263_xhci_fields = true;
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel700(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel700(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_machine_rhel700_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel710_options(m);
ae23c9
+    m->family = "pc_piix_Y";
ae23c9
+    m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_0_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
ae23c9
+                  pc_machine_rhel700_options);
ae23c9
+
ae23c9
+#define PC_RHEL6_6_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "scsi-hd",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "scsi-cd",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "scsi-disk",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "ide-hd",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "ide-cd",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "ide-drive",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-blk-pci",\
ae23c9
+            .property = "discard_granularity",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-serial-pci",\
ae23c9
+            .property = "vectors",\
ae23c9
+            /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
ae23c9
+            .value    = stringify(0xFFFFFFFF),\
ae23c9
+        },{\
ae23c9
+            .driver   = "486-" TYPE_X86_CPU,\
ae23c9
+            .property = "model",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-tablet",\
ae23c9
+            .property = "usb_version",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-net-pci",\
ae23c9
+            .property = "mq",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "VGA",\
ae23c9
+            .property = "mmio",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-blk-pci",\
ae23c9
+            .property = "config-wce",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = TYPE_ISA_FDC,\
ae23c9
+            .property = "check_media_rate",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-balloon-pci",\
ae23c9
+            .property = "class",\
ae23c9
+            .value    = stringify(PCI_CLASS_MEMORY_RAM),\
ae23c9
+        },{\
ae23c9
+            .driver   = TYPE_PCI_DEVICE,\
ae23c9
+            .property = "command_serr_enable",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "AC97",\
ae23c9
+            .property = "use_broken_id",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "intel-hda",\
ae23c9
+            .property = "msi",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver = "qemu32-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver = "486-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "qemu32-" TYPE_X86_CPU,\
ae23c9
+            .property = "model",\
ae23c9
+            .value    = stringify(3),\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-ccid",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "1",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-net-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "pentium" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "apic",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "pentium2" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "apic",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "pentium3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "apic",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Conroe" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Penryn" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Nehalem" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pclmulqdq",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pclmulqdq",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "fxsr",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "fxsr",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "mmx",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "mmx",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pat",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pat",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "cmov",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "cmov",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pge",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pge",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "cx8",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "cx8",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "mce",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "mce",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pae",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pae",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "msr",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "msr",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "tsc",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "tsc",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pse",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "pse",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "de",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "de",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "fpu",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "fpu",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "rdtscp",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "rdtscp",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "smap",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "smap",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "rdtscp",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "x2apic",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "3dnow",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "3dnowext",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "virtio-net-pci",\
ae23c9
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
ae23c9
+            .value = "on",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel660(MachineState *machine)
ae23c9
+{
ae23c9
+    PCMachineState *pcms = PC_MACHINE(machine);
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
ae23c9
+
ae23c9
+    pc_compat_rhel700(machine);
ae23c9
+    if (!machine->cpu_type) {
ae23c9
+        machine->cpu_type = "cpu64-rhel6";
ae23c9
+    }
ae23c9
+
ae23c9
+    x86_cpu_change_kvm_default("kvm-pv-unhalt", NULL);
ae23c9
+
ae23c9
+    pcmc->gigabyte_align = false;
ae23c9
+    shadow_bios_after_incoming = true;
ae23c9
+    ich9_uhci123_irqpin_override = true;
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel660(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel660(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel660_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_machine_rhel700_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.6.0 PC";
ae23c9
+    m->rom_file_has_mr = false;
ae23c9
+    m->default_machine_opts = "firmware=bios.bin";
ae23c9
+    pcmc->has_acpi_build = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_6_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel660, "rhel6.6.0", pc_init_rhel660,
ae23c9
+                  pc_machine_rhel660_options);
ae23c9
+
ae23c9
+#define PC_RHEL6_5_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = TYPE_USB_DEVICE,\
ae23c9
+            .property = "msos-desc",\
ae23c9
+            .value    = "no",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel650(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel660(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel650(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel650(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel650_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel660_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.5.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_5_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel650, "rhel6.5.0", pc_init_rhel650,
ae23c9
+                  pc_machine_rhel650_options);
ae23c9
+
ae23c9
+#define PC_RHEL6_4_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "virtio-scsi-pci",\
ae23c9
+            .property = "vectors",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "hda-micro",\
ae23c9
+            .property = "mixer",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "hda-duplex",\
ae23c9
+            .property = "mixer",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "hda-output",\
ae23c9
+            .property = "mixer",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-net-pci",\
ae23c9
+            .property = "ctrl_mac_addr",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "sep",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "virtio-net-pci",\
ae23c9
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
ae23c9
+            .value = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel640(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel650(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel640(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel640(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel640_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel650_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.4.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_4_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640,
ae23c9
+                  pc_machine_rhel640_options);
ae23c9
+
ae23c9
+#define PC_RHEL6_3_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "Conroe-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "Penryn-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "e1000",\
ae23c9
+            .property = "autonegotiation",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "qxl",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(3),\
ae23c9
+        },{\
ae23c9
+            .driver   = "qxl-vga",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(3),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-scsi-pci",\
ae23c9
+            .property = "hotplug",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-scsi-pci",\
ae23c9
+            .property = "param_change",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "pmu",\
ae23c9
+            .value = "on",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-hub",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "314159",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-storage",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "1",\
ae23c9
+        },\
ae23c9
+        {\
ae23c9
+            .driver = "SandyBridge" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "tsc-deadline",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL6_3_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver = "SandyBridge-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "tsc-deadline",\
ae23c9
+            .value = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel630(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel640(machine);
ae23c9
+    x86_cpu_change_kvm_default("kvm-pv-eoi",NULL);
ae23c9
+    enable_compat_apic_id_mode();
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel630(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel630(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel630_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel640_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.3.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_3_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel630, "rhel6.3.0", pc_init_rhel630,
ae23c9
+                  pc_machine_rhel630_options);
ae23c9
+
ae23c9
+
ae23c9
+#define PC_RHEL6_2_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "pmu",\
ae23c9
+            .value = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel620(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel630(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel620(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel620(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel620_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel630_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.2.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_2_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel620, "rhel6.2.0", pc_init_rhel620,
ae23c9
+                  pc_machine_rhel620_options);
ae23c9
+
ae23c9
+/*
ae23c9
+ * NOTE: We don't have the event_idx compat entry for the
ae23c9
+ * virtio-balloon-pci driver because RHEL6 doesn't disable
ae23c9
+ * it either due to a bug (see RHBZ 1029539 fo more info)
ae23c9
+ */
ae23c9
+#define PC_RHEL6_1_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "PIIX4_PM",\
ae23c9
+            .property = "disable_s3",\
ae23c9
+            .value    = "0",\
ae23c9
+        },{\
ae23c9
+            .driver   = "PIIX4_PM",\
ae23c9
+            .property = "disable_s4",\
ae23c9
+            .value    = "0",\
ae23c9
+        },{\
ae23c9
+            .driver   = "qxl",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "qxl-vga",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-blk-pci",\
ae23c9
+            .property = "event_idx",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-serial-pci",\
ae23c9
+            .property = "event_idx",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-net-pci",\
ae23c9
+            .property = "event_idx",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-kbd",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "1",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-mouse",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "1",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-tablet",\
ae23c9
+            .property = "serial",\
ae23c9
+            .value    = "1",\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel610(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel620(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel610(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel610(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel610_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel620_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.1.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_1_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel610, "rhel6.1.0", pc_init_rhel610,
ae23c9
+                  pc_machine_rhel610_options);
ae23c9
+
ae23c9
+#define PC_RHEL6_0_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "qxl",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "qxl-vga",\
ae23c9
+            .property = "revision",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "VGA",\
ae23c9
+            .property = "rombar",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },
ae23c9
+
ae23c9
+static void pc_compat_rhel600(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel610(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_init_rhel600(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_compat_rhel600(machine);
ae23c9
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
ae23c9
+             TYPE_I440FX_PCI_DEVICE);}
ae23c9
+
ae23c9
+static void pc_machine_rhel600_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_machine_rhel610_options(m);
ae23c9
+    m->family = "pc_piix_Z";
ae23c9
+    m->desc = "RHEL 6.0.0 PC";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL6_0_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(rhel600, "rhel6.0.0", pc_init_rhel600,
ae23c9
+                  pc_machine_rhel600_options);
ae23c9
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
ae23c9
index 9ae9163..dbf6bfa 100644
ae23c9
--- a/hw/i386/pc_q35.c
ae23c9
+++ b/hw/i386/pc_q35.c
ae23c9
@@ -143,8 +143,8 @@ static void pc_q35_init(MachineState *machine)
ae23c9
 
ae23c9
     if (pcmc->smbios_defaults) {
ae23c9
         /* These values are guest ABI, do not change */
ae23c9
-        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
ae23c9
-                            mc->name, pcmc->smbios_legacy_mode,
ae23c9
+        smbios_set_defaults("Red Hat", "KVM",
ae23c9
+                            mc->desc, pcmc->smbios_legacy_mode,
ae23c9
                             pcmc->smbios_uuid_encoded,
ae23c9
                             SMBIOS_ENTRY_POINT_21);
ae23c9
     }
ae23c9
@@ -292,6 +292,7 @@ static void pc_q35_init(MachineState *machine)
ae23c9
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
ae23c9
 
ae23c9
 
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ae23c9
 static void pc_q35_machine_options(MachineClass *m)
ae23c9
 {
ae23c9
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
@@ -404,3 +405,72 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
ae23c9
 
ae23c9
 DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
ae23c9
                    pc_q35_2_4_machine_options);
ae23c9
+#endif  /* Disabled for Red Hat Enterprise Linux */
ae23c9
+
ae23c9
+/* Red Hat Enterprise Linux machine types */
ae23c9
+
ae23c9
+/* Options for the latest rhel7 q35 machine type */
ae23c9
+static void pc_q35_machine_rhel7_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pcmc->default_nic_model = "e1000e";
ae23c9
+    m->family = "pc_q35_Z";
ae23c9
+    m->default_machine_opts = "firmware=bios-256k.bin";
ae23c9
+    m->default_display = "std";
ae23c9
+    m->no_floppy = 1;
ae23c9
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_SYS_BUS_DEVICE);
ae23c9
+    m->alias = "q35";
ae23c9
+    m->max_cpus = 384;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_q35_init_rhel750(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_q35_init(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_q35_machine_rhel750_options(MachineClass *m)
ae23c9
+{
ae23c9
+    pc_q35_machine_rhel7_options(m);
ae23c9
+    m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)";
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
ae23c9
+                  pc_q35_machine_rhel750_options);
ae23c9
+
ae23c9
+static void pc_q35_init_rhel740(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_q35_init(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_q35_machine_rhel740_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_q35_machine_rhel750_options(m);
ae23c9
+    m->alias = NULL;
ae23c9
+    m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
ae23c9
+    m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
ae23c9
+    pcmc->pc_rom_ro = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
ae23c9
+                  pc_q35_machine_rhel740_options);
ae23c9
+
ae23c9
+static void pc_q35_init_rhel730(MachineState *machine)
ae23c9
+{
ae23c9
+    pc_q35_init(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void pc_q35_machine_rhel730_options(MachineClass *m)
ae23c9
+{
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
+    pc_q35_machine_rhel740_options(m);
ae23c9
+    m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)";
ae23c9
+    m->max_cpus = 255;
ae23c9
+    pcmc->linuxboot_dma_enabled = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
ae23c9
+                  pc_q35_machine_rhel730_options);
ae23c9
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
ae23c9
index 73ac783..2a6de35 100644
ae23c9
--- a/hw/i386/pc_sysfw.c
ae23c9
+++ b/hw/i386/pc_sysfw.c
ae23c9
@@ -207,6 +207,13 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
ae23c9
         (bios_size % 65536) != 0) {
ae23c9
         goto bios_error;
ae23c9
     }
ae23c9
+    if (shadow_bios_after_incoming && bios_size != 128 * 1024) {
ae23c9
+        MachineClass *mc;
ae23c9
+
ae23c9
+        mc = MACHINE_GET_CLASS(current_machine);
ae23c9
+        error_report("machine %s only supports a 128KB BIOS image", mc->name);
ae23c9
+        exit(1);
ae23c9
+    }
ae23c9
     bios = g_malloc(sizeof(*bios));
ae23c9
     memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal);
ae23c9
     if (!isapc_ram_fw) {
ae23c9
@@ -254,6 +261,15 @@ void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
ae23c9
         return;
ae23c9
     }
ae23c9
 
ae23c9
+    if (shadow_bios_after_incoming) {
ae23c9
+        MachineClass *mc;
ae23c9
+
ae23c9
+        mc = MACHINE_GET_CLASS(current_machine);
ae23c9
+        error_report("flash-based firmware is not supported by machine %s",
ae23c9
+                     mc->name);
ae23c9
+        exit(1);
ae23c9
+    }
ae23c9
+
ae23c9
     if (kvm_enabled() && !kvm_readonly_mem_enabled()) {
ae23c9
         /* Older KVM cannot execute from device memory. So, flash memory
ae23c9
          * cannot be used unless the readonly memory kvm capability is present. */
ae23c9
diff --git a/hw/i386/shadow-bios.c b/hw/i386/shadow-bios.c
ae23c9
new file mode 100644
ae23c9
index 0000000..65a4cb8
ae23c9
--- /dev/null
ae23c9
+++ b/hw/i386/shadow-bios.c
ae23c9
@@ -0,0 +1,64 @@
ae23c9
+#include "qemu/osdep.h"
ae23c9
+#include "sysemu/sysemu.h"
ae23c9
+#include "target/i386/cpu.h"
ae23c9
+#include "exec/ram_addr.h"
ae23c9
+#include "qemu/cutils.h"
ae23c9
+
ae23c9
+void shadow_bios(void)
ae23c9
+{
ae23c9
+    RAMBlock *block, *ram, *oprom, *bios;
ae23c9
+    size_t one_meg, oprom_size, bios_size;
ae23c9
+    uint8_t *cd_seg_host, *ef_seg_host;
ae23c9
+
ae23c9
+    ram = NULL;
ae23c9
+    oprom = NULL;
ae23c9
+    bios = NULL;
ae23c9
+    rcu_read_lock();
ae23c9
+    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
ae23c9
+        if (strcmp("pc.ram", block->idstr) == 0) {
ae23c9
+            assert(ram == NULL);
ae23c9
+            ram = block;
ae23c9
+        } else if (strcmp("pc.rom", block->idstr) == 0) {
ae23c9
+            assert(oprom == NULL);
ae23c9
+            oprom = block;
ae23c9
+        } else if (strcmp("pc.bios", block->idstr) == 0) {
ae23c9
+            assert(bios == NULL);
ae23c9
+            bios = block;
ae23c9
+        }
ae23c9
+    }
ae23c9
+    assert(ram != NULL);
ae23c9
+    assert(oprom != NULL);
ae23c9
+    assert(bios != NULL);
ae23c9
+    assert(memory_region_is_ram(ram->mr));
ae23c9
+    assert(memory_region_is_ram(oprom->mr));
ae23c9
+    assert(memory_region_is_ram(bios->mr));
ae23c9
+    assert(int128_eq(ram->mr->size, int128_make64(ram->used_length)));
ae23c9
+    assert(int128_eq(oprom->mr->size, int128_make64(oprom->used_length)));
ae23c9
+    assert(int128_eq(bios->mr->size, int128_make64(bios->used_length)));
ae23c9
+
ae23c9
+    one_meg = 1024 * 1024;
ae23c9
+    oprom_size = 128 * 1024;
ae23c9
+    bios_size = 128 * 1024;
ae23c9
+    assert(ram->used_length >= one_meg);
ae23c9
+    assert(oprom->used_length == oprom_size);
ae23c9
+    assert(bios->used_length == bios_size);
ae23c9
+
ae23c9
+    ef_seg_host = memory_region_get_ram_ptr(ram->mr) + (one_meg - bios_size);
ae23c9
+    cd_seg_host = ef_seg_host - oprom_size;
ae23c9
+
ae23c9
+    /* This is a crude hack, but we must distinguish a rhel6.x.0 machtype guest
ae23c9
+     * coming in from a RHEL-6 emulator (where shadowing has had no effect on
ae23c9
+     * "pc.ram") from a similar guest coming in from a RHEL-7 emulator (where
ae23c9
+     * shadowing has worked). In the latter case we must not trample the live
ae23c9
+     * SeaBIOS variables in "pc.ram".
ae23c9
+     */
ae23c9
+    if (buffer_is_zero(ef_seg_host, bios_size)) {
ae23c9
+        fprintf(stderr, "copying E and F segments from pc.bios to pc.ram\n");
ae23c9
+        memcpy(ef_seg_host, memory_region_get_ram_ptr(bios->mr), bios_size);
ae23c9
+    }
ae23c9
+    if (buffer_is_zero(cd_seg_host, oprom_size)) {
ae23c9
+        fprintf(stderr, "copying C and D segments from pc.rom to pc.ram\n");
ae23c9
+        memcpy(cd_seg_host, memory_region_get_ram_ptr(oprom->mr), oprom_size);
ae23c9
+    }
ae23c9
+    rcu_read_unlock();
ae23c9
+}
ae23c9
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
ae23c9
index 742cd0a..7d568da 100644
ae23c9
--- a/hw/net/e1000.c
ae23c9
+++ b/hw/net/e1000.c
ae23c9
@@ -1663,6 +1663,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
ae23c9
 
ae23c9
     pci_conf = pci_dev->config;
ae23c9
 
ae23c9
+    if (!(d->compat_flags & E1000_FLAG_AUTONEG)) {
ae23c9
+        /*
ae23c9
+         * We have no capabilities, so capability list bit should normally be 0.
ae23c9
+         * Keep it on for compat machine types to avoid breaking migration.
ae23c9
+         * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for
ae23c9
+         * the machine types that need this.
ae23c9
+         */
ae23c9
+        pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
ae23c9
+    }
ae23c9
+
ae23c9
     /* TODO: RST# value should be 0, PCI spec 6.2.4 */
ae23c9
     pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
ae23c9
 
ae23c9
@@ -1763,7 +1773,7 @@ static const TypeInfo e1000_base_info = {
ae23c9
 
ae23c9
 static const E1000Info e1000_devices[] = {
ae23c9
     {
ae23c9
-        .name      = "e1000",
ae23c9
+        .name      = "e1000-82540em",
ae23c9
         .device_id = E1000_DEV_ID_82540EM,
ae23c9
         .revision  = 0x03,
ae23c9
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
ae23c9
@@ -1784,6 +1794,11 @@ static const E1000Info e1000_devices[] = {
ae23c9
 #endif
ae23c9
 };
ae23c9
 
ae23c9
+static const TypeInfo e1000_default_info = {
ae23c9
+    .name          = "e1000",
ae23c9
+    .parent        = "e1000-82540em",
ae23c9
+};
ae23c9
+
ae23c9
 static void e1000_register_types(void)
ae23c9
 {
ae23c9
     int i;
ae23c9
@@ -1801,6 +1816,7 @@ static void e1000_register_types(void)
ae23c9
 
ae23c9
         type_register(&type_info);
ae23c9
     }
ae23c9
+    type_register_static(&e1000_default_info);
ae23c9
 }
ae23c9
 
ae23c9
 type_init(e1000_register_types)
ae23c9
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
ae23c9
index 16a9417..460123f 100644
ae23c9
--- a/hw/net/e1000e.c
ae23c9
+++ b/hw/net/e1000e.c
ae23c9
@@ -74,6 +74,11 @@ typedef struct E1000EState {
ae23c9
 
ae23c9
     E1000ECore core;
ae23c9
 
ae23c9
+    /* 7.3 had the intr_state field that was in the original e1000e code
ae23c9
+     * but that was removed prior to 2.7's release
ae23c9
+     */
ae23c9
+    bool redhat_7_3_intr_state_enable;
ae23c9
+    uint32_t redhat_7_3_intr_state;
ae23c9
 } E1000EState;
ae23c9
 
ae23c9
 #define E1000E_MMIO_IDX     0
ae23c9
@@ -89,6 +94,10 @@ typedef struct E1000EState {
ae23c9
 #define E1000E_MSIX_TABLE   (0x0000)
ae23c9
 #define E1000E_MSIX_PBA     (0x2000)
ae23c9
 
ae23c9
+/* Values as in RHEL 7.3 build and original upstream */
ae23c9
+#define RH_E1000E_USE_MSI     BIT(0)
ae23c9
+#define RH_E1000E_USE_MSIX    BIT(1)
ae23c9
+
ae23c9
 static uint64_t
ae23c9
 e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
ae23c9
 {
ae23c9
@@ -300,6 +309,8 @@ e1000e_init_msix(E1000EState *s)
ae23c9
     } else {
ae23c9
         if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
ae23c9
             msix_uninit(d, &s->msix, &s->msix);
ae23c9
+        } else {
ae23c9
+            s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX;
ae23c9
         }
ae23c9
     }
ae23c9
 }
ae23c9
@@ -471,6 +482,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
ae23c9
     ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
ae23c9
     if (ret) {
ae23c9
         trace_e1000e_msi_init_fail(ret);
ae23c9
+    } else {
ae23c9
+        s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI;
ae23c9
     }
ae23c9
 
ae23c9
     if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
ae23c9
@@ -594,6 +607,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
ae23c9
     VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0,                           \
ae23c9
                          e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
ae23c9
 
ae23c9
+static bool rhel_7_3_check(void *opaque, int version_id)
ae23c9
+{
ae23c9
+    return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable;
ae23c9
+}
ae23c9
+
ae23c9
 static const VMStateDescription e1000e_vmstate = {
ae23c9
     .name = "e1000e",
ae23c9
     .version_id = 1,
ae23c9
@@ -605,6 +623,7 @@ static const VMStateDescription e1000e_vmstate = {
ae23c9
         VMSTATE_MSIX(parent_obj, E1000EState),
ae23c9
 
ae23c9
         VMSTATE_UINT32(ioaddr, E1000EState),
ae23c9
+        VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check),
ae23c9
         VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
ae23c9
         VMSTATE_UINT8(core.rx_desc_len, E1000EState),
ae23c9
         VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
ae23c9
@@ -653,6 +672,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
ae23c9
 
ae23c9
 static Property e1000e_properties[] = {
ae23c9
     DEFINE_NIC_PROPERTIES(E1000EState, conf),
ae23c9
+    DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState,
ae23c9
+                        redhat_7_3_intr_state_enable, false),
ae23c9
     DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false,
ae23c9
                         e1000e_prop_disable_vnet, bool),
ae23c9
     DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
ae23c9
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
ae23c9
index 46daa16..05453e7 100644
ae23c9
--- a/hw/net/rtl8139.c
ae23c9
+++ b/hw/net/rtl8139.c
ae23c9
@@ -3174,7 +3174,7 @@ static int rtl8139_pre_save(void *opaque)
ae23c9
 
ae23c9
 static const VMStateDescription vmstate_rtl8139 = {
ae23c9
     .name = "rtl8139",
ae23c9
-    .version_id = 5,
ae23c9
+    .version_id = 4,
ae23c9
     .minimum_version_id = 3,
ae23c9
     .post_load = rtl8139_post_load,
ae23c9
     .pre_save  = rtl8139_pre_save,
ae23c9
@@ -3255,7 +3255,9 @@ static const VMStateDescription vmstate_rtl8139 = {
ae23c9
         VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
ae23c9
         VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
ae23c9
         VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */
ae23c9
         VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5),
ae23c9
+#endif
ae23c9
         VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State),
ae23c9
         VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
ae23c9
 
ae23c9
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
ae23c9
index 6a92b20..c751111 100644
ae23c9
--- a/hw/ppc/spapr.c
ae23c9
+++ b/hw/ppc/spapr.c
ae23c9
@@ -3935,6 +3935,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
ae23c9
     smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN;
ae23c9
     smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN;
ae23c9
     spapr_caps_add_properties(smc, &error_abort);
ae23c9
+    smc->has_power9_support = true;
ae23c9
 }
ae23c9
 
ae23c9
 static const TypeInfo spapr_machine_info = {
ae23c9
@@ -3985,6 +3986,7 @@ static const TypeInfo spapr_machine_info = {
ae23c9
     }                                                                \
ae23c9
     type_init(spapr_machine_register_##suffix)
ae23c9
 
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ae23c9
 /*
ae23c9
  * pseries-2.12
ae23c9
  */
ae23c9
@@ -4136,6 +4138,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
ae23c9
         .property = "pre-2.8-migration",            \
ae23c9
         .value    = "on",                           \
ae23c9
     },
ae23c9
+#endif
ae23c9
 
ae23c9
 static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
ae23c9
                               uint64_t *buid, hwaddr *pio,
ae23c9
@@ -4186,6 +4189,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
ae23c9
      */
ae23c9
 }
ae23c9
 
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ae23c9
 static void spapr_machine_2_7_instance_options(MachineState *machine)
ae23c9
 {
ae23c9
     sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
ae23c9
@@ -4345,6 +4349,210 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
ae23c9
     SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
ae23c9
 }
ae23c9
 DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
ae23c9
+#endif
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.5.0
ae23c9
+ */
ae23c9
+
ae23c9
+static void spapr_machine_rhel750_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel750_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    /* Defaults for the latest behaviour inherited from the base class */
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", true);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.5.0-sxxm
ae23c9
+ *
ae23c9
+ * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default
ae23c9
+ */
ae23c9
+static void spapr_machine_rhel750sxxm_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    spapr_machine_rhel750_instance_options(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel750_class_options(mc);
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.4.0
ae23c9
+ * like SPAPR_COMPAT_2_9
ae23c9
+ */
ae23c9
+
ae23c9
+#define SPAPR_COMPAT_RHEL7_4                                           \
ae23c9
+    HW_COMPAT_RHEL7_4                                                  \
ae23c9
+    {                                                                  \
ae23c9
+        .driver = TYPE_POWERPC_CPU,                                    \
ae23c9
+        .property = "pre-2.10-migration",                              \
ae23c9
+        .value    = "on",                                              \
ae23c9
+    },                                                                 \
ae23c9
+
ae23c9
+static void spapr_machine_rhel740_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    spapr_machine_rhel750_instance_options(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel740_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel750_class_options(mc);
ae23c9
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_4);
ae23c9
+    mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
ae23c9
+    smc->has_power9_support = false;
ae23c9
+    smc->pre_2_10_has_unused_icps = true;
ae23c9
+    smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.4.0-sxxm
ae23c9
+ *
ae23c9
+ * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default
ae23c9
+ */
ae23c9
+static void spapr_machine_rhel740sxxm_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    spapr_machine_rhel740_instance_options(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel740_class_options(mc);
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel740sxxm, "rhel7.4.0-sxxm", false);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.3.0
ae23c9
+ * like SPAPR_COMPAT_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3
ae23c9
+ */
ae23c9
+#define SPAPR_COMPAT_RHEL7_3 \
ae23c9
+    HW_COMPAT_RHEL7_3                               \
ae23c9
+    {                                               \
ae23c9
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
ae23c9
+        .property = "mem_win_size",                 \
ae23c9
+        .value    = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\
ae23c9
+    },                                              \
ae23c9
+    {                                               \
ae23c9
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
ae23c9
+        .property = "mem64_win_size",               \
ae23c9
+        .value    = "0",                            \
ae23c9
+    },                                              \
ae23c9
+    {                                               \
ae23c9
+        .driver = TYPE_POWERPC_CPU,                 \
ae23c9
+        .property = "pre-2.8-migration",            \
ae23c9
+        .value    = "on",                           \
ae23c9
+    },                                              \
ae23c9
+    {                                               \
ae23c9
+        .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,       \
ae23c9
+        .property = "pre-2.8-migration",            \
ae23c9
+        .value    = "on",                           \
ae23c9
+    },                                              \
ae23c9
+    {                                               \
ae23c9
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,     \
ae23c9
+        .property = "pcie-extended-configuration-space",\
ae23c9
+        .value    = "off",                          \
ae23c9
+    },
ae23c9
+
ae23c9
+static void spapr_machine_rhel730_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
ae23c9
+
ae23c9
+    spapr_machine_rhel740_instance_options(machine);
ae23c9
+    spapr->use_hotplug_event_source = false;
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel730_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel740_class_options(mc);
ae23c9
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3");
ae23c9
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_3);
ae23c9
+    smc->phb_placement = phb_placement_2_7;
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.3.0-sxxm
ae23c9
+ *
ae23c9
+ * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default
ae23c9
+ */
ae23c9
+static void spapr_machine_rhel730sxxm_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    spapr_machine_rhel730_instance_options(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel730_class_options(mc);
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
ae23c9
+    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel730sxxm, "rhel7.3.0-sxxm", false);
ae23c9
+
ae23c9
+/*
ae23c9
+ * pseries-rhel7.2.0
ae23c9
+ */
ae23c9
+/* Should be like SPAPR_COMPAT_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration"
ae23c9
+ * has been backported to RHEL7_2 so we don't need it here.
ae23c9
+ */
ae23c9
+
ae23c9
+#define SPAPR_COMPAT_RHEL7_2 \
ae23c9
+    HW_COMPAT_RHEL7_2 \
ae23c9
+    { \
ae23c9
+        .driver   = "spapr-vlan", \
ae23c9
+        .property = "use-rx-buffer-pools", \
ae23c9
+        .value    = "off", \
ae23c9
+    },{ \
ae23c9
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
ae23c9
+        .property = "ddw",\
ae23c9
+        .value    = stringify(off),\
ae23c9
+    },
ae23c9
+
ae23c9
+
ae23c9
+static void spapr_machine_rhel720_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+    spapr_machine_rhel730_instance_options(machine);
ae23c9
+}
ae23c9
+
ae23c9
+static void spapr_machine_rhel720_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
ae23c9
+
ae23c9
+    spapr_machine_rhel730_class_options(mc);
ae23c9
+    smc->use_ohci_by_default = true;
ae23c9
+    mc->has_hotpluggable_cpus = NULL;
ae23c9
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_2);
ae23c9
+}
ae23c9
+
ae23c9
+DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false);
ae23c9
 
ae23c9
 static void spapr_machine_register_types(void)
ae23c9
 {
ae23c9
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
ae23c9
index 1eda854..c5f0c72 100644
ae23c9
--- a/hw/ppc/spapr_cpu_core.c
ae23c9
+++ b/hw/ppc/spapr_cpu_core.c
ae23c9
@@ -21,6 +21,7 @@
ae23c9
 #include "sysemu/numa.h"
ae23c9
 #include "sysemu/hw_accel.h"
ae23c9
 #include "qemu/error-report.h"
ae23c9
+#include "cpu-models.h"
ae23c9
 
ae23c9
 static void spapr_cpu_reset(void *opaque)
ae23c9
 {
ae23c9
@@ -62,6 +63,7 @@ static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,
ae23c9
                            Error **errp)
ae23c9
 {
ae23c9
     CPUPPCState *env = &cpu->env;
ae23c9
+    sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
ae23c9
 
ae23c9
     /* Set time-base frequency to 512 MHz */
ae23c9
     cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);
ae23c9
@@ -69,6 +71,17 @@ static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,
ae23c9
     /* Enable PAPR mode in TCG or KVM */
ae23c9
     cpu_ppc_set_papr(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
ae23c9
 
ae23c9
+    if (!smc->has_power9_support &&
ae23c9
+        (((spapr->max_compat_pvr &&
ae23c9
+           ppc_compat_cmp(spapr->max_compat_pvr,
ae23c9
+                          CPU_POWERPC_LOGICAL_3_00) >= 0)) ||
ae23c9
+          (!spapr->max_compat_pvr &&
ae23c9
+           ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, 0)))) {
ae23c9
+        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
ae23c9
+                  "POWER9 CPU is not supported by this machine class");
ae23c9
+        return;
ae23c9
+    }
ae23c9
+
ae23c9
     qemu_register_reset(spapr_cpu_reset, cpu);
ae23c9
     spapr_cpu_reset(cpu);
ae23c9
 }
ae23c9
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
ae23c9
index 435f7c9..3956ac3 100644
ae23c9
--- a/hw/s390x/s390-virtio-ccw.c
ae23c9
+++ b/hw/s390x/s390-virtio-ccw.c
ae23c9
@@ -647,7 +647,7 @@ bool css_migration_enabled(void)
ae23c9
     {                                                                         \
ae23c9
         MachineClass *mc = MACHINE_CLASS(oc);                                 \
ae23c9
         ccw_machine_##suffix##_class_options(mc);                             \
ae23c9
-        mc->desc = "VirtIO-ccw based S390 machine v" verstr;                  \
ae23c9
+        mc->desc = "VirtIO-ccw based S390 machine " verstr;                   \
ae23c9
         if (latest) {                                                         \
ae23c9
             mc->alias = "s390-ccw-virtio";                                    \
ae23c9
             mc->is_default = 1;                                               \
ae23c9
@@ -682,6 +682,8 @@ bool css_migration_enabled(void)
ae23c9
 #define CCW_COMPAT_2_10 \
ae23c9
         HW_COMPAT_2_10
ae23c9
 
ae23c9
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ae23c9
+
ae23c9
 #define CCW_COMPAT_2_9 \
ae23c9
         HW_COMPAT_2_9 \
ae23c9
         {\
ae23c9
@@ -879,6 +881,19 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
ae23c9
 }
ae23c9
 DEFINE_CCW_MACHINE(2_4, "2.4", false);
ae23c9
 
ae23c9
+#else
ae23c9
+
ae23c9
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
ae23c9
+{
ae23c9
+}
ae23c9
+
ae23c9
+static void ccw_machine_rhel750_class_options(MachineClass *mc)
ae23c9
+{
ae23c9
+}
ae23c9
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", true);
ae23c9
+
ae23c9
+#endif
ae23c9
+
ae23c9
 static void ccw_machine_register_types(void)
ae23c9
 {
ae23c9
     type_register_static(&ccw_machine_info);
ae23c9
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
ae23c9
index 27a07e9..df8f0ae 100644
ae23c9
--- a/hw/smbios/smbios.c
ae23c9
+++ b/hw/smbios/smbios.c
ae23c9
@@ -778,6 +778,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
ae23c9
     SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer);
ae23c9
     SMBIOS_SET_DEFAULT(type1.product, product);
ae23c9
     SMBIOS_SET_DEFAULT(type1.version, version);
ae23c9
+    SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux");
ae23c9
     SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer);
ae23c9
     SMBIOS_SET_DEFAULT(type2.product, product);
ae23c9
     SMBIOS_SET_DEFAULT(type2.version, version);
ae23c9
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
ae23c9
index 6190b6f..ad2ad2d 100644
ae23c9
--- a/hw/timer/i8254_common.c
ae23c9
+++ b/hw/timer/i8254_common.c
ae23c9
@@ -268,7 +268,7 @@ static const VMStateDescription vmstate_pit_common = {
ae23c9
     .pre_save = pit_dispatch_pre_save,
ae23c9
     .post_load = pit_dispatch_post_load,
ae23c9
     .fields = (VMStateField[]) {
ae23c9
-        VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
ae23c9
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
ae23c9
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
ae23c9
                              vmstate_pit_channel, PITChannelState),
ae23c9
         VMSTATE_INT64(channels[0].next_transition_time,
ae23c9
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
ae23c9
index 6f1f723..68c353f 100644
ae23c9
--- a/hw/timer/mc146818rtc.c
ae23c9
+++ b/hw/timer/mc146818rtc.c
ae23c9
@@ -34,6 +34,7 @@
ae23c9
 #include "qapi/qapi-commands-misc.h"
ae23c9
 #include "qapi/qapi-events-misc.h"
ae23c9
 #include "qapi/visitor.h"
ae23c9
+#include "migration/migration.h"
ae23c9
 
ae23c9
 #ifdef TARGET_I386
ae23c9
 #include "hw/i386/apic.h"
ae23c9
@@ -839,6 +840,11 @@ static int rtc_post_load(void *opaque, int version_id)
ae23c9
 static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
ae23c9
 {
ae23c9
     RTCState *s = (RTCState *)opaque;
ae23c9
+
ae23c9
+    if (migrate_pre_2_2) {
ae23c9
+        return false;
ae23c9
+    }
ae23c9
+
ae23c9
     return s->irq_reinject_on_ack_count != 0;
ae23c9
 }
ae23c9
 
ae23c9
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
ae23c9
index 836b11f..86d6ab8 100644
ae23c9
--- a/hw/usb/hcd-uhci.c
ae23c9
+++ b/hw/usb/hcd-uhci.c
ae23c9
@@ -152,6 +152,8 @@ typedef struct UHCI_QH {
ae23c9
     uint32_t el_link;
ae23c9
 } UHCI_QH;
ae23c9
 
ae23c9
+bool ich9_uhci123_irqpin_override;
ae23c9
+
ae23c9
 static void uhci_async_cancel(UHCIAsync *async);
ae23c9
 static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td);
ae23c9
 static void uhci_resume(void *opaque);
ae23c9
@@ -1214,12 +1216,23 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
ae23c9
     UHCIState *s = UHCI(dev);
ae23c9
     uint8_t *pci_conf = s->dev.config;
ae23c9
     int i;
ae23c9
+    int irq_pin;
ae23c9
 
ae23c9
     pci_conf[PCI_CLASS_PROG] = 0x00;
ae23c9
     /* TODO: reset value should be 0. */
ae23c9
     pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
ae23c9
 
ae23c9
-    pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
ae23c9
+    if (ich9_uhci123_irqpin_override &&
ae23c9
+        u->info.vendor_id == PCI_VENDOR_ID_INTEL &&
ae23c9
+        (u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI1 ||
ae23c9
+         u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI2 ||
ae23c9
+         u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI3)) {
ae23c9
+        fprintf(stderr, "RHEL-6 compat: %s: irq_pin = 3\n", u->info.name);
ae23c9
+        irq_pin = 3;
ae23c9
+    } else {
ae23c9
+        irq_pin = u->info.irq_pin;
ae23c9
+    }
ae23c9
+    pci_config_set_interrupt_pin(pci_conf, irq_pin + 1);
ae23c9
 
ae23c9
     if (s->masterbus) {
ae23c9
         USBPort *ports[NB_PORTS];
ae23c9
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
ae23c9
index 721beb5..883141f 100644
ae23c9
--- a/hw/usb/hcd-xhci.c
ae23c9
+++ b/hw/usb/hcd-xhci.c
ae23c9
@@ -3555,9 +3555,27 @@ static const VMStateDescription vmstate_xhci_slot = {
ae23c9
     }
ae23c9
 };
ae23c9
 
ae23c9
+static int xhci_event_pre_save(void *opaque)
ae23c9
+{
ae23c9
+    XHCIEvent *s = opaque;
ae23c9
+
ae23c9
+    s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
ae23c9
+    s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
ae23c9
+
ae23c9
+    return 0;
ae23c9
+}
ae23c9
+
ae23c9
+bool migrate_cve_2014_5263_xhci_fields;
ae23c9
+
ae23c9
+static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
ae23c9
+{
ae23c9
+    return migrate_cve_2014_5263_xhci_fields;
ae23c9
+}
ae23c9
+
ae23c9
 static const VMStateDescription vmstate_xhci_event = {
ae23c9
     .name = "xhci-event",
ae23c9
     .version_id = 1,
ae23c9
+    .pre_save = xhci_event_pre_save,
ae23c9
     .fields = (VMStateField[]) {
ae23c9
         VMSTATE_UINT32(type,   XHCIEvent),
ae23c9
         VMSTATE_UINT32(ccode,  XHCIEvent),
ae23c9
@@ -3566,6 +3584,8 @@ static const VMStateDescription vmstate_xhci_event = {
ae23c9
         VMSTATE_UINT32(flags,  XHCIEvent),
ae23c9
         VMSTATE_UINT8(slotid,  XHCIEvent),
ae23c9
         VMSTATE_UINT8(epid,    XHCIEvent),
ae23c9
+        VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
ae23c9
+        VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
ae23c9
         VMSTATE_END_OF_LIST()
ae23c9
     }
ae23c9
 };
ae23c9
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
ae23c9
index fc36a4c..89d4cf7 100644
ae23c9
--- a/hw/usb/hcd-xhci.h
ae23c9
+++ b/hw/usb/hcd-xhci.h
ae23c9
@@ -153,6 +153,8 @@ typedef struct XHCIEvent {
ae23c9
     uint32_t flags;
ae23c9
     uint8_t slotid;
ae23c9
     uint8_t epid;
ae23c9
+    uint8_t cve_2014_5263_a;
ae23c9
+    uint8_t cve_2014_5263_b;
ae23c9
 } XHCIEvent;
ae23c9
 
ae23c9
 typedef struct XHCIInterrupter {
ae23c9
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
ae23c9
index 006d3d1..4bcb4f4 100644
ae23c9
--- a/hw/virtio/virtio.c
ae23c9
+++ b/hw/virtio/virtio.c
ae23c9
@@ -24,6 +24,7 @@
ae23c9
 #include "hw/virtio/virtio-access.h"
ae23c9
 #include "sysemu/dma.h"
ae23c9
 
ae23c9
+#include "standard-headers/linux/virtio_net.h"
ae23c9
 /*
ae23c9
  * The alignment to use between consumer and producer parts of vring.
ae23c9
  * x86 pagesize again. This is the default, used by transports like PCI
ae23c9
@@ -1991,7 +1992,24 @@ const VMStateInfo  virtio_vmstate_info = {
ae23c9
 static int virtio_set_features_nocheck(VirtIODevice *vdev, uint64_t val)
ae23c9
 {
ae23c9
     VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
ae23c9
-    bool bad = (val & ~(vdev->host_features)) != 0;
ae23c9
+    bool bad;
ae23c9
+    uint64_t ctrl_guest_mask = 1ull << VIRTIO_NET_F_CTRL_GUEST_OFFLOADS;
ae23c9
+
ae23c9
+    if (vdev->rhel6_ctrl_guest_workaround && (val & ctrl_guest_mask) &&
ae23c9
+          !(vdev->host_features & ctrl_guest_mask)) {
ae23c9
+        /*
ae23c9
+         * This works around a mistake in the definition of the rhel6.[56].0
ae23c9
+         * machinetypes, ctrl-guest-offload was not set in qemu-kvm-rhev for
ae23c9
+         * those machine types, but is set on the rhel6 qemu-kvm-rhev build.
ae23c9
+         * If an incoming rhel6 guest uses it then we need to allow it.
ae23c9
+         * Note: There's a small race where a guest read the flag but didn't
ae23c9
+         * declare it's useage yet.
ae23c9
+         */
ae23c9
+        fprintf(stderr, "RHEL6 ctrl_guest_offload workaround\n");
ae23c9
+        vdev->host_features |= ctrl_guest_mask;
ae23c9
+    }
ae23c9
+
ae23c9
+    bad = (val & ~(vdev->host_features)) != 0;
ae23c9
 
ae23c9
     val &= vdev->host_features;
ae23c9
     if (k->set_features) {
ae23c9
@@ -2566,6 +2584,8 @@ static void virtio_device_instance_finalize(Object *obj)
ae23c9
 
ae23c9
 static Property virtio_properties[] = {
ae23c9
     DEFINE_VIRTIO_COMMON_FEATURES(VirtIODevice, host_features),
ae23c9
+    DEFINE_PROP_BOOL("__com.redhat_rhel6_ctrl_guest_workaround", VirtIODevice,
ae23c9
+                     rhel6_ctrl_guest_workaround, false),
ae23c9
     DEFINE_PROP_END_OF_LIST(),
ae23c9
 };
ae23c9
 
ae23c9
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
ae23c9
index 59aeb06..7b5cc25 100644
ae23c9
--- a/include/hw/acpi/ich9.h
ae23c9
+++ b/include/hw/acpi/ich9.h
ae23c9
@@ -61,6 +61,9 @@ typedef struct ICH9LPCPMRegs {
ae23c9
     uint8_t smm_enabled;
ae23c9
     bool enable_tco;
ae23c9
     TCOIORegs tco_regs;
ae23c9
+
ae23c9
+    /* RH addition, see bz 1489800 */
ae23c9
+    bool force_rev1_fadt;
ae23c9
 } ICH9LPCPMRegs;
ae23c9
 
ae23c9
 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
ae23c9
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
ae23c9
index ba0c1a4..2e8e78a 100644
ae23c9
--- a/include/hw/arm/virt.h
ae23c9
+++ b/include/hw/arm/virt.h
ae23c9
@@ -109,6 +109,7 @@ typedef struct {
ae23c9
     int psci_conduit;
ae23c9
 } VirtMachineState;
ae23c9
 
ae23c9
+#if 0 /* disabled for Red Hat Enterprise Linux */
ae23c9
 #define TYPE_VIRT_MACHINE   MACHINE_TYPE_NAME("virt")
ae23c9
 #define VIRT_MACHINE(obj) \
ae23c9
     OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
ae23c9
@@ -117,6 +118,27 @@ typedef struct {
ae23c9
 #define VIRT_MACHINE_CLASS(klass) \
ae23c9
     OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE)
ae23c9
 
ae23c9
+#else
ae23c9
+#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel")
ae23c9
+#define VIRT_MACHINE(obj) \
ae23c9
+    OBJECT_CHECK(VirtMachineState, (obj), TYPE_RHEL_MACHINE)
ae23c9
+#define VIRT_MACHINE_GET_CLASS(obj) \
ae23c9
+    OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_RHEL_MACHINE)
ae23c9
+#define VIRT_MACHINE_CLASS(klass) \
ae23c9
+    OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE)
ae23c9
+#endif
ae23c9
+
ae23c9
+/* This macro is for changes to properties that are RHEL specific,
ae23c9
+ * different to the current upstream and to be applied to the latest
ae23c9
+ * machine type.
ae23c9
+ */
ae23c9
+#define ARM_RHEL_COMPAT \
ae23c9
+    {\
ae23c9
+        .driver   = "virtio-net-pci",\
ae23c9
+        .property = "romfile",\
ae23c9
+        .value    = "",\
ae23c9
+    },
ae23c9
+
ae23c9
 void virt_acpi_setup(VirtMachineState *vms);
ae23c9
 
ae23c9
 #endif /* QEMU_ARM_VIRT_H */
ae23c9
diff --git a/include/hw/compat.h b/include/hw/compat.h
ae23c9
index 13242b8..de251fd 100644
ae23c9
--- a/include/hw/compat.h
ae23c9
+++ b/include/hw/compat.h
ae23c9
@@ -255,4 +255,195 @@
ae23c9
         .value    = "on",\
ae23c9
     },
ae23c9
 
ae23c9
+/* Mostly like HW_COMPAT_2_1 but:
ae23c9
+ *    we don't need virtio-scsi-pci since 7.0 already had that on
ae23c9
+ *
ae23c9
+ * RH: Note, qemu-extended-regs should have been enabled in the 7.1
ae23c9
+ * machine type, but was accidentally turned off in 7.2 onwards.
ae23c9
+ *
ae23c9
+ */
ae23c9
+#define HW_COMPAT_RHEL7_1 \
ae23c9
+        { /* COMPAT_RHEL7.1 */ \
ae23c9
+            .driver   = "intel-hda-generic",\
ae23c9
+            .property = "old_msi_addr",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{\
ae23c9
+            .driver   = "VGA",\
ae23c9
+            .property = "qemu-extended-regs",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "secondary-vga",\
ae23c9
+            .property = "qemu-extended-regs",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-mouse",\
ae23c9
+            .property = "usb_version",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "usb-kbd",\
ae23c9
+            .property = "usb_version",\
ae23c9
+            .value    = stringify(1),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "virtio-pci-bus-master-bug-migration",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-blk-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-balloon-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-serial-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-9p-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-rng-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ \
ae23c9
+            .driver   = "migration",\
ae23c9
+            .property = "send-configuration",\
ae23c9
+            .value    = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+/* Mostly like HW_COMPAT_2_4 + 2_3 but:
ae23c9
+ *  we don't need "any_layout" as it has been backported to 7.2
ae23c9
+ */
ae23c9
+
ae23c9
+#define HW_COMPAT_RHEL7_2 \
ae23c9
+        {\
ae23c9
+            .driver   = "virtio-blk-device",\
ae23c9
+            .property = "scsi",\
ae23c9
+            .value    = "true",\
ae23c9
+        },{\
ae23c9
+            .driver   = "e1000-82540em",\
ae23c9
+            .property = "extra_mac_registers",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "x-disable-pcie",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "migrate-extra",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "fw_cfg_mem",\
ae23c9
+            .property = "dma_enabled",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "fw_cfg_io",\
ae23c9
+            .property = "dma_enabled",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "isa-fdc",\
ae23c9
+            .property = "fallback",\
ae23c9
+            .value    = "144",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "disable-modern",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "disable-legacy",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = TYPE_PCI_DEVICE,\
ae23c9
+            .property = "x-pcie-lnksta-dllla",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 */ \
ae23c9
+            .driver   = "virtio-pci",\
ae23c9
+            .property = "page-per-vq",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
ae23c9
+            .driver   = "migration",\
ae23c9
+            .property = "send-section-footer",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
ae23c9
+            .driver   = "migration",\
ae23c9
+            .property = "store-global-state",\
ae23c9
+            .value    = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
ae23c9
+ * disable-modern, disable-legacy, page-per-vq have already been
ae23c9
+ * backported to RHEL7.3
ae23c9
+ */
ae23c9
+#define HW_COMPAT_RHEL7_3 \
ae23c9
+    { /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-mmio",\
ae23c9
+        .property = "format_transport_address",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-serial-device",\
ae23c9
+        .property = "emergency-write",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "ioapic",\
ae23c9
+        .property = "version",\
ae23c9
+        .value    = "0x11",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "intel-iommu",\
ae23c9
+        .property = "x-buggy-eim",\
ae23c9
+        .value    = "true",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-pci",\
ae23c9
+        .property = "x-ignore-backend-features",\
ae23c9
+        .value    = "on",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "fw_cfg_mem",\
ae23c9
+        .property = "x-file-slots",\
ae23c9
+        .value    = stringify(0x10),\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "fw_cfg_io",\
ae23c9
+        .property = "x-file-slots",\
ae23c9
+        .value    = stringify(0x10),\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "pflash_cfi01",\
ae23c9
+        .property = "old-multiple-chip-handling",\
ae23c9
+        .value    = "on",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = TYPE_PCI_DEVICE,\
ae23c9
+        .property = "x-pcie-extcap-init",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-pci",\
ae23c9
+        .property = "x-pcie-deverr-init",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-pci",\
ae23c9
+        .property = "x-pcie-lnkctl-init",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-pci",\
ae23c9
+        .property = "x-pcie-pm-init",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "virtio-net-device",\
ae23c9
+        .property = "x-mtu-bypass-backend",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_3 */ \
ae23c9
+        .driver   = "e1000e",\
ae23c9
+        .property = "__redhat_e1000e_7_3_intr_state",\
ae23c9
+        .value    = "on",\
ae23c9
+    },
ae23c9
+
ae23c9
+/* Mostly like HW_COMPAT_2_9 except
ae23c9
+ * x-mtu-bypass-backend, x-migrate-msix has already been
ae23c9
+ * backported to RHEL7.4. shpc was already on in 7.4.
ae23c9
+ */
ae23c9
+#define HW_COMPAT_RHEL7_4 \
ae23c9
+    { /* HW_COMPAT_RHEL7_4 */ \
ae23c9
+        .driver   = "intel-iommu",\
ae23c9
+        .property = "pt",\
ae23c9
+        .value    = "off",\
ae23c9
+    },
ae23c9
+
ae23c9
 #endif /* HW_COMPAT_H */
ae23c9
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
ae23c9
index ffee841..faddeba 100644
ae23c9
--- a/include/hw/i386/pc.h
ae23c9
+++ b/include/hw/i386/pc.h
ae23c9
@@ -142,6 +142,9 @@ struct PCMachineClass {
ae23c9
 
ae23c9
     /* use DMA capable linuxboot option rom */
ae23c9
     bool linuxboot_dma_enabled;
ae23c9
+
ae23c9
+    /* RH only, see bz 1489800 */
ae23c9
+    bool pc_rom_ro;
ae23c9
 };
ae23c9
 
ae23c9
 #define TYPE_PC_MACHINE "generic-pc-machine"
ae23c9
@@ -947,4 +950,555 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
ae23c9
     type_init(pc_machine_init_##suffix)
ae23c9
 
ae23c9
 extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
ae23c9
+
ae23c9
+/* See include/hw/compat.h for shared compatibility lists */
ae23c9
+
ae23c9
+/* This macro is for changes to properties that are RHEL specific,
ae23c9
+ * different to the current upstream and to be applied to the latest
ae23c9
+ * machine type.
ae23c9
+ */
ae23c9
+#define PC_RHEL_COMPAT \
ae23c9
+        { /* PC_RHEL_COMPAT */ \
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "host-phys-bits",\
ae23c9
+            .value = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL_COMPAT bz 1508330 */ \
ae23c9
+            .driver = "vfio-pci",\
ae23c9
+            .property = "x-no-geforce-quirks",\
ae23c9
+            .value = "on",\
ae23c9
+        },
ae23c9
+
ae23c9
+#define PC_RHEL7_4_COMPAT \
ae23c9
+        HW_COMPAT_RHEL7_4 \
ae23c9
+        { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_9 */ \
ae23c9
+            .driver   = "mch",\
ae23c9
+            .property = "extended-tseg-mbytes",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_4_COMPAT bz 1489800 */ \
ae23c9
+            .driver   = "ICH9-LPC",\
ae23c9
+            .property = "__com.redhat_force-rev1-fadt",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \
ae23c9
+            .driver   = "i440FX-pcihost",\
ae23c9
+            .property = "x-pci-hole64-fix",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \
ae23c9
+            .driver   = "q35-pcihost",\
ae23c9
+            .property = "x-pci-hole64-fix",\
ae23c9
+            .value    = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+
ae23c9
+#define PC_RHEL7_3_COMPAT \
ae23c9
+        HW_COMPAT_RHEL7_3 \
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
ae23c9
+             .driver   = "kvmclock",\
ae23c9
+             .property = "x-mach-use-reliable-get-clock",\
ae23c9
+             .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "l3-cache",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "full-cpuid-auto-level",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "family",\
ae23c9
+            .value    = "15",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "model",\
ae23c9
+            .value    = "6",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "stepping",\
ae23c9
+            .value    = "1",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \
ae23c9
+            .driver   = "isa-pcspk",\
ae23c9
+            .property = "migrate",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "cpuid-0xb",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
ae23c9
+            .driver   = "ICH9-LPC",\
ae23c9
+            .property = "x-smi-broadcast",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "vmware-cpuid-freq",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \
ae23c9
+            .driver   = "Haswell-" TYPE_X86_CPU,\
ae23c9
+            .property = "stepping",\
ae23c9
+            .value    = "1",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_3 added in 2.9 */ \
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "kvm-no-smi-migration",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \
ae23c9
+             .driver   = TYPE_X86_CPU,\
ae23c9
+             .property = "x-hv-max-vps",\
ae23c9
+             .value    = "0x40",\
ae23c9
+        },
ae23c9
+
ae23c9
+#define PC_RHEL7_2_COMPAT \
ae23c9
+        HW_COMPAT_RHEL7_2 \
ae23c9
+	{\
ae23c9
+		.driver = "phenom" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "rdtscp",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "sse4a",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "Haswell-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver   = "Haswell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "Haswell-noTSX-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver   = "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "Broadwell-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver   = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "Broadwell-noTSX-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \
ae23c9
+            .driver   = "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "abm",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "host" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "host-cache-info",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "check",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "qemu32" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "popcnt",\
ae23c9
+            .value    = "on",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = TYPE_X86_CPU,\
ae23c9
+            .property = "arat",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "usb-redir",\
ae23c9
+            .property = "streams",\
ae23c9
+            .value    = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver = TYPE_X86_CPU,\
ae23c9
+            .property = "fill-mtrr-mask",\
ae23c9
+            .value = "off",\
ae23c9
+        },\
ae23c9
+        { /* PC_RHEL7_2_COMPAT */ \
ae23c9
+            .driver   = "apic-common",\
ae23c9
+            .property = "legacy-instance-id",\
ae23c9
+            .value    = "on",\
ae23c9
+        },
ae23c9
+
ae23c9
+
ae23c9
+
ae23c9
+#define PC_RHEL7_1_COMPAT \
ae23c9
+        HW_COMPAT_RHEL7_1 \
ae23c9
+	{\
ae23c9
+		.driver = "kvm64" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "kvm32" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Conroe" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Penryn" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Nehalem" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "SandyBridge" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "SandyBridge-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G1" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G2" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G4" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G5" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vme",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "f16c",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "f16c",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Haswell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "rdrand",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "rdrand",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "f16c",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "f16c",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "rdrand",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "rdrand",\
ae23c9
+		.value = "off",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "coreduo" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vmx",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "core2duo" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "vmx",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+        { /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "qemu64" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(4),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "kvm64" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(5),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "pentium3" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(2),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "n270" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(5),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Conroe" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(4),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Penryn" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(4),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Nehalem" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-level",\
ae23c9
+            .value    = stringify(4),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "n270" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Penryn" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Conroe" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Nehalem" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "SandyBridge" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "IvyBridge" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Haswell" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Haswell-noTSX" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Broadwell" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },{ /* PC_RHEL7_1_COMPAT */ \
ae23c9
+            .driver   = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "min-xlevel",\
ae23c9
+            .value    = stringify(0x8000000a),\
ae23c9
+        },
ae23c9
+
ae23c9
+/*
ae23c9
+ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
ae23c9
+ * types as the PC_COMPAT_* do for upstream types.
ae23c9
+ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
ae23c9
+ * PC_RHEL6_*_COMPAT apply to i440fx types only, and therefore live
ae23c9
+ * in pc_piix.c.
ae23c9
+ */
ae23c9
+
ae23c9
+/*
ae23c9
+ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_*
ae23c9
+ * between our base and 1.5, less stuff backported to RHEL-7.0
ae23c9
+ * (usb-device.msos-desc), less stuff for devices we changed
ae23c9
+ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x,
ae23c9
+ * pci-serial-4x) in 7.0.
ae23c9
+ */
ae23c9
+#define PC_RHEL7_0_COMPAT \
ae23c9
+        {\
ae23c9
+            .driver   = "virtio-scsi-pci",\
ae23c9
+            .property = "any_layout",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "PIIX4_PM",\
ae23c9
+            .property = "memory-hotplug-support",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "apic",\
ae23c9
+            .property = "version",\
ae23c9
+            .value    = stringify(0x11),\
ae23c9
+        },{\
ae23c9
+            .driver   = "nec-usb-xhci",\
ae23c9
+            .property = "superspeed-ports-first",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "nec-usb-xhci",\
ae23c9
+            .property = "force-pcie-endcap",\
ae23c9
+            .value    = "on",\
ae23c9
+        },{\
ae23c9
+            .driver   = "pci-serial",\
ae23c9
+            .property = "prog_if",\
ae23c9
+            .value    = stringify(0),\
ae23c9
+        },{\
ae23c9
+            .driver   = "virtio-net-pci",\
ae23c9
+            .property = "guest_announce",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "ICH9-LPC",\
ae23c9
+            .property = "memory-hotplug-support",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "xio3130-downstream",\
ae23c9
+            .property = COMPAT_PROP_PCP,\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "ioh3420",\
ae23c9
+            .property = COMPAT_PROP_PCP,\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "PIIX4_PM",\
ae23c9
+            .property = "acpi-pci-hotplug-with-bridge-support",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{\
ae23c9
+            .driver   = "e1000",\
ae23c9
+            .property = "mitigation",\
ae23c9
+            .value    = "off",\
ae23c9
+        },{ \
ae23c9
+            .driver   = "virtio-net-pci", \
ae23c9
+            .property = "ctrl_guest_offloads", \
ae23c9
+            .value    = "off", \
ae23c9
+        },\
ae23c9
+	{\
ae23c9
+		.driver = "Conroe" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Penryn" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Nehalem" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_0_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Westmere" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{ /* PC_RHEL7_0_COMPAT (copied from the entry above) */ \
ae23c9
+		.driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G1" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G2" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G4" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},\
ae23c9
+	{\
ae23c9
+		.driver = "Opteron_G5" "-" TYPE_X86_CPU,\
ae23c9
+		.property = "x2apic",\
ae23c9
+		.value = "on",\
ae23c9
+	},
ae23c9
 #endif
ae23c9
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
ae23c9
index d60b7c6..5118af6 100644
ae23c9
--- a/include/hw/ppc/spapr.h
ae23c9
+++ b/include/hw/ppc/spapr.h
ae23c9
@@ -98,6 +98,7 @@ struct sPAPRMachineClass {
ae23c9
     bool dr_lmb_enabled;       /* enable dynamic-reconfig/hotplug of LMBs */
ae23c9
     bool use_ohci_by_default;  /* use USB-OHCI instead of XHCI */
ae23c9
     bool pre_2_10_has_unused_icps;
ae23c9
+    bool has_power9_support;
ae23c9
     void (*phb_placement)(sPAPRMachineState *spapr, uint32_t index,
ae23c9
                           uint64_t *buid, hwaddr *pio, 
ae23c9
                           hwaddr *mmio32, hwaddr *mmio64,
ae23c9
diff --git a/include/hw/usb.h b/include/hw/usb.h
ae23c9
index a5080ad..5b3fb1f 100644
ae23c9
--- a/include/hw/usb.h
ae23c9
+++ b/include/hw/usb.h
ae23c9
@@ -606,4 +606,11 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
ae23c9
                    uint8_t interface_class, uint8_t interface_subclass,
ae23c9
                    uint8_t interface_protocol);
ae23c9
 
ae23c9
+
ae23c9
+/* hcd-uhci.c -- RHEL-6 machine type compatibility */
ae23c9
+extern bool ich9_uhci123_irqpin_override;
ae23c9
+
ae23c9
+/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
ae23c9
+extern bool migrate_cve_2014_5263_xhci_fields;
ae23c9
+
ae23c9
 #endif
ae23c9
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
ae23c9
index 098bdaa..41e13d2 100644
ae23c9
--- a/include/hw/virtio/virtio.h
ae23c9
+++ b/include/hw/virtio/virtio.h
ae23c9
@@ -95,6 +95,7 @@ struct VirtIODevice
ae23c9
     uint8_t device_endian;
ae23c9
     bool use_guest_notifier_mask;
ae23c9
     AddressSpace *dma_as;
ae23c9
+    bool rhel6_ctrl_guest_workaround;
ae23c9
     QLIST_HEAD(, VirtQueue) *vector_queues;
ae23c9
 };
ae23c9
 
ae23c9
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
ae23c9
index 2b42151..5832c38 100644
ae23c9
--- a/include/sysemu/sysemu.h
ae23c9
+++ b/include/sysemu/sysemu.h
ae23c9
@@ -94,6 +94,8 @@ void qemu_add_machine_init_done_notifier(Notifier *notify);
ae23c9
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
ae23c9
 
ae23c9
 void qemu_announce_self(void);
ae23c9
+extern bool shadow_bios_after_incoming;
ae23c9
+void shadow_bios(void);
ae23c9
 
ae23c9
 extern int autostart;
ae23c9
 
ae23c9
diff --git a/migration/migration.c b/migration/migration.c
ae23c9
index 52a5092..ceb1697 100644
ae23c9
--- a/migration/migration.c
ae23c9
+++ b/migration/migration.c
ae23c9
@@ -99,6 +99,8 @@ enum mig_rp_message_type {
ae23c9
     MIG_RP_MSG_MAX
ae23c9
 };
ae23c9
 
ae23c9
+bool migrate_pre_2_2;
ae23c9
+
ae23c9
 /* When we add fault tolerance, we could have several
ae23c9
    migrations at once.  For now we don't need to add
ae23c9
    dynamic creation of migration */
ae23c9
diff --git a/migration/migration.h b/migration/migration.h
ae23c9
index 8d2f320..06833d7 100644
ae23c9
--- a/migration/migration.h
ae23c9
+++ b/migration/migration.h
ae23c9
@@ -241,5 +241,10 @@ int migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rbname,
ae23c9
 
ae23c9
 void dirty_bitmap_mig_before_vm_start(void);
ae23c9
 void init_dirty_bitmap_incoming_migration(void);
ae23c9
+/*
ae23c9
+ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards
ae23c9
+ * migration compatibility.
ae23c9
+ */
ae23c9
+extern bool migrate_pre_2_2;
ae23c9
 
ae23c9
 #endif
ae23c9
diff --git a/migration/savevm.c b/migration/savevm.c
ae23c9
index e2be02a..56c9feb 100644
ae23c9
--- a/migration/savevm.c
ae23c9
+++ b/migration/savevm.c
ae23c9
@@ -45,6 +45,7 @@
ae23c9
 #include "qapi/qapi-commands-misc.h"
ae23c9
 #include "qapi/qmp/qerror.h"
ae23c9
 #include "qemu/error-report.h"
ae23c9
+#include "qemu/rcu_queue.h"
ae23c9
 #include "sysemu/cpus.h"
ae23c9
 #include "exec/memory.h"
ae23c9
 #include "exec/target_page.h"
ae23c9
@@ -83,6 +84,7 @@ enum qemu_vm_cmd {
ae23c9
     MIG_CMD_PACKAGED,          /* Send a wrapped stream within this stream */
ae23c9
     MIG_CMD_MAX
ae23c9
 };
ae23c9
+bool shadow_bios_after_incoming;
ae23c9
 
ae23c9
 #define MAX_VM_CMD_PACKAGED_SIZE UINT32_MAX
ae23c9
 static struct mig_cmd_args {
ae23c9
@@ -2204,6 +2206,13 @@ int qemu_loadvm_state(QEMUFile *f)
ae23c9
     }
ae23c9
 
ae23c9
     qemu_loadvm_state_cleanup();
ae23c9
+    /* Supplement SeaBIOS's shadowing now, because it was useless when the
ae23c9
+     * incoming VM started on the RHEL-6 emulator.
ae23c9
+     */
ae23c9
+    if (shadow_bios_after_incoming) {
ae23c9
+        shadow_bios();
ae23c9
+    }
ae23c9
+
ae23c9
     cpu_synchronize_all_post_init();
ae23c9
 
ae23c9
     return ret;
ae23c9
diff --git a/numa.c b/numa.c
ae23c9
index 1116c90..daf10d8 100644
ae23c9
--- a/numa.c
ae23c9
+++ b/numa.c
ae23c9
@@ -493,6 +493,19 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
ae23c9
         return;
ae23c9
     }
ae23c9
 
ae23c9
+    /* The shadow_bios_after_incoming hack at savevm.c:shadow_bios() is not
ae23c9
+     * able to handle the multiple memory blocks added when using NUMA
ae23c9
+     * memdevs. We can disallow -numa memdev= when using rhel6.* machine-types
ae23c9
+     * because RHEL-6 didn't support the NUMA memdev option.
ae23c9
+     */
ae23c9
+    if (shadow_bios_after_incoming) {
ae23c9
+        MachineClass *mc;
ae23c9
+        mc = MACHINE_GET_CLASS(current_machine);
ae23c9
+        error_report("-numa memdev is not supported by machine %s",
ae23c9
+                     mc->name);
ae23c9
+        exit(1);
ae23c9
+    }
ae23c9
+
ae23c9
     memory_region_init(mr, owner, name, ram_size);
ae23c9
     for (i = 0; i < nb_numa_nodes; i++) {
ae23c9
         uint64_t size = numa_info[i].node_mem;
ae23c9
diff --git a/qdev-monitor.c b/qdev-monitor.c
ae23c9
index 61e0300..f439b83 100644
ae23c9
--- a/qdev-monitor.c
ae23c9
+++ b/qdev-monitor.c
ae23c9
@@ -47,7 +47,6 @@ typedef struct QDevAlias
ae23c9
 
ae23c9
 /* Please keep this table sorted by typename. */
ae23c9
 static const QDevAlias qdev_alias_table[] = {
ae23c9
-    { "e1000", "e1000-82540em" },
ae23c9
     { "ich9-ahci", "ahci" },
ae23c9
     { "lsi53c895a", "lsi" },
ae23c9
     { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
ae23c9
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
ae23c9
index bcef7ee..ffb13d1 100755
ae23c9
--- a/scripts/vmstate-static-checker.py
ae23c9
+++ b/scripts/vmstate-static-checker.py
ae23c9
@@ -104,7 +104,6 @@ def get_changed_sec_name(sec):
ae23c9
     # Section names can change -- see commit 292b1634 for an example.
ae23c9
     changes = {
ae23c9
         "ICH9 LPC": "ICH9-LPC",
ae23c9
-        "e1000-82540em": "e1000",
ae23c9
     }
ae23c9
 
ae23c9
     for item in changes:
ae23c9
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
ae23c9
index dfdfca7..8f111c5 100644
ae23c9
--- a/stubs/Makefile.objs
ae23c9
+++ b/stubs/Makefile.objs
ae23c9
@@ -44,3 +44,4 @@ stub-obj-y += xen-hvm.o
ae23c9
 stub-obj-y += pci-host-piix.o
ae23c9
 stub-obj-y += ram-block.o
ae23c9
 stub-obj-y += ide-isa.o
ae23c9
+stub-obj-y += shadow-bios.o
ae23c9
diff --git a/stubs/shadow-bios.c b/stubs/shadow-bios.c
ae23c9
new file mode 100644
ae23c9
index 0000000..c77cd7a
ae23c9
--- /dev/null
ae23c9
+++ b/stubs/shadow-bios.c
ae23c9
@@ -0,0 +1,7 @@
ae23c9
+#include "qemu/osdep.h"
ae23c9
+#include "sysemu/sysemu.h"
ae23c9
+
ae23c9
+void shadow_bios(void)
ae23c9
+{
ae23c9
+  abort();
ae23c9
+}
ae23c9
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ae23c9
index f483a71..a9db495 100644
ae23c9
--- a/target/i386/cpu.c
ae23c9
+++ b/target/i386/cpu.c
ae23c9
@@ -819,11 +819,17 @@ struct X86CPUDefinition {
ae23c9
 
ae23c9
 static X86CPUDefinition builtin_x86_defs[] = {
ae23c9
     {
ae23c9
+        /* qemu64 is the default CPU model for all *-rhel7.* machine-types.
ae23c9
+         * The default on RHEL-6 was cpu64-rhel6.
ae23c9
+         * libvirt assumes that qemu64 is the default for _all_ machine-types,
ae23c9
+         * so we should try to keep qemu64 and cpu64-rhel6 as similar as
ae23c9
+         * possible.
ae23c9
+         */
ae23c9
         .name = "qemu64",
ae23c9
         .level = 0xd,
ae23c9
         .vendor = CPUID_VENDOR_AMD,
ae23c9
         .family = 6,
ae23c9
-        .model = 6,
ae23c9
+        .model = 13,
ae23c9
         .stepping = 3,
ae23c9
         .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR |
ae23c9
             CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |
ae23c9
@@ -2097,6 +2103,7 @@ static PropValue kvm_default_props[] = {
ae23c9
     { "acpi", "off" },
ae23c9
     { "monitor", "off" },
ae23c9
     { "svm", "off" },
ae23c9
+    { "kvm-pv-unhalt", "on" },
ae23c9
     { NULL, NULL },
ae23c9
 };
ae23c9
 
ae23c9
diff --git a/target/i386/machine.c b/target/i386/machine.c
ae23c9
index bd2d82e..c9a3b5c 100644
ae23c9
--- a/target/i386/machine.c
ae23c9
+++ b/target/i386/machine.c
ae23c9
@@ -893,6 +893,26 @@ static const VMStateDescription vmstate_msr_intel_pt = {
ae23c9
     }
ae23c9
 };
ae23c9
 
ae23c9
+static bool vmstate_xsave_needed(void *opaque)
ae23c9
+{
ae23c9
+    /* The xsave state is already on the main "cpu" section */
ae23c9
+    return false;
ae23c9
+}
ae23c9
+
ae23c9
+static const VMStateDescription vmstate_xsave ={
ae23c9
+    .name = "cpu/xsave",
ae23c9
+    .version_id = 1,
ae23c9
+    .minimum_version_id = 1,
ae23c9
+    .minimum_version_id_old = 1,
ae23c9
+    .needed = vmstate_xsave_needed,
ae23c9
+    .fields      = (VMStateField []) {
ae23c9
+    VMSTATE_UINT64_V(env.xcr0, X86CPU, 1),
ae23c9
+    VMSTATE_UINT64_V(env.xstate_bv, X86CPU, 1),
ae23c9
+    VMSTATE_YMMH_REGS_VARS(env.xmm_regs, X86CPU, CPU_NB_REGS, 1),
ae23c9
+    VMSTATE_END_OF_LIST()
ae23c9
+    }
ae23c9
+};
ae23c9
+
ae23c9
 VMStateDescription vmstate_x86_cpu = {
ae23c9
     .name = "cpu",
ae23c9
     .version_id = 12,
ae23c9
@@ -1015,6 +1035,7 @@ VMStateDescription vmstate_x86_cpu = {
ae23c9
         &vmstate_spec_ctrl,
ae23c9
         &vmstate_mcg_ext_ctl,
ae23c9
         &vmstate_msr_intel_pt,
ae23c9
+        &vmstate_xsave,
ae23c9
         NULL
ae23c9
     }
ae23c9
 };
ae23c9
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
ae23c9
index 807c906..33658fb 100644
ae23c9
--- a/target/ppc/compat.c
ae23c9
+++ b/target/ppc/compat.c
ae23c9
@@ -105,6 +105,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
ae23c9
     return NULL;
ae23c9
 }
ae23c9
 
ae23c9
+long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2)
ae23c9
+{
ae23c9
+    const CompatInfo *compat1 = compat_by_pvr(pvr1);
ae23c9
+    const CompatInfo *compat2 = compat_by_pvr(pvr2);
ae23c9
+
ae23c9
+    g_assert(compat1);
ae23c9
+    g_assert(compat2);
ae23c9
+
ae23c9
+    return compat1 - compat2;
ae23c9
+}
ae23c9
+
ae23c9
 bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr,
ae23c9
                       uint32_t min_compat_pvr, uint32_t max_compat_pvr)
ae23c9
 {
ae23c9
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
ae23c9
index c621a6b..1932c2e 100644
ae23c9
--- a/target/ppc/cpu.h
ae23c9
+++ b/target/ppc/cpu.h
ae23c9
@@ -1391,6 +1391,7 @@ static inline int cpu_mmu_index (CPUPPCState *env, bool ifetch)
ae23c9
 
ae23c9
 /* Compatibility modes */
ae23c9
 #if defined(TARGET_PPC64)
ae23c9
+long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2);
ae23c9
 bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr,
ae23c9
                       uint32_t min_compat_pvr, uint32_t max_compat_pvr);
ae23c9
 void ppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr, Error **errp);
ae23c9
diff --git a/tests/Makefile.include b/tests/Makefile.include
ae23c9
index 3fd4706..0464e52 100644
ae23c9
--- a/tests/Makefile.include
ae23c9
+++ b/tests/Makefile.include
ae23c9
@@ -331,14 +331,14 @@ check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
ae23c9
 #check-qtest-ppc-y += tests/prom-env-test$(EXESUF)
ae23c9
 check-qtest-ppc-y += tests/drive_del-test$(EXESUF)
ae23c9
 check-qtest-ppc-y += tests/boot-serial-test$(EXESUF)
ae23c9
-check-qtest-ppc-y += tests/m48t59-test$(EXESUF)
ae23c9
-gcov-files-ppc-y += hw/timer/m48t59.c
ae23c9
+#check-qtest-ppc-y += tests/m48t59-test$(EXESUF)
ae23c9
+#gcov-files-ppc-y += hw/timer/m48t59.c
ae23c9
 
ae23c9
 check-qtest-ppc64-y = $(check-qtest-ppc-y)
ae23c9
 gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y))
ae23c9
 check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
ae23c9
 gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
ae23c9
-check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF)
ae23c9
+#check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF)
ae23c9
 check-qtest-ppc64-y += tests/migration-test$(EXESUF)
ae23c9
 check-qtest-ppc64-y += tests/rtas-test$(EXESUF)
ae23c9
 check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
ae23c9
@@ -754,7 +754,7 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt
ae23c9
 tests/qmp-test$(EXESUF): tests/qmp-test.o
ae23c9
 tests/device-introspect-test$(EXESUF): tests/device-introspect-test.o
ae23c9
 tests/rtc-test$(EXESUF): tests/rtc-test.o
ae23c9
-tests/m48t59-test$(EXESUF): tests/m48t59-test.o
ae23c9
+#tests/m48t59-test$(EXESUF): tests/m48t59-test.o
ae23c9
 tests/endianness-test$(EXESUF): tests/endianness-test.o
ae23c9
 tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
ae23c9
 #tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y)
ae23c9
diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c
ae23c9
index 8b5ab1f..112869b 100644
ae23c9
--- a/tests/cpu-plug-test.c
ae23c9
+++ b/tests/cpu-plug-test.c
ae23c9
@@ -192,7 +192,8 @@ static void add_pseries_test_case(const char *mname)
ae23c9
     PlugTestData *data;
ae23c9
 
ae23c9
     if (!g_str_has_prefix(mname, "pseries-") ||
ae23c9
-        (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) {
ae23c9
+        (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7) ||
ae23c9
+        strcmp(mname,"pseries-rhel7.2.0") == 0) {
ae23c9
         return;
ae23c9
     }
ae23c9
     data = g_new(PlugTestData, 1);
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9