26ba25
From 6f781f8512bbc6ae19184c8e26c96c48ffa31d93 Mon Sep 17 00:00:00 2001
26ba25
From: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
Date: Sun, 14 Dec 2014 18:32:18 +0100
26ba25
Subject: Add RHEL 7 machine types
26ba25
26ba25
This commit adds all changes related to machine types applied since
26ba25
qemu-kvm-rhev-2.1.2-16.el7.
26ba25
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
26ba25
--
26ba25
26ba25
Rebase notes for RHEL-8 (2.12.0):
26ba25
- replace has_dynamic_sysbus with list of dynamic devices (upstream)
26ba25
- Changed force_rev1_fadt handling
26ba25
- Added default nic to machine options for pc_piix and pc_q35
26ba25
- Disabled m48t59-test for ppc64
26ba25
- Disabled unsupported machine types in boot-serial-test
26ba25
- Disabled pseries-rhel7.2.0 machine type for cpu-plug-test
26ba25
26ba25
Rebase notes for RHEL-8 (2.11.0):
26ba25
- Removed references to rhel6 rom files (virtio.rom, pcnet, rtl3193,
26ba25
                                         net2k_pci e1000)
26ba25
- Removed CONFIG_RHV usage from hw/ppc/spapr.c
26ba25
- Removed x-write-pointer-available property from compat.h
26ba25
26ba25
Rebase notes (2.11.0):
26ba25
- Return type for VMStateDescription.pre_save changed (upstream)
26ba25
- Use default_cpu_type instead of tcg_default_cpu for sPAPRMachineClass
26ba25
- Use virt_get_default_cpu_node_id in arm rhel machine type
26ba25
- Set default_cpu_type to cortex-a57
26ba25
- Disable options for arm boards instead of object file remove
26ba25
- Changed order with device disable commit - removed unnecessary changes
26ba25
26ba25
Rebase notes (2.10.0):
26ba25
- Commented out new unused functions in hw/arm/virt.c
26ba25
- savevm_skip_section_footers changed to COMPAT variable (upstream)
26ba25
- global_state_set_optional changed to COMPAT variable (upstream)
26ba25
- savevm_skip_configuration changed to COMPAT variable (upstream)
26ba25
- move shadow_bios() to separate module with stub version available
26ba25
- set possible_cpu_arch_ids and cpu_index_to_instance_props fields for arm machine type
26ba25
- Re-enable older machine types for ppc64
26ba25
- Commented 7.2 rebase error for compat qemu-extended-regs
26ba25
26ba25
Rebase notes (2.9.0):
26ba25
- new header file for arm (upstream)
26ba25
- query_hotpluggable_cpus renamed to has_hotpluggable_cpus (upstream)
26ba25
- replace MAX_CPUMASK_BITS with max_cpus
26ba25
- Adding rhel6-e1000.rom moved to Initial redhat commit
26ba25
- Fixed conflict on cirrus_vga.c
26ba25
26ba25
Rebase notes (2.8.0):
26ba25
- new "m->max_cpus = 288" in pc_q35_machine_options hw/i386/pc_q35.c
26ba25
26ba25
Rebase notes (2.7.0):
26ba25
- Additional fsl-imx6.o sabrelito.o files in arm hw dir
26ba25
26ba25
Rebase notes (2.6.0):
26ba25
- Changes in handling of some compat properties
26ba25
- Fixes in x86_64 copmat models
26ba25
- Added required devices for aarch64
26ba25
- Fixes for ppc machine types
26ba25
26ba25
Rebase notes (2.5.0):
26ba25
- changed cpu defaults structure
26ba25
- chnaged cpu compat properties handling
26ba25
- added fix for arm machine type
26ba25
26ba25
Rebase notes (2.4.0)
26ba25
- Moved needed attribute (due to 5cd8cadae8db905afcbf877cae568c27d1d55a8a)
26ba25
- Fixes to machine types changes
26ba25
26ba25
Merged patches (2.12.0):
26ba25
- 402de2c redhat: Define the pseries-rhel7.5-sxxm machine type
26ba25
- a232ba5 redhat: Define the pseries-rhel7.4-sxxm machine type
26ba25
- 54f90c2 redhat: Define the pseries-rhel7.3-sxxm machine type
26ba25
- 3fe3c44 Disable GeForce quirks in vfio-pci for RHEL machines
26ba25
- 4780659 target-i386: cpu: add new CPU models for indirect branch predictor restrictions
26ba25
- d486f00 hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation
26ba25
- cc06449 spapr: Handle Decimal Floating Point (DFP) as an optional capability
26ba25
- 64ef8ed spapr: Handle VMX/VSX presence as an spapr capability flag
26ba25
- acad5a1 spapr: Treat Hardware Transactional Memory (HTM) as an optional capability
26ba25
- b1163e4 serial: always transmit send/receive buffers on migration
26ba25
26ba25
Merged patches (2.11.0):
26ba25
- 58702e8dbb redhat: fix HW_COMPAT_RHEL7_3
26ba25
- ea157600da redhat: define HW_COMPAT_RHEL7_4
26ba25
- 86ef5cd189 redhat: define pseries-rhel7.5.0 machine type
26ba25
- d8bf28e9ec qemu-kvm-ma: define only pseries-rhel7.5.0 machine type for -ma
26ba25
- 9b07271835 Create x86 7.5.0 machine types
26ba25
- e63d707db9 acpi: Force rev1 FADT on old q35 machine types
26ba25
- c091cd7a1b pc: make pc_rom RO only on new machine types
26ba25
- 082bd3ba3d arm/virt: Add RHEL 7.5 machine typei
26ba25
- 8663586f2b qemu-kvm-rhev: only allows pseries-rhel7.5.0 machine type with POWER9 guest
26ba25
- 229441f111 machine compat: pci_bridge/shpc always enable
26ba25
- 917c9e7df7 pcie_root_port: Fix x-migrate-msix compat
26ba25
- b0c0614041 q35: Fix mismerge
26ba25
- 888e98c6d6 hw/pci-host: Fix x86 Host Bridges 64bit PCI hole (partial)
26ba25
- b2f9f4fcaa i386/cpu/hyperv: support over 64 vcpus for windows guests (partial)
26ba25
- cc306393d7 migcompat/e1000e: Work around 7.3 msi/intr_state field
26ba25
- c4753f76a3 migcompat/rtl8139: Work around version bump
26ba25
26ba25
Merged patches (2.10.0)
26ba25
- 5090ba1 Fix qemu-kvm does not quit when booting guest w/ 241 vcpus and "-no-kvm"
26ba25
- 3c52050 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 288
26ba25
- 0ed92ca x86: Work around SMI breakages
26ba25
- f7b5a7f spapr: update SPAPR_COMPAT_RHEL7_3
26ba25
- 04faf4d migration: update HW_COMPAT_RHEL7_3
26ba25
- 9982768 x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 384
26ba25
- f5095ba re-enable DMA for 7.3 machine type
26ba25
- d6ec65d x86 machine compat: 2.9 stragglers
26ba25
- eda659a disable linuxboot_dma.bin option rom for 7.3 machine types
26ba25
- 8c122a5 Revert "hw/pci: disable pci-bridge's shpc by default" (partial)
26ba25
- 627adfa virtio_net: Bypass backends for MTU feature negotiation (partial)
26ba25
- b430787 pc: Use "min[x]level" on compat_props on RHEL machine-types
26ba25
- 8c3f45a AArch64: remove mach-virt-7.3 machine type
26ba25
- d5df1ef Downstream: Update pseries machine types for RHEL-ALT-7.4
26ba25
26ba25
Merged patches (2.9.0)
26ba25
- 8475d69 hw/arm/virt: Disable virtio-net-pci option ROM file loading
26ba25
- 73fe1f6 Workaround rhel6 ctrl_guest_offloads machine type mismatch
26ba25
- 21d32ca pc_piix: fix compat props typo for RHEL6 machine types
26ba25
- 55a5002 compat: define HW_COMPAT_RHEL7_3
26ba25
- 1b8e927 spapr: define pseries-rhel7.4.0 machine type
26ba25
- cdb76ec hw/arm/virt: remove aarch64 rhel machine type
26ba25
- 7dfa88b hw/arm/virt: create virt-rhel7.3.0 machine type
26ba25
- 6894f91 hw/arm/virt: create virt-rhel7.4.0 machine type
26ba25
- a9d2d39 x86: Split out options for the head rhel7 machine types
26ba25
- fdafbdc x86: Create PC_RHEL7_3_COMPAT definition
26ba25
- 3427c72 x86: Define pc-i440fx-rhel7.4.0
26ba25
- aea20ab x86: Define pc-q35-rhel7.4.0
26ba25
- 0185c0f x86: Remove downstream opteron rdtscp override
26ba25
- 6b51073 fix abort in acpi_setup() since 2.8 with rhel6 machine types
26ba25
- 954fc0d intel-hda: fix rhel6 compat property
26ba25
- 1b57274 kvmclock: reduce kvmclock difference on migration (rhel only part)
26ba25
26ba25
Merged patches (2.8.0)
26ba25
- a1da2f0 virtio-pci: reduce modern_mem_bar size (rhel only part)
26ba25
26ba25
Merged patches (2.7.0):
26ba25
- fe9d1cf pc: Use right HW_COMPAT_* macros at PC_RHEL7* compat macros
26ba25
- 3938189 compat: Add missing "any_layout" in HW_COMPAT_RHEL7_1
26ba25
- 6dffc9d spapr: update RHEL-7.2 machine type
26ba25
- c5d5910 migration: fix HW_COMPAT_RHEL7_2
26ba25
- 2da9bb8 pc: New (default) pc-i440fx-rhel7.3.0 machine-type
26ba25
- 0520d7e 7.3 mismerge fix: Fix ich9-intel-hda compatibility
26ba25
- 89528b3 PC migration compat: Section footers/global state
26ba25
- 2231e35 fw_cfg for 7.2 compatibility
26ba25
- b8a3ade pc: Create new pc-q35-rhel7.3.0 machine-type
26ba25
- 340929b q35: Remove 7.0, 7.1, 7.2 machine types
26ba25
- bb7fc95 machine types: fix pc_machine_*_options chain
26ba25
- d9fa9aa Fix rhel6 rom file
26ba25
- dc39363 fix vga type for older machines
26ba25
- 255a2d1 7.2 machine type compatibility
26ba25
- 16c3d25 target-i386: Remove SSE4a from qemu64 CPU model (rhel only part)
26ba25
- 76a1796 target-i386: Remove ABM from qemu64 CPU model (rhel only part)
26ba25
- a9f8773 pc: Recover PC_RHEL7_1_COMPAT from RHEL-7.2 code
26ba25
- 7a6ed67 pc: Include missing PC_COMPAT_2_3 entries in PC_RHEL7_2_COMPAT
26ba25
- 07428f6 Revert "static checker: e1000-82540em got aliased to e1000"
26ba25
- 446cf1f Revert "e1000: use alias for default model"
26ba25
- 615096e 7.x compat: e1000-82540em
26ba25
- 0855905 hw/arm/virt: kill 7.2 machine type
26ba25
- 18bbea2 usbredir: turn off streams for rhel7.2 & older
26ba25
- 910cf4a target-i386: Fill high bits of mtrr mask (rhel only part)
26ba25
- 0e8ab1b target-i386: Enable host-phys-bits on RHEL
26ba25
- 8c5f8a5 pc: Fix rhel6.3.0 compat_props setting
26ba25
- 8f869f1 pc: use new CPU hotplug interface since 2.7 machine type (rhel only part)
26ba25
- d9d646f machine: add properties to compat_props incrementaly (rhel only part)
26ba25
- acb18fd apic: Use apic_id as apic's migration instance_id (rhel only part)
26ba25
- c7e37d4 apic: fix broken migration for kvm-apic (rhel only part)
26ba25
- eca64aee hw/virtio-pci: fix virtio behaviour
26ba25
- c56b8F6e pc-rhel-7.2: pcie: fix link active status bit migration
26ba25
- 5522aa3 q35-rhel: allow dynamic sysbus
26ba25
26ba25
Merged patches (2.6.0):
26ba25
- f915d7f arm: virt: Add an abstract RHEL ARM virt machine type
26ba25
- deffcc0 arm: virt: Add RHEL 7.3.0 virt machine type
26ba25
- 04ca07d arm: virt: Consolidate the naming of RHEL virt machine types
26ba25
- 2856ce2 Define HW_COMPAT_RHEL7_2
26ba25
- 1869242 spapr: move pseries-2.5 machine to RHEL disabled machine zone
26ba25
- cc59ce7 spapr: add RHEL-7.3 machine type
26ba25
- 98549c5 pc: Fix property names on CPU compat code
26ba25
- caa47bb Fix ich9-intel-hda compatibility
26ba25
26ba25
Merged patches (2.3.0):
26ba25
- bb4e53c2 pc: add rhel6.6.0 machine type
26ba25
- 129a2b3 Downstream-only: Restore "pseries" machine alias
26ba25
26ba25
Merged patches (2.4.0):
26ba25
- 8e8107c numa: Don't allow memdev= on RHEL-6 machine-types
26ba25
- 8b220c0 pc_sysfw: prevent pflash and/or mis-sized firmware for rhel6.x.0 machtypes
26ba25
- 9dba3a5 Add pc-i440fx-rhel7.2.0 machine type
26ba25
- 1c88ffa Add pc-q35-rhel7.2.0 machine type
26ba25
- 6f74d0c Downstream-only: Add rhel7.2.0 machine type
26ba25
- a7d6105 Add flag for pre-2.2 migration compatibility
26ba25
- 17f9a18 Serial: Migration compatibility pre 2.2/7.2
26ba25
- 3799a57 Migration compat for mc146818rtc/irq_reinject_on_ack_count subsection
26ba25
- 5668cc1 Fix reported machine type
26ba25
- 2417534 386: drop FDC in pc-q35-rhel7.2.0 if neither it nor fl. drives are anted
26ba25
- f42eee5 global_state: Make section optional
26ba25
- 8640f84 migration: Add configuration section
26ba25
- 48c857b pc: memhotplug: fix incorrectly set reserved-memory-end
26ba25
- f33f0b6 pc: memhotplug: keep reserved-memory-end broken on rhel71 and earlier machines
26ba25
26ba25
(cherry picked from commit 44f7e7595c416686a00015e317e74183037a8136)
26ba25
26ba25
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
26ba25
Message-id: <20180111135644.16253-1-pbonzini@redhat.com>
26ba25
Patchwork-id: 78551
26ba25
O-Subject: [RHEL7.5 qemu-kvm-rhev PATCH v2] serial: always transmit send/receive buffers on migration
26ba25
Bugzilla: 1459945
26ba25
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
26ba25
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
26ba25
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
26ba25
When subsections were added in qemu 2.3, they were all disabled
26ba25
for machine types that require pre-2.3 compatibility.  The commit
26ba25
message says "disabling these subsections on older machine types should
26ba25
leave it no worse than existing qemu", but actually migrating from
26ba25
new QEMU to new QEMU (but with old machine type) will detect an
26ba25
inconsistent migration state and fail the migration:
26ba25
26ba25
   qemu-system-x86_64: inconsistent state in serial device (tsr not empty, tsr_retry=0
26ba25
   qemu-system-x86_64: Failed to load serial:state
26ba25
   qemu-system-x86_64: error while loading state for instance 0x0 of device 'serial'
26ba25
26ba25
In fact, this shows that migration from new source to old destination
26ba25
might have also eaten the data in the FIFO or transmit/receive buffers.
26ba25
26ba25
It's actually pretty easy to trigger the failure by connecting a console
26ba25
to a hung-up reader (not a *disconnected* reader!).  The fix is to
26ba25
handle the subsections the same as we did in the qemu-kvm BZ1452067.
26ba25
The data registers are migrated, which may indeed cause some more migrations
26ba25
to fail to old qemu-kvm-rhev, but it will fix migration to new qemu-kvm-rhev.
26ba25
Some subsections are still keyed on migrate_pre_2_2; from the commit message
26ba25
of downstream commit 7d2e8f9662feb64c0b15b6fd53e06e3c56921f27:
26ba25
26ba25
    thr_ipending can be reconstructed fairly
26ba25
    reliably by serial_post_load.  The others are features that are
26ba25
    unlikely to be used in RHEL, respectively receive timeout (Linux
26ba25
    does not even have the UART_IIR_CTI symbol in the driver) and
26ba25
    physical serial ports connected to a modem
26ba25
26ba25
I consider this okay because nobody has yet complained about it for
26ba25
qemu-kvm.  It's also safer because the failure avoids serial data loss
26ba25
on migration.  This is consistent with the intended use of subsections.
26ba25
26ba25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
(cherry picked from commit 10564d0bb819113f925e32b989b24fb26dca45ef)
26ba25
(cherry picked from commit 9e1104c955c05c7b850cda3a02f69bf3e931c765)
26ba25
---
26ba25
 hw/acpi/ich9.c                    |  16 +
26ba25
 hw/acpi/piix4.c                   |   6 +-
26ba25
 hw/arm/virt.c                     | 121 +++++-
26ba25
 hw/char/serial.c                  |  16 +
26ba25
 hw/display/cirrus_vga.c           |   4 +-
26ba25
 hw/display/vga-isa.c              |   2 +-
26ba25
 hw/i386/Makefile.objs             |   1 +
26ba25
 hw/i386/acpi-build.c              |   3 +
26ba25
 hw/i386/pc.c                      |   7 +-
26ba25
 hw/i386/pc_piix.c                 | 872 +++++++++++++++++++++++++++++++++++++-
26ba25
 hw/i386/pc_q35.c                  |  74 +++-
26ba25
 hw/i386/pc_sysfw.c                |  16 +
26ba25
 hw/i386/shadow-bios.c             |  64 +++
26ba25
 hw/net/e1000.c                    |  18 +-
26ba25
 hw/net/e1000e.c                   |  21 +
26ba25
 hw/net/rtl8139.c                  |   4 +-
26ba25
 hw/ppc/spapr.c                    | 208 +++++++++
26ba25
 hw/ppc/spapr_cpu_core.c           |  13 +
26ba25
 hw/s390x/s390-virtio-ccw.c        |  17 +-
26ba25
 hw/smbios/smbios.c                |   1 +
26ba25
 hw/timer/i8254_common.c           |   2 +-
26ba25
 hw/timer/mc146818rtc.c            |   6 +
26ba25
 hw/usb/hcd-uhci.c                 |  15 +-
26ba25
 hw/usb/hcd-xhci.c                 |  20 +
26ba25
 hw/usb/hcd-xhci.h                 |   2 +
26ba25
 hw/virtio/virtio.c                |  22 +-
26ba25
 include/hw/acpi/ich9.h            |   3 +
26ba25
 include/hw/arm/virt.h             |  22 +
26ba25
 include/hw/compat.h               | 191 +++++++++
26ba25
 include/hw/i386/pc.h              | 554 ++++++++++++++++++++++++
26ba25
 include/hw/ppc/spapr.h            |   1 +
26ba25
 include/hw/usb.h                  |   7 +
26ba25
 include/hw/virtio/virtio.h        |   1 +
26ba25
 include/sysemu/sysemu.h           |   2 +
26ba25
 migration/migration.c             |   2 +
26ba25
 migration/migration.h             |   5 +
26ba25
 migration/savevm.c                |   9 +
26ba25
 numa.c                            |  13 +
26ba25
 qdev-monitor.c                    |   1 -
26ba25
 scripts/vmstate-static-checker.py |   1 -
26ba25
 stubs/Makefile.objs               |   1 +
26ba25
 stubs/shadow-bios.c               |   7 +
26ba25
 target/i386/cpu.c                 |   9 +-
26ba25
 target/i386/machine.c             |  21 +
26ba25
 target/ppc/compat.c               |  11 +
26ba25
 target/ppc/cpu.h                  |   1 +
26ba25
 tests/Makefile.include            |   8 +-
26ba25
 tests/cpu-plug-test.c             |   3 +-
26ba25
 48 files changed, 2397 insertions(+), 27 deletions(-)
26ba25
 create mode 100644 hw/i386/shadow-bios.c
26ba25
 create mode 100644 stubs/shadow-bios.c
26ba25
26ba25
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
26ba25
index a4e87b8..23a7baa 100644
26ba25
--- a/hw/acpi/ich9.c
26ba25
+++ b/hw/acpi/ich9.c
26ba25
@@ -441,6 +441,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
26ba25
     s->pm.enable_tco = value;
26ba25
 }
26ba25
 
26ba25
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
26ba25
+{
26ba25
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
26ba25
+    return s->pm.force_rev1_fadt;
26ba25
+}
26ba25
+
26ba25
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
26ba25
+{
26ba25
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
26ba25
+    s->pm.force_rev1_fadt = value;
26ba25
+}
26ba25
+
26ba25
 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
26ba25
 {
26ba25
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
26ba25
@@ -465,6 +477,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
26ba25
                              ich9_pm_get_cpu_hotplug_legacy,
26ba25
                              ich9_pm_set_cpu_hotplug_legacy,
26ba25
                              NULL);
26ba25
+    object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
26ba25
+                             ich9_pm_get_force_rev1_fadt,
26ba25
+                             ich9_pm_set_force_rev1_fadt,
26ba25
+                             NULL);
26ba25
     object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
26ba25
                         ich9_pm_get_disable_s3,
26ba25
                         ich9_pm_set_disable_s3,
26ba25
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
26ba25
index 8b70345..d706360 100644
26ba25
--- a/hw/acpi/piix4.c
26ba25
+++ b/hw/acpi/piix4.c
26ba25
@@ -311,7 +311,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
26ba25
 static const VMStateDescription vmstate_acpi = {
26ba25
     .name = "piix4_pm",
26ba25
     .version_id = 3,
26ba25
-    .minimum_version_id = 3,
26ba25
+    .minimum_version_id = 2,
26ba25
     .minimum_version_id_old = 1,
26ba25
     .load_state_old = acpi_load_old,
26ba25
     .post_load = vmstate_acpi_post_load,
26ba25
@@ -671,8 +671,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
26ba25
 
26ba25
 static Property piix4_pm_properties[] = {
26ba25
     DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
26ba25
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
26ba25
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
26ba25
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
26ba25
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
26ba25
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
26ba25
     DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
26ba25
                      use_acpi_pci_hotplug, true),
26ba25
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
26ba25
index 94dcb12..806eb1e 100644
26ba25
--- a/hw/arm/virt.c
26ba25
+++ b/hw/arm/virt.c
26ba25
@@ -59,6 +59,7 @@
26ba25
 #include "qapi/visitor.h"
26ba25
 #include "standard-headers/linux/input.h"
26ba25
 
26ba25
+#if 0 /* disabled Red Hat Enterprise Linux */
26ba25
 #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \
26ba25
     static void virt_##major##_##minor##_class_init(ObjectClass *oc, \
26ba25
                                                     void *data) \
26ba25
@@ -86,7 +87,36 @@
26ba25
     DEFINE_VIRT_MACHINE_LATEST(major, minor, true)
26ba25
 #define DEFINE_VIRT_MACHINE(major, minor) \
26ba25
     DEFINE_VIRT_MACHINE_LATEST(major, minor, false)
26ba25
-
26ba25
+#endif /* disabled for RHEL */
26ba25
+
26ba25
+#define DEFINE_RHEL_MACHINE_LATEST(m, n, s, latest)                     \
26ba25
+    static void rhel##m##n##s##_virt_class_init(ObjectClass *oc,        \
26ba25
+                                                void *data)             \
26ba25
+    {                                                                   \
26ba25
+        MachineClass *mc = MACHINE_CLASS(oc);                           \
26ba25
+        rhel##m##n##s##_virt_options(mc);                               \
26ba25
+        mc->desc = "RHEL " # m "." # n "." # s " ARM Virtual Machine";  \
26ba25
+        if (latest) {                                                   \
26ba25
+            mc->alias = "virt";                                         \
26ba25
+            mc->is_default = 1;                                         \
26ba25
+        }                                                               \
26ba25
+    }                                                                   \
26ba25
+    static const TypeInfo rhel##m##n##s##_machvirt_info = {             \
26ba25
+        .name = MACHINE_TYPE_NAME("virt-rhel" # m "." # n "." # s),     \
26ba25
+        .parent = TYPE_RHEL_MACHINE,                                    \
26ba25
+        .instance_init = rhel##m##n##s##_virt_instance_init,            \
26ba25
+        .class_init = rhel##m##n##s##_virt_class_init,                  \
26ba25
+    };                                                                  \
26ba25
+    static void rhel##m##n##s##_machvirt_init(void)                     \
26ba25
+    {                                                                   \
26ba25
+        type_register_static(&rhel##m##n##s##_machvirt_info);           \
26ba25
+    }                                                                   \
26ba25
+    type_init(rhel##m##n##s##_machvirt_init);
26ba25
+
26ba25
+#define DEFINE_RHEL_MACHINE_AS_LATEST(major, minor, subminor)   \
26ba25
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true)
26ba25
+#define DEFINE_RHEL_MACHINE(major, minor, subminor)             \
26ba25
+    DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false)
26ba25
 
26ba25
 /* Number of external interrupt lines to configure the GIC with */
26ba25
 #define NUM_IRQS 256
26ba25
@@ -1416,6 +1446,7 @@ static void machvirt_init(MachineState *machine)
26ba25
     create_platform_bus(vms, pic);
26ba25
 }
26ba25
 
26ba25
+#if 0 /* disabled for RHEL */
26ba25
 static bool virt_get_secure(Object *obj, Error **errp)
26ba25
 {
26ba25
     VirtMachineState *vms = VIRT_MACHINE(obj);
26ba25
@@ -1444,6 +1475,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
26ba25
     vms->virt = value;
26ba25
 }
26ba25
 
26ba25
+#endif /* disabled for RHEL */
26ba25
 static bool virt_get_highmem(Object *obj, Error **errp)
26ba25
 {
26ba25
     VirtMachineState *vms = VIRT_MACHINE(obj);
26ba25
@@ -1536,6 +1568,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
26ba25
     return ms->possible_cpus;
26ba25
 }
26ba25
 
26ba25
+#if 0 /* disabled for RHEL */
26ba25
 static void virt_machine_class_init(ObjectClass *oc, void *data)
26ba25
 {
26ba25
     MachineClass *mc = MACHINE_CLASS(oc);
26ba25
@@ -1748,3 +1781,89 @@ static void virt_machine_2_6_options(MachineClass *mc)
26ba25
     vmc->no_pmu = true;
26ba25
 }
26ba25
 DEFINE_VIRT_MACHINE(2, 6)
26ba25
+#endif /* disabled for RHEL */
26ba25
+
26ba25
+static void rhel_machine_class_init(ObjectClass *oc, void *data)
26ba25
+{
26ba25
+    MachineClass *mc = MACHINE_CLASS(oc);
26ba25
+
26ba25
+    mc->family = "virt-rhel-Z";
26ba25
+    mc->init = machvirt_init;
26ba25
+    /* Start max_cpus at the maximum QEMU supports. We'll further restrict
26ba25
+     * it later in machvirt_init, where we have more information about the
26ba25
+     * configuration of the particular instance.
26ba25
+     */
26ba25
+    mc->max_cpus = 255;
26ba25
+    mc->block_default_type = IF_VIRTIO;
26ba25
+    mc->no_cdrom = 1;
26ba25
+    mc->pci_allow_0_address = true;
26ba25
+    /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */
26ba25
+    mc->minimum_page_bits = 12;
26ba25
+    mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids;
26ba25
+    mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
26ba25
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57");
26ba25
+    mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
26ba25
+}
26ba25
+
26ba25
+static const TypeInfo rhel_machine_info = {
26ba25
+    .name          = TYPE_RHEL_MACHINE,
26ba25
+    .parent        = TYPE_MACHINE,
26ba25
+    .abstract      = true,
26ba25
+    .instance_size = sizeof(VirtMachineState),
26ba25
+    .class_size    = sizeof(VirtMachineClass),
26ba25
+    .class_init    = rhel_machine_class_init,
26ba25
+};
26ba25
+
26ba25
+static void rhel_machine_init(void)
26ba25
+{
26ba25
+    type_register_static(&rhel_machine_info);
26ba25
+}
26ba25
+type_init(rhel_machine_init);
26ba25
+
26ba25
+static void rhel750_virt_instance_init(Object *obj)
26ba25
+{
26ba25
+    VirtMachineState *vms = VIRT_MACHINE(obj);
26ba25
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
26ba25
+
26ba25
+    /* EL3 is disabled by default and non-configurable for RHEL */
26ba25
+    vms->secure = false;
26ba25
+    /* EL2 is disabled by default and non-configurable for RHEL */
26ba25
+    vms->virt = false;
26ba25
+    /* High memory is enabled by default for RHEL */
26ba25
+    vms->highmem = true;
26ba25
+    object_property_add_bool(obj, "highmem", virt_get_highmem,
26ba25
+                             virt_set_highmem, NULL);
26ba25
+    object_property_set_description(obj, "highmem",
26ba25
+                                    "Set on/off to enable/disable using "
26ba25
+                                    "physical address space above 32 bits",
26ba25
+                                    NULL);
26ba25
+    /* Default GIC type is still v2, but became configurable for RHEL */
26ba25
+    vms->gic_version = 2;
26ba25
+    object_property_add_str(obj, "gic-version", virt_get_gic_version,
26ba25
+                        virt_set_gic_version, NULL);
26ba25
+    object_property_set_description(obj, "gic-version",
26ba25
+                                    "Set GIC version. "
26ba25
+                                    "Valid values are 2, 3 and host", NULL);
26ba25
+
26ba25
+    if (vmc->no_its) {
26ba25
+        vms->its = false;
26ba25
+    } else {
26ba25
+        /* Default allows ITS instantiation */
26ba25
+        vms->its = true;
26ba25
+        object_property_add_bool(obj, "its", virt_get_its,
26ba25
+                                 virt_set_its, NULL);
26ba25
+        object_property_set_description(obj, "its",
26ba25
+                                        "Set on/off to enable/disable "
26ba25
+                                        "ITS instantiation",
26ba25
+                                        NULL);
26ba25
+    }
26ba25
+
26ba25
+    vms->memmap=a15memmap;
26ba25
+    vms->irqmap=a15irqmap;
26ba25
+}
26ba25
+
26ba25
+static void rhel750_virt_options(MachineClass *mc)
26ba25
+{
26ba25
+    SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
26ba25
+}
26ba25
+DEFINE_RHEL_MACHINE_AS_LATEST(7, 5, 0)
26ba25
diff --git a/hw/char/serial.c b/hw/char/serial.c
26ba25
index eb72191..d6d9b18 100644
26ba25
--- a/hw/char/serial.c
26ba25
+++ b/hw/char/serial.c
26ba25
@@ -30,6 +30,7 @@
26ba25
 #include "qemu/timer.h"
26ba25
 #include "exec/address-spaces.h"
26ba25
 #include "qemu/error-report.h"
26ba25
+#include "migration/migration.h"
26ba25
 
26ba25
 //#define DEBUG_SERIAL
26ba25
 
26ba25
@@ -691,6 +692,9 @@ static int serial_post_load(void *opaque, int version_id)
26ba25
 static bool serial_thr_ipending_needed(void *opaque)
26ba25
 {
26ba25
     SerialState *s = opaque;
26ba25
+    if (migrate_pre_2_2) {
26ba25
+        return false;
26ba25
+    }
26ba25
 
26ba25
     if (s->ier & UART_IER_THRI) {
26ba25
         bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
26ba25
@@ -772,6 +776,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
26ba25
 static bool serial_fifo_timeout_timer_needed(void *opaque)
26ba25
 {
26ba25
     SerialState *s = (SerialState *)opaque;
26ba25
+    if (migrate_pre_2_2) {
26ba25
+        return false;
26ba25
+    }
26ba25
+
26ba25
     return timer_pending(s->fifo_timeout_timer);
26ba25
 }
26ba25
 
26ba25
@@ -789,6 +797,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
26ba25
 static bool serial_timeout_ipending_needed(void *opaque)
26ba25
 {
26ba25
     SerialState *s = (SerialState *)opaque;
26ba25
+    if (migrate_pre_2_2) {
26ba25
+        return false;
26ba25
+    }
26ba25
+
26ba25
     return s->timeout_ipending != 0;
26ba25
 }
26ba25
 
26ba25
@@ -806,6 +818,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
26ba25
 static bool serial_poll_needed(void *opaque)
26ba25
 {
26ba25
     SerialState *s = (SerialState *)opaque;
26ba25
+    if (migrate_pre_2_2) {
26ba25
+        return false;
26ba25
+    }
26ba25
+
26ba25
     return s->poll_msl >= 0;
26ba25
 }
26ba25
 
26ba25
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
26ba25
index d116651..feacb45 100644
26ba25
--- a/hw/display/cirrus_vga.c
26ba25
+++ b/hw/display/cirrus_vga.c
26ba25
@@ -3060,7 +3060,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
26ba25
 
26ba25
 static Property isa_cirrus_vga_properties[] = {
26ba25
     DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState,
26ba25
-                       cirrus_vga.vga.vram_size_mb, 4),
26ba25
+                       cirrus_vga.vga.vram_size_mb, 16),
26ba25
     DEFINE_PROP_BOOL("blitter", struct ISACirrusVGAState,
26ba25
                        cirrus_vga.enable_blitter, true),
26ba25
     DEFINE_PROP_END_OF_LIST(),
26ba25
@@ -3133,7 +3133,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
26ba25
 
26ba25
 static Property pci_vga_cirrus_properties[] = {
26ba25
     DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState,
26ba25
-                       cirrus_vga.vga.vram_size_mb, 4),
26ba25
+                       cirrus_vga.vga.vram_size_mb, 16),
26ba25
     DEFINE_PROP_BOOL("blitter", struct PCICirrusVGAState,
26ba25
                      cirrus_vga.enable_blitter, true),
26ba25
     DEFINE_PROP_END_OF_LIST(),
26ba25
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
26ba25
index 469834a..eb44d21 100644
26ba25
--- a/hw/display/vga-isa.c
26ba25
+++ b/hw/display/vga-isa.c
26ba25
@@ -79,7 +79,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
26ba25
 }
26ba25
 
26ba25
 static Property vga_isa_properties[] = {
26ba25
-    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
26ba25
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
26ba25
     DEFINE_PROP_END_OF_LIST(),
26ba25
 };
26ba25
 
26ba25
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
26ba25
index fa87a14..8c25538 100644
26ba25
--- a/hw/i386/Makefile.objs
26ba25
+++ b/hw/i386/Makefile.objs
26ba25
@@ -10,3 +10,4 @@ obj-$(CONFIG_VMMOUSE) += vmmouse.o
26ba25
 
26ba25
 obj-y += kvmvapic.o
26ba25
 obj-y += acpi-build.o
26ba25
+obj-y += shadow-bios.o
26ba25
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
26ba25
index 3cf2a16..976d151 100644
26ba25
--- a/hw/i386/acpi-build.c
26ba25
+++ b/hw/i386/acpi-build.c
26ba25
@@ -183,6 +183,9 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
26ba25
         pm->fadt.reset_reg = r;
26ba25
         pm->fadt.reset_val = 0xf;
26ba25
         pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
26ba25
+        if (object_property_get_bool(lpc,
26ba25
+                                     "__com.redhat_force-rev1-fadt", NULL))
26ba25
+            pm->fadt.rev = 1;
26ba25
         pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
26ba25
     }
26ba25
     assert(obj);
26ba25
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
26ba25
index fdad4bb..6f686c7 100644
26ba25
--- a/hw/i386/pc.c
26ba25
+++ b/hw/i386/pc.c
26ba25
@@ -1417,7 +1417,8 @@ void pc_memory_init(PCMachineState *pcms,
26ba25
     option_rom_mr = g_malloc(sizeof(*option_rom_mr));
26ba25
     memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
26ba25
                            &error_fatal);
26ba25
-    if (pcmc->pci_enabled) {
26ba25
+    /* RH difference: See bz 1489800, explicitly make ROM ro */
26ba25
+    if (pcmc->pc_rom_ro) {
26ba25
         memory_region_set_readonly(option_rom_mr, true);
26ba25
     }
26ba25
     memory_region_add_subregion_overlap(rom_memory,
26ba25
@@ -2361,6 +2362,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
26ba25
     pcmc->acpi_data_size = 0x20000 + 0x8000;
26ba25
     pcmc->save_tsc_khz = true;
26ba25
     pcmc->linuxboot_dma_enabled = true;
26ba25
+    pcmc->pc_rom_ro = true;
26ba25
     mc->get_hotplug_handler = pc_get_hotpug_handler;
26ba25
     mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
26ba25
     mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
26ba25
@@ -2370,7 +2372,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
26ba25
     mc->default_boot_order = "cad";
26ba25
     mc->hot_add_cpu = pc_hot_add_cpu;
26ba25
     mc->block_default_type = IF_IDE;
26ba25
-    mc->max_cpus = 255;
26ba25
+    /* 240: max CPU count for RHEL */
26ba25
+    mc->max_cpus = 240;
26ba25
     mc->reset = pc_machine_reset;
26ba25
     hc->pre_plug = pc_machine_device_pre_plug_cb;
26ba25
     hc->plug = pc_machine_device_plug_cb;
26ba25
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
26ba25
index 729a050..cc72512 100644
26ba25
--- a/hw/i386/pc_piix.c
26ba25
+++ b/hw/i386/pc_piix.c
26ba25
@@ -48,6 +48,7 @@
26ba25
 #include "cpu.h"
26ba25
 #include "qapi/error.h"
26ba25
 #include "qemu/error-report.h"
26ba25
+#include "migration/migration.h"
26ba25
 #ifdef CONFIG_XEN
26ba25
 #include <xen hvm="" hvm_info_table.h="">
26ba25
 #include "hw/xen/xen_pt.h"
26ba25
@@ -168,8 +169,8 @@ static void pc_init1(MachineState *machine,
26ba25
     if (pcmc->smbios_defaults) {
26ba25
         MachineClass *mc = MACHINE_GET_CLASS(machine);
26ba25
         /* These values are guest ABI, do not change */
26ba25
-        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
26ba25
-                            mc->name, pcmc->smbios_legacy_mode,
26ba25
+        smbios_set_defaults("Red Hat", "KVM",
26ba25
+                            mc->desc, pcmc->smbios_legacy_mode,
26ba25
                             pcmc->smbios_uuid_encoded,
26ba25
                             SMBIOS_ENTRY_POINT_21);
26ba25
     }
26ba25
@@ -307,6 +308,7 @@ static void pc_init1(MachineState *machine,
26ba25
  * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options().
26ba25
  */
26ba25
 
26ba25
+#if 0 /* Disabled for Red Hat Enterprise Linux */
26ba25
 static void pc_compat_2_3(MachineState *machine)
26ba25
 {
26ba25
     PCMachineState *pcms = PC_MACHINE(machine);
26ba25
@@ -1135,3 +1137,869 @@ static void xenfv_machine_options(MachineClass *m)
26ba25
 DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
26ba25
                   xenfv_machine_options);
26ba25
 #endif
26ba25
+machine_init(pc_machine_init);
26ba25
+
26ba25
+#endif  /* Disabled for Red Hat Enterprise Linux */
26ba25
+
26ba25
+/* Red Hat Enterprise Linux machine types */
26ba25
+
26ba25
+/* Options for the latest rhel7 machine type */
26ba25
+static void pc_machine_rhel7_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    m->family = "pc_piix_Y";
26ba25
+    m->default_machine_opts = "firmware=bios-256k.bin";
26ba25
+    pcmc->default_nic_model = "e1000";
26ba25
+    m->default_display = "std";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
26ba25
+    m->alias = "pc";
26ba25
+    m->is_default = 1;
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel750(MachineState *machine)
26ba25
+{
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel750_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel7_options(m);
26ba25
+    m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)";
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
26ba25
+                  pc_machine_rhel750_options);
26ba25
+
26ba25
+static void pc_init_rhel740(MachineState *machine)
26ba25
+{
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel740_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_machine_rhel750_options(m);
26ba25
+    m->alias = NULL;
26ba25
+    m->is_default = 0;
26ba25
+    m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
26ba25
+    m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
26ba25
+    pcmc->pc_rom_ro = false;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
26ba25
+                  pc_machine_rhel740_options);
26ba25
+
26ba25
+static void pc_init_rhel730(MachineState *machine)
26ba25
+{
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel730_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_machine_rhel740_options(m);
26ba25
+    m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)";
26ba25
+    pcmc->linuxboot_dma_enabled = false;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730,
26ba25
+                  pc_machine_rhel730_options);
26ba25
+
26ba25
+
26ba25
+static void pc_init_rhel720(MachineState *machine)
26ba25
+{
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel720_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_machine_rhel730_options(m);
26ba25
+    m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)";
26ba25
+    /* From pc_i440fx_2_5_machine_options */
26ba25
+    pcmc->save_tsc_khz = false;
26ba25
+    m->legacy_fw_cfg_order = 1;
26ba25
+    /* Note: broken_reserved_end was already in 7.2 */
26ba25
+    /* From pc_i440fx_2_6_machine_options */
26ba25
+    pcmc->legacy_cpu_hotplug = true;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_2_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720,
26ba25
+                  pc_machine_rhel720_options);
26ba25
+
26ba25
+static void pc_compat_rhel710(MachineState *machine)
26ba25
+{
26ba25
+    PCMachineState *pcms = PC_MACHINE(machine);
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
26ba25
+
26ba25
+    /* From pc_compat_2_2 */
26ba25
+    pcmc->rsdp_in_ram = false;
26ba25
+    machine->suppress_vmdesc = true;
26ba25
+
26ba25
+    /* From pc_compat_2_1 */
26ba25
+    pcmc->smbios_uuid_encoded = false;
26ba25
+    x86_cpu_change_kvm_default("svm", NULL);
26ba25
+    pcmc->enforce_aligned_dimm = false;
26ba25
+
26ba25
+    /* Disable all the extra subsections that were added in 2.2 */
26ba25
+    migrate_pre_2_2 = true;
26ba25
+
26ba25
+    /* From pc_i440fx_2_4_machine_options */
26ba25
+    pcmc->broken_reserved_end = true;
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel710(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel710(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel710_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel720_options(m);
26ba25
+    m->family = "pc_piix_Y";
26ba25
+    m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)";
26ba25
+    m->default_display = "cirrus";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_1_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
26ba25
+                  pc_machine_rhel710_options);
26ba25
+
26ba25
+static void pc_compat_rhel700(MachineState *machine)
26ba25
+{
26ba25
+    PCMachineState *pcms = PC_MACHINE(machine);
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
26ba25
+
26ba25
+    pc_compat_rhel710(machine);
26ba25
+
26ba25
+    /* Upstream enables it for everyone, we're a little more selective */
26ba25
+    x86_cpu_change_kvm_default("x2apic", NULL);
26ba25
+    x86_cpu_change_kvm_default("svm", NULL);
26ba25
+    pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
26ba25
+    pcmc->smbios_legacy_mode = true;
26ba25
+    pcmc->has_reserved_memory = false;
26ba25
+    migrate_cve_2014_5263_xhci_fields = true;
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel700(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel700(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);
26ba25
+}
26ba25
+
26ba25
+static void pc_machine_rhel700_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel710_options(m);
26ba25
+    m->family = "pc_piix_Y";
26ba25
+    m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_0_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
26ba25
+                  pc_machine_rhel700_options);
26ba25
+
26ba25
+#define PC_RHEL6_6_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = "scsi-hd",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "scsi-cd",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "scsi-disk",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "ide-hd",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "ide-cd",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "ide-drive",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-blk-pci",\
26ba25
+            .property = "discard_granularity",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-serial-pci",\
26ba25
+            .property = "vectors",\
26ba25
+            /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
26ba25
+            .value    = stringify(0xFFFFFFFF),\
26ba25
+        },{\
26ba25
+            .driver   = "486-" TYPE_X86_CPU,\
26ba25
+            .property = "model",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "usb-tablet",\
26ba25
+            .property = "usb_version",\
26ba25
+            .value    = stringify(1),\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-net-pci",\
26ba25
+            .property = "mq",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "VGA",\
26ba25
+            .property = "mmio",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-blk-pci",\
26ba25
+            .property = "config-wce",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = TYPE_ISA_FDC,\
26ba25
+            .property = "check_media_rate",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-balloon-pci",\
26ba25
+            .property = "class",\
26ba25
+            .value    = stringify(PCI_CLASS_MEMORY_RAM),\
26ba25
+        },{\
26ba25
+            .driver   = TYPE_PCI_DEVICE,\
26ba25
+            .property = "command_serr_enable",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "AC97",\
26ba25
+            .property = "use_broken_id",\
26ba25
+            .value    = stringify(1),\
26ba25
+        },{\
26ba25
+            .driver   = "intel-hda",\
26ba25
+            .property = "msi",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver = "qemu32-" TYPE_X86_CPU,\
26ba25
+            .property = "min-xlevel",\
26ba25
+            .value = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver = "486-" TYPE_X86_CPU,\
26ba25
+            .property = "min-level",\
26ba25
+            .value = stringify(0),\
26ba25
+        },{\
26ba25
+            .driver   = "qemu32-" TYPE_X86_CPU,\
26ba25
+            .property = "model",\
26ba25
+            .value    = stringify(3),\
26ba25
+        },{\
26ba25
+            .driver   = "usb-ccid",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "1",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-net-pci",\
26ba25
+            .property = "any_layout",\
26ba25
+            .value    = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "pentium" "-" TYPE_X86_CPU,\
26ba25
+            .property = "apic",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "pentium2" "-" TYPE_X86_CPU,\
26ba25
+            .property = "apic",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "pentium3" "-" TYPE_X86_CPU,\
26ba25
+            .property = "apic",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Conroe" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Penryn" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Nehalem" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pclmulqdq",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pclmulqdq",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "fxsr",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "fxsr",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "mmx",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "mmx",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pat",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pat",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "cmov",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "cmov",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pge",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pge",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "cx8",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "cx8",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "mce",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "mce",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pae",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pae",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "msr",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "msr",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "tsc",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "tsc",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pse",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "pse",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "de",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "de",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Westmere" "-" TYPE_X86_CPU,\
26ba25
+            .property = "fpu",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "fpu",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
26ba25
+            .property = "rdtscp",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "rdtscp",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Broadwell" "-" TYPE_X86_CPU,\
26ba25
+            .property = "smap",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_6_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "smap",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "rdtscp",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "on",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
26ba25
+            .property = "x2apic",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "3dnow",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "3dnowext",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "virtio-net-pci",\
26ba25
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
26ba25
+            .value = "on",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel660(MachineState *machine)
26ba25
+{
26ba25
+    PCMachineState *pcms = PC_MACHINE(machine);
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
26ba25
+
26ba25
+    pc_compat_rhel700(machine);
26ba25
+    if (!machine->cpu_type) {
26ba25
+        machine->cpu_type = "cpu64-rhel6";
26ba25
+    }
26ba25
+
26ba25
+    x86_cpu_change_kvm_default("kvm-pv-unhalt", NULL);
26ba25
+
26ba25
+    pcmc->gigabyte_align = false;
26ba25
+    shadow_bios_after_incoming = true;
26ba25
+    ich9_uhci123_irqpin_override = true;
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel660(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel660(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel660_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_machine_rhel700_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.6.0 PC";
26ba25
+    m->rom_file_has_mr = false;
26ba25
+    m->default_machine_opts = "firmware=bios.bin";
26ba25
+    pcmc->has_acpi_build = false;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_6_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel660, "rhel6.6.0", pc_init_rhel660,
26ba25
+                  pc_machine_rhel660_options);
26ba25
+
26ba25
+#define PC_RHEL6_5_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = TYPE_USB_DEVICE,\
26ba25
+            .property = "msos-desc",\
26ba25
+            .value    = "no",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel650(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel660(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel650(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel650(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel650_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel660_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.5.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_5_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel650, "rhel6.5.0", pc_init_rhel650,
26ba25
+                  pc_machine_rhel650_options);
26ba25
+
26ba25
+#define PC_RHEL6_4_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = "virtio-scsi-pci",\
26ba25
+            .property = "vectors",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "hda-micro",\
26ba25
+            .property = "mixer",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "hda-duplex",\
26ba25
+            .property = "mixer",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "hda-output",\
26ba25
+            .property = "mixer",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-net-pci",\
26ba25
+            .property = "ctrl_mac_addr",\
26ba25
+            .value    = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "sep",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "virtio-net-pci",\
26ba25
+            .property = "__com.redhat_rhel6_ctrl_guest_workaround", \
26ba25
+            .value = "off",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel640(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel650(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel640(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel640(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel640_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel650_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.4.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_4_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640,
26ba25
+                  pc_machine_rhel640_options);
26ba25
+
26ba25
+#define PC_RHEL6_3_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = "Conroe-" TYPE_X86_CPU,\
26ba25
+            .property = "min-level",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "Penryn-" TYPE_X86_CPU,\
26ba25
+            .property = "min-level",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
26ba25
+            .property = "min-level",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "e1000",\
26ba25
+            .property = "autonegotiation",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "qxl",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(3),\
26ba25
+        },{\
26ba25
+            .driver   = "qxl-vga",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(3),\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-scsi-pci",\
26ba25
+            .property = "hotplug",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-scsi-pci",\
26ba25
+            .property = "param_change",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "pmu",\
26ba25
+            .value = "on",\
26ba25
+        },{\
26ba25
+            .driver   = "usb-hub",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "314159",\
26ba25
+        },{\
26ba25
+            .driver   = "usb-storage",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "1",\
26ba25
+        },\
26ba25
+        {\
26ba25
+            .driver = "SandyBridge" "-" TYPE_X86_CPU,\
26ba25
+            .property = "tsc-deadline",\
26ba25
+            .value = "off",\
26ba25
+        },\
26ba25
+        { /* PC_RHEL6_3_COMPAT (copied from the entry above) */ \
26ba25
+            .driver = "SandyBridge-IBRS" "-" TYPE_X86_CPU,\
26ba25
+            .property = "tsc-deadline",\
26ba25
+            .value = "off",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel630(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel640(machine);
26ba25
+    x86_cpu_change_kvm_default("kvm-pv-eoi",NULL);
26ba25
+    enable_compat_apic_id_mode();
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel630(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel630(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel630_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel640_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.3.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_3_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel630, "rhel6.3.0", pc_init_rhel630,
26ba25
+                  pc_machine_rhel630_options);
26ba25
+
26ba25
+
26ba25
+#define PC_RHEL6_2_COMPAT \
26ba25
+        {\
26ba25
+            .driver = TYPE_X86_CPU,\
26ba25
+            .property = "pmu",\
26ba25
+            .value = "off",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel620(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel630(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel620(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel620(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel620_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel630_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.2.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_2_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel620, "rhel6.2.0", pc_init_rhel620,
26ba25
+                  pc_machine_rhel620_options);
26ba25
+
26ba25
+/*
26ba25
+ * NOTE: We don't have the event_idx compat entry for the
26ba25
+ * virtio-balloon-pci driver because RHEL6 doesn't disable
26ba25
+ * it either due to a bug (see RHBZ 1029539 fo more info)
26ba25
+ */
26ba25
+#define PC_RHEL6_1_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = "PIIX4_PM",\
26ba25
+            .property = "disable_s3",\
26ba25
+            .value    = "0",\
26ba25
+        },{\
26ba25
+            .driver   = "PIIX4_PM",\
26ba25
+            .property = "disable_s4",\
26ba25
+            .value    = "0",\
26ba25
+        },{\
26ba25
+            .driver   = "qxl",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "qxl-vga",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(2),\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-blk-pci",\
26ba25
+            .property = "event_idx",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-serial-pci",\
26ba25
+            .property = "event_idx",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "virtio-net-pci",\
26ba25
+            .property = "event_idx",\
26ba25
+            .value    = "off",\
26ba25
+        },{\
26ba25
+            .driver   = "usb-kbd",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "1",\
26ba25
+        },{\
26ba25
+            .driver   = "usb-mouse",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "1",\
26ba25
+        },{\
26ba25
+            .driver   = "usb-tablet",\
26ba25
+            .property = "serial",\
26ba25
+            .value    = "1",\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel610(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel620(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel610(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel610(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel610_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel620_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.1.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_1_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel610, "rhel6.1.0", pc_init_rhel610,
26ba25
+                  pc_machine_rhel610_options);
26ba25
+
26ba25
+#define PC_RHEL6_0_COMPAT \
26ba25
+        {\
26ba25
+            .driver   = "qxl",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(1),\
26ba25
+        },{\
26ba25
+            .driver   = "qxl-vga",\
26ba25
+            .property = "revision",\
26ba25
+            .value    = stringify(1),\
26ba25
+        },{\
26ba25
+            .driver   = "VGA",\
26ba25
+            .property = "rombar",\
26ba25
+            .value    = stringify(0),\
26ba25
+        },
26ba25
+
26ba25
+static void pc_compat_rhel600(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel610(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_init_rhel600(MachineState *machine)
26ba25
+{
26ba25
+    pc_compat_rhel600(machine);
26ba25
+    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
26ba25
+             TYPE_I440FX_PCI_DEVICE);}
26ba25
+
26ba25
+static void pc_machine_rhel600_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_machine_rhel610_options(m);
26ba25
+    m->family = "pc_piix_Z";
26ba25
+    m->desc = "RHEL 6.0.0 PC";
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL6_0_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(rhel600, "rhel6.0.0", pc_init_rhel600,
26ba25
+                  pc_machine_rhel600_options);
26ba25
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
26ba25
index 9ae9163..dbf6bfa 100644
26ba25
--- a/hw/i386/pc_q35.c
26ba25
+++ b/hw/i386/pc_q35.c
26ba25
@@ -143,8 +143,8 @@ static void pc_q35_init(MachineState *machine)
26ba25
 
26ba25
     if (pcmc->smbios_defaults) {
26ba25
         /* These values are guest ABI, do not change */
26ba25
-        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
26ba25
-                            mc->name, pcmc->smbios_legacy_mode,
26ba25
+        smbios_set_defaults("Red Hat", "KVM",
26ba25
+                            mc->desc, pcmc->smbios_legacy_mode,
26ba25
                             pcmc->smbios_uuid_encoded,
26ba25
                             SMBIOS_ENTRY_POINT_21);
26ba25
     }
26ba25
@@ -292,6 +292,7 @@ static void pc_q35_init(MachineState *machine)
26ba25
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
26ba25
 
26ba25
 
26ba25
+#if 0 /* Disabled for Red Hat Enterprise Linux */
26ba25
 static void pc_q35_machine_options(MachineClass *m)
26ba25
 {
26ba25
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
@@ -404,3 +405,72 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
26ba25
 
26ba25
 DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
26ba25
                    pc_q35_2_4_machine_options);
26ba25
+#endif  /* Disabled for Red Hat Enterprise Linux */
26ba25
+
26ba25
+/* Red Hat Enterprise Linux machine types */
26ba25
+
26ba25
+/* Options for the latest rhel7 q35 machine type */
26ba25
+static void pc_q35_machine_rhel7_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pcmc->default_nic_model = "e1000e";
26ba25
+    m->family = "pc_q35_Z";
26ba25
+    m->default_machine_opts = "firmware=bios-256k.bin";
26ba25
+    m->default_display = "std";
26ba25
+    m->no_floppy = 1;
26ba25
+    machine_class_allow_dynamic_sysbus_dev(m, TYPE_SYS_BUS_DEVICE);
26ba25
+    m->alias = "q35";
26ba25
+    m->max_cpus = 384;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
26ba25
+}
26ba25
+
26ba25
+static void pc_q35_init_rhel750(MachineState *machine)
26ba25
+{
26ba25
+    pc_q35_init(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_q35_machine_rhel750_options(MachineClass *m)
26ba25
+{
26ba25
+    pc_q35_machine_rhel7_options(m);
26ba25
+    m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)";
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
26ba25
+                  pc_q35_machine_rhel750_options);
26ba25
+
26ba25
+static void pc_q35_init_rhel740(MachineState *machine)
26ba25
+{
26ba25
+    pc_q35_init(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_q35_machine_rhel740_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_q35_machine_rhel750_options(m);
26ba25
+    m->alias = NULL;
26ba25
+    m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
26ba25
+    m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
26ba25
+    pcmc->pc_rom_ro = false;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
26ba25
+                  pc_q35_machine_rhel740_options);
26ba25
+
26ba25
+static void pc_q35_init_rhel730(MachineState *machine)
26ba25
+{
26ba25
+    pc_q35_init(machine);
26ba25
+}
26ba25
+
26ba25
+static void pc_q35_machine_rhel730_options(MachineClass *m)
26ba25
+{
26ba25
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
26ba25
+    pc_q35_machine_rhel740_options(m);
26ba25
+    m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)";
26ba25
+    m->max_cpus = 255;
26ba25
+    pcmc->linuxboot_dma_enabled = false;
26ba25
+    SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT);
26ba25
+}
26ba25
+
26ba25
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
26ba25
+                  pc_q35_machine_rhel730_options);
26ba25
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
26ba25
index 73ac783..2a6de35 100644
26ba25
--- a/hw/i386/pc_sysfw.c
26ba25
+++ b/hw/i386/pc_sysfw.c
26ba25
@@ -207,6 +207,13 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
26ba25
         (bios_size % 65536) != 0) {
26ba25
         goto bios_error;
26ba25
     }
26ba25
+    if (shadow_bios_after_incoming && bios_size != 128 * 1024) {
26ba25
+        MachineClass *mc;
26ba25
+
26ba25
+        mc = MACHINE_GET_CLASS(current_machine);
26ba25
+        error_report("machine %s only supports a 128KB BIOS image", mc->name);
26ba25
+        exit(1);
26ba25
+    }
26ba25
     bios = g_malloc(sizeof(*bios));
26ba25
     memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal);
26ba25
     if (!isapc_ram_fw) {
26ba25
@@ -254,6 +261,15 @@ void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
26ba25
         return;
26ba25
     }
26ba25
 
26ba25
+    if (shadow_bios_after_incoming) {
26ba25
+        MachineClass *mc;
26ba25
+
26ba25
+        mc = MACHINE_GET_CLASS(current_machine);
26ba25
+        error_report("flash-based firmware is not supported by machine %s",
26ba25
+                     mc->name);
26ba25
+        exit(1);
26ba25
+    }
26ba25
+
26ba25
     if (kvm_enabled() && !kvm_readonly_mem_enabled()) {
26ba25
         /* Older KVM cannot execute from device memory. So, flash memory
26ba25
          * cannot be used unless the readonly memory kvm capability is present. */
26ba25
diff --git a/hw/i386/shadow-bios.c b/hw/i386/shadow-bios.c
26ba25
new file mode 100644
26ba25
index 0000000..65a4cb8
26ba25
--- /dev/null
26ba25
+++ b/hw/i386/shadow-bios.c
26ba25
@@ -0,0 +1,64 @@
26ba25
+#include "qemu/osdep.h"
26ba25
+#include "sysemu/sysemu.h"
26ba25
+#include "target/i386/cpu.h"
26ba25
+#include "exec/ram_addr.h"
26ba25
+#include "qemu/cutils.h"
26ba25
+
26ba25
+void shadow_bios(void)
26ba25
+{
26ba25
+    RAMBlock *block, *ram, *oprom, *bios;
26ba25
+    size_t one_meg, oprom_size, bios_size;
26ba25
+    uint8_t *cd_seg_host, *ef_seg_host;
26ba25
+
26ba25
+    ram = NULL;
26ba25
+    oprom = NULL;
26ba25
+    bios = NULL;
26ba25
+    rcu_read_lock();
26ba25
+    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
26ba25
+        if (strcmp("pc.ram", block->idstr) == 0) {
26ba25
+            assert(ram == NULL);
26ba25
+            ram = block;
26ba25
+        } else if (strcmp("pc.rom", block->idstr) == 0) {
26ba25
+            assert(oprom == NULL);
26ba25
+            oprom = block;
26ba25
+        } else if (strcmp("pc.bios", block->idstr) == 0) {
26ba25
+            assert(bios == NULL);
26ba25
+            bios = block;
26ba25
+        }
26ba25
+    }
26ba25
+    assert(ram != NULL);
26ba25
+    assert(oprom != NULL);
26ba25
+    assert(bios != NULL);
26ba25
+    assert(memory_region_is_ram(ram->mr));
26ba25
+    assert(memory_region_is_ram(oprom->mr));
26ba25
+    assert(memory_region_is_ram(bios->mr));
26ba25
+    assert(int128_eq(ram->mr->size, int128_make64(ram->used_length)));
26ba25
+    assert(int128_eq(oprom->mr->size, int128_make64(oprom->used_length)));
26ba25
+    assert(int128_eq(bios->mr->size, int128_make64(bios->used_length)));
26ba25
+
26ba25
+    one_meg = 1024 * 1024;
26ba25
+    oprom_size = 128 * 1024;
26ba25
+    bios_size = 128 * 1024;
26ba25
+    assert(ram->used_length >= one_meg);
26ba25
+    assert(oprom->used_length == oprom_size);
26ba25
+    assert(bios->used_length == bios_size);
26ba25
+
26ba25
+    ef_seg_host = memory_region_get_ram_ptr(ram->mr) + (one_meg - bios_size);
26ba25
+    cd_seg_host = ef_seg_host - oprom_size;
26ba25
+
26ba25
+    /* This is a crude hack, but we must distinguish a rhel6.x.0 machtype guest
26ba25
+     * coming in from a RHEL-6 emulator (where shadowing has had no effect on
26ba25
+     * "pc.ram") from a similar guest coming in from a RHEL-7 emulator (where
26ba25
+     * shadowing has worked). In the latter case we must not trample the live
26ba25
+     * SeaBIOS variables in "pc.ram".
26ba25
+     */
26ba25
+    if (buffer_is_zero(ef_seg_host, bios_size)) {
26ba25
+        fprintf(stderr, "copying E and F segments from pc.bios to pc.ram\n");
26ba25
+        memcpy(ef_seg_host, memory_region_get_ram_ptr(bios->mr), bios_size);
26ba25
+    }
26ba25
+    if (buffer_is_zero(cd_seg_host, oprom_size)) {
26ba25
+        fprintf(stderr, "copying C and D segments from pc.rom to pc.ram\n");
26ba25
+        memcpy(cd_seg_host, memory_region_get_ram_ptr(oprom->mr), oprom_size);
26ba25
+    }
26ba25
+    rcu_read_unlock();
26ba25
+}
26ba25
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
26ba25
index 742cd0a..7d568da 100644
26ba25
--- a/hw/net/e1000.c
26ba25
+++ b/hw/net/e1000.c
26ba25
@@ -1663,6 +1663,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
26ba25
 
26ba25
     pci_conf = pci_dev->config;
26ba25
 
26ba25
+    if (!(d->compat_flags & E1000_FLAG_AUTONEG)) {
26ba25
+        /*
26ba25
+         * We have no capabilities, so capability list bit should normally be 0.
26ba25
+         * Keep it on for compat machine types to avoid breaking migration.
26ba25
+         * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for
26ba25
+         * the machine types that need this.
26ba25
+         */
26ba25
+        pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
26ba25
+    }
26ba25
+
26ba25
     /* TODO: RST# value should be 0, PCI spec 6.2.4 */
26ba25
     pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
26ba25
 
26ba25
@@ -1763,7 +1773,7 @@ static const TypeInfo e1000_base_info = {
26ba25
 
26ba25
 static const E1000Info e1000_devices[] = {
26ba25
     {
26ba25
-        .name      = "e1000",
26ba25
+        .name      = "e1000-82540em",
26ba25
         .device_id = E1000_DEV_ID_82540EM,
26ba25
         .revision  = 0x03,
26ba25
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
26ba25
@@ -1784,6 +1794,11 @@ static const E1000Info e1000_devices[] = {
26ba25
 #endif
26ba25
 };
26ba25
 
26ba25
+static const TypeInfo e1000_default_info = {
26ba25
+    .name          = "e1000",
26ba25
+    .parent        = "e1000-82540em",
26ba25
+};
26ba25
+
26ba25
 static void e1000_register_types(void)
26ba25
 {
26ba25
     int i;
26ba25
@@ -1801,6 +1816,7 @@ static void e1000_register_types(void)
26ba25
 
26ba25
         type_register(&type_info);
26ba25
     }
26ba25
+    type_register_static(&e1000_default_info);
26ba25
 }
26ba25
 
26ba25
 type_init(e1000_register_types)
26ba25
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
26ba25
index 16a9417..460123f 100644
26ba25
--- a/hw/net/e1000e.c
26ba25
+++ b/hw/net/e1000e.c
26ba25
@@ -74,6 +74,11 @@ typedef struct E1000EState {
26ba25
 
26ba25
     E1000ECore core;
26ba25
 
26ba25
+    /* 7.3 had the intr_state field that was in the original e1000e code
26ba25
+     * but that was removed prior to 2.7's release
26ba25
+     */
26ba25
+    bool redhat_7_3_intr_state_enable;
26ba25
+    uint32_t redhat_7_3_intr_state;
26ba25
 } E1000EState;
26ba25
 
26ba25
 #define E1000E_MMIO_IDX     0
26ba25
@@ -89,6 +94,10 @@ typedef struct E1000EState {
26ba25
 #define E1000E_MSIX_TABLE   (0x0000)
26ba25
 #define E1000E_MSIX_PBA     (0x2000)
26ba25
 
26ba25
+/* Values as in RHEL 7.3 build and original upstream */
26ba25
+#define RH_E1000E_USE_MSI     BIT(0)
26ba25
+#define RH_E1000E_USE_MSIX    BIT(1)
26ba25
+
26ba25
 static uint64_t
26ba25
 e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
26ba25
 {
26ba25
@@ -300,6 +309,8 @@ e1000e_init_msix(E1000EState *s)
26ba25
     } else {
26ba25
         if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
26ba25
             msix_uninit(d, &s->msix, &s->msix);
26ba25
+        } else {
26ba25
+            s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX;
26ba25
         }
26ba25
     }
26ba25
 }
26ba25
@@ -471,6 +482,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
26ba25
     ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
26ba25
     if (ret) {
26ba25
         trace_e1000e_msi_init_fail(ret);
26ba25
+    } else {
26ba25
+        s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI;
26ba25
     }
26ba25
 
26ba25
     if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
26ba25
@@ -594,6 +607,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
26ba25
     VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0,                           \
26ba25
                          e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
26ba25
 
26ba25
+static bool rhel_7_3_check(void *opaque, int version_id)
26ba25
+{
26ba25
+    return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable;
26ba25
+}
26ba25
+
26ba25
 static const VMStateDescription e1000e_vmstate = {
26ba25
     .name = "e1000e",
26ba25
     .version_id = 1,
26ba25
@@ -605,6 +623,7 @@ static const VMStateDescription e1000e_vmstate = {
26ba25
         VMSTATE_MSIX(parent_obj, E1000EState),
26ba25
 
26ba25
         VMSTATE_UINT32(ioaddr, E1000EState),
26ba25
+        VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check),
26ba25
         VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
26ba25
         VMSTATE_UINT8(core.rx_desc_len, E1000EState),
26ba25
         VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
26ba25
@@ -653,6 +672,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
26ba25
 
26ba25
 static Property e1000e_properties[] = {
26ba25
     DEFINE_NIC_PROPERTIES(E1000EState, conf),
26ba25
+    DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState,
26ba25
+                        redhat_7_3_intr_state_enable, false),
26ba25
     DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false,
26ba25
                         e1000e_prop_disable_vnet, bool),
26ba25
     DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
26ba25
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
26ba25
index 46daa16..05453e7 100644
26ba25
--- a/hw/net/rtl8139.c
26ba25
+++ b/hw/net/rtl8139.c
26ba25
@@ -3174,7 +3174,7 @@ static int rtl8139_pre_save(void *opaque)
26ba25
 
26ba25
 static const VMStateDescription vmstate_rtl8139 = {
26ba25
     .name = "rtl8139",
26ba25
-    .version_id = 5,
26ba25
+    .version_id = 4,
26ba25
     .minimum_version_id = 3,
26ba25
     .post_load = rtl8139_post_load,
26ba25
     .pre_save  = rtl8139_pre_save,
26ba25
@@ -3255,7 +3255,9 @@ static const VMStateDescription vmstate_rtl8139 = {
26ba25
         VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
26ba25
         VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
26ba25
         VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
26ba25
+#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */
26ba25
         VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5),
26ba25
+#endif
26ba25
         VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State),
26ba25
         VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
26ba25
 
26ba25
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
26ba25
index 6a92b20..c751111 100644
26ba25
--- a/hw/ppc/spapr.c
26ba25
+++ b/hw/ppc/spapr.c
26ba25
@@ -3935,6 +3935,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
26ba25
     smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN;
26ba25
     smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN;
26ba25
     spapr_caps_add_properties(smc, &error_abort);
26ba25
+    smc->has_power9_support = true;
26ba25
 }
26ba25
 
26ba25
 static const TypeInfo spapr_machine_info = {
26ba25
@@ -3985,6 +3986,7 @@ static const TypeInfo spapr_machine_info = {
26ba25
     }                                                                \
26ba25
     type_init(spapr_machine_register_##suffix)
26ba25
 
26ba25
+#if 0 /* Disabled for Red Hat Enterprise Linux */
26ba25
 /*
26ba25
  * pseries-2.12
26ba25
  */
26ba25
@@ -4136,6 +4138,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
26ba25
         .property = "pre-2.8-migration",            \
26ba25
         .value    = "on",                           \
26ba25
     },
26ba25
+#endif
26ba25
 
26ba25
 static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
26ba25
                               uint64_t *buid, hwaddr *pio,
26ba25
@@ -4186,6 +4189,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
26ba25
      */
26ba25
 }
26ba25
 
26ba25
+#if 0 /* Disabled for Red Hat Enterprise Linux */
26ba25
 static void spapr_machine_2_7_instance_options(MachineState *machine)
26ba25
 {
26ba25
     sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
26ba25
@@ -4345,6 +4349,210 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
26ba25
     SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
26ba25
 }
26ba25
 DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
26ba25
+#endif
26ba25
+
26ba25
+/*
26ba25
+ * pseries-rhel7.5.0
26ba25
+ */
26ba25
+
26ba25
+static void spapr_machine_rhel750_instance_options(MachineState *machine)
26ba25
+{
26ba25
+}
26ba25
+
26ba25
+static void spapr_machine_rhel750_class_options(MachineClass *mc)
26ba25
+{
26ba25
+    /* Defaults for the latest behaviour inherited from the base class */
26ba25
+}
26ba25
+
26ba25
+DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", true);
26ba25
+
26ba25
+/*
26ba25
+ * pseries-rhel7.5.0-sxxm
26ba25
+ *
26ba25
+ * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default
26ba25
+ */
26ba25
+static void spapr_machine_rhel750sxxm_instance_options(MachineState *machine)
26ba25
+{
26ba25
+    spapr_machine_rhel750_instance_options(machine);
26ba25
+}
26ba25
+
26ba25
+static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc)
26ba25
+{
26ba25
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
26ba25
+
26ba25
+    spapr_machine_rhel750_class_options(mc);
26ba25
+    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
26ba25
+    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
26ba25
+    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
26ba25
+}
26ba25
+
26ba25
+DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false);
26ba25
+
26ba25
+/*
26ba25
+ * pseries-rhel7.4.0
26ba25
+ * like SPAPR_COMPAT_2_9
26ba25
+ */
26ba25
+
26ba25
+#define SPAPR_COMPAT_RHEL7_4                                           \
26ba25
+    HW_COMPAT_RHEL7_4                                                  \
26ba25
+    {                                                                  \
26ba25
+        .driver = TYPE_POWERPC_CPU,                                    \
26ba25
+        .property = "pre-2.10-migration",                              \
26ba25
+        .value    = "on",                                              \
26ba25
+    },                                                                 \
26ba25
+
26ba25
+static void spapr_machine_rhel740_instance_options(MachineState *machine)
26ba25
+{
26ba25
+    spapr_machine_rhel750_instance_options(machine);
26ba25
+}
26ba25
+
26ba25
+static void spapr_machine_rhel740_class_options(MachineClass *mc)
26ba25
+{
26ba25
+    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
26ba25
+
26ba25
+    spapr_machine_rhel750_class_options(mc);
26ba25
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_4);
26ba25
+    mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
26ba25
+    smc->has_power9_support = false;
26ba25
+    smc->pre_2_10_has_unused_icps = true;
26ba25
+    smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
26ba25
+    smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
26ba25
+}
26ba25
+
26ba25
+DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false);
26ba25
+
26ba25
+/*
26ba25
+ * pseries-rhel7.4.0-sxxm
26ba25
+ *
26ba25
+ * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default
26ba25
+ */
26ba25
+static void spapr_machine_rhel740sxxm_instance_options(MachineState *machine)
26ba25
+{
26ba25
+    spapr_machine_rhel740_instance_options(machine);
26ba25
+}
26ba25
+
26ba25
+static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc)
26ba25