765 lines
26 KiB
Diff
765 lines
26 KiB
Diff
|
From e34179d713443601a16936e2e80b8fbd044429be Mon Sep 17 00:00:00 2001
|
||
|
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||
|
Date: Thu, 8 Nov 2018 11:59:55 +0100
|
||
|
Subject: Machine type related general changes
|
||
|
|
||
|
This patch is first part of original "Add RHEL machine types" patch we
|
||
|
split to allow easier review. It contains changes not related to any
|
||
|
architecture.
|
||
|
|
||
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||
|
---
|
||
|
hw/acpi/ich9.c | 16 +++
|
||
|
hw/acpi/piix4.c | 6 +-
|
||
|
hw/char/serial.c | 16 +++
|
||
|
hw/display/cirrus_vga.c | 2 +-
|
||
|
hw/display/vga-isa.c | 2 +-
|
||
|
hw/net/e1000.c | 18 ++-
|
||
|
hw/net/e1000e.c | 21 ++++
|
||
|
hw/net/rtl8139.c | 4 +-
|
||
|
hw/smbios/smbios.c | 1 +
|
||
|
hw/timer/i8254_common.c | 2 +-
|
||
|
hw/timer/mc146818rtc.c | 6 +
|
||
|
hw/usb/hcd-uhci.c | 4 +-
|
||
|
hw/usb/hcd-xhci.c | 20 ++++
|
||
|
hw/usb/hcd-xhci.h | 2 +
|
||
|
include/hw/acpi/ich9.h | 3 +
|
||
|
include/hw/compat.h | 229 ++++++++++++++++++++++++++++++++++++++
|
||
|
include/hw/usb.h | 4 +
|
||
|
migration/migration.c | 2 +
|
||
|
migration/migration.h | 5 +
|
||
|
qdev-monitor.c | 1 -
|
||
|
scripts/vmstate-static-checker.py | 1 -
|
||
|
21 files changed, 354 insertions(+), 11 deletions(-)
|
||
|
|
||
|
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
|
||
|
index a4e87b8..23a7baa 100644
|
||
|
--- a/hw/acpi/ich9.c
|
||
|
+++ b/hw/acpi/ich9.c
|
||
|
@@ -441,6 +441,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
|
||
|
s->pm.enable_tco = value;
|
||
|
}
|
||
|
|
||
|
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
|
||
|
+{
|
||
|
+ ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
|
||
|
+ return s->pm.force_rev1_fadt;
|
||
|
+}
|
||
|
+
|
||
|
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
|
||
|
+{
|
||
|
+ ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
|
||
|
+ s->pm.force_rev1_fadt = value;
|
||
|
+}
|
||
|
+
|
||
|
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
|
||
|
{
|
||
|
static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
|
||
|
@@ -465,6 +477,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
|
||
|
ich9_pm_get_cpu_hotplug_legacy,
|
||
|
ich9_pm_set_cpu_hotplug_legacy,
|
||
|
NULL);
|
||
|
+ object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
|
||
|
+ ich9_pm_get_force_rev1_fadt,
|
||
|
+ ich9_pm_set_force_rev1_fadt,
|
||
|
+ NULL);
|
||
|
object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
|
||
|
ich9_pm_get_disable_s3,
|
||
|
ich9_pm_set_disable_s3,
|
||
|
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
|
||
|
index 6404af5..0f1f9e2 100644
|
||
|
--- a/hw/acpi/piix4.c
|
||
|
+++ b/hw/acpi/piix4.c
|
||
|
@@ -310,7 +310,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
|
||
|
static const VMStateDescription vmstate_acpi = {
|
||
|
.name = "piix4_pm",
|
||
|
.version_id = 3,
|
||
|
- .minimum_version_id = 3,
|
||
|
+ .minimum_version_id = 2,
|
||
|
.minimum_version_id_old = 1,
|
||
|
.load_state_old = acpi_load_old,
|
||
|
.post_load = vmstate_acpi_post_load,
|
||
|
@@ -670,8 +670,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
|
||
|
|
||
|
static Property piix4_pm_properties[] = {
|
||
|
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
|
||
|
- DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
|
||
|
- DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
|
||
|
+ DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
|
||
|
+ DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
|
||
|
DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
|
||
|
DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
|
||
|
use_acpi_pci_hotplug, true),
|
||
|
diff --git a/hw/char/serial.c b/hw/char/serial.c
|
||
|
index 251f40f..8e3520c 100644
|
||
|
--- a/hw/char/serial.c
|
||
|
+++ b/hw/char/serial.c
|
||
|
@@ -30,6 +30,7 @@
|
||
|
#include "qemu/timer.h"
|
||
|
#include "qemu/error-report.h"
|
||
|
#include "trace.h"
|
||
|
+#include "migration/migration.h"
|
||
|
|
||
|
//#define DEBUG_SERIAL
|
||
|
|
||
|
@@ -699,6 +700,9 @@ static int serial_post_load(void *opaque, int version_id)
|
||
|
static bool serial_thr_ipending_needed(void *opaque)
|
||
|
{
|
||
|
SerialState *s = opaque;
|
||
|
+ if (migrate_pre_2_2) {
|
||
|
+ return false;
|
||
|
+ }
|
||
|
|
||
|
if (s->ier & UART_IER_THRI) {
|
||
|
bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
|
||
|
@@ -780,6 +784,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
|
||
|
static bool serial_fifo_timeout_timer_needed(void *opaque)
|
||
|
{
|
||
|
SerialState *s = (SerialState *)opaque;
|
||
|
+ if (migrate_pre_2_2) {
|
||
|
+ return false;
|
||
|
+ }
|
||
|
+
|
||
|
return timer_pending(s->fifo_timeout_timer);
|
||
|
}
|
||
|
|
||
|
@@ -797,6 +805,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
|
||
|
static bool serial_timeout_ipending_needed(void *opaque)
|
||
|
{
|
||
|
SerialState *s = (SerialState *)opaque;
|
||
|
+ if (migrate_pre_2_2) {
|
||
|
+ return false;
|
||
|
+ }
|
||
|
+
|
||
|
return s->timeout_ipending != 0;
|
||
|
}
|
||
|
|
||
|
@@ -814,6 +826,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
|
||
|
static bool serial_poll_needed(void *opaque)
|
||
|
{
|
||
|
SerialState *s = (SerialState *)opaque;
|
||
|
+ if (migrate_pre_2_2) {
|
||
|
+ return false;
|
||
|
+ }
|
||
|
+
|
||
|
return s->poll_msl >= 0;
|
||
|
}
|
||
|
|
||
|
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
|
||
|
index 9fd5665..6910014 100644
|
||
|
--- a/hw/display/cirrus_vga.c
|
||
|
+++ b/hw/display/cirrus_vga.c
|
||
|
@@ -3061,7 +3061,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
|
||
|
|
||
|
static Property isa_cirrus_vga_properties[] = {
|
||
|
DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState,
|
||
|
- cirrus_vga.vga.vram_size_mb, 4),
|
||
|
+ cirrus_vga.vga.vram_size_mb, 16),
|
||
|
DEFINE_PROP_BOOL("blitter", struct ISACirrusVGAState,
|
||
|
cirrus_vga.enable_blitter, true),
|
||
|
DEFINE_PROP_END_OF_LIST(),
|
||
|
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
|
||
|
index fa44242..7835c83 100644
|
||
|
--- a/hw/display/vga-isa.c
|
||
|
+++ b/hw/display/vga-isa.c
|
||
|
@@ -80,7 +80,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
|
||
|
}
|
||
|
|
||
|
static Property vga_isa_properties[] = {
|
||
|
- DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
|
||
|
+ DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16),
|
||
|
DEFINE_PROP_END_OF_LIST(),
|
||
|
};
|
||
|
|
||
|
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
|
||
|
index 742cd0a..7d568da 100644
|
||
|
--- a/hw/net/e1000.c
|
||
|
+++ b/hw/net/e1000.c
|
||
|
@@ -1663,6 +1663,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
|
||
|
|
||
|
pci_conf = pci_dev->config;
|
||
|
|
||
|
+ if (!(d->compat_flags & E1000_FLAG_AUTONEG)) {
|
||
|
+ /*
|
||
|
+ * We have no capabilities, so capability list bit should normally be 0.
|
||
|
+ * Keep it on for compat machine types to avoid breaking migration.
|
||
|
+ * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for
|
||
|
+ * the machine types that need this.
|
||
|
+ */
|
||
|
+ pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
|
||
|
+ }
|
||
|
+
|
||
|
/* TODO: RST# value should be 0, PCI spec 6.2.4 */
|
||
|
pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
|
||
|
|
||
|
@@ -1763,7 +1773,7 @@ static const TypeInfo e1000_base_info = {
|
||
|
|
||
|
static const E1000Info e1000_devices[] = {
|
||
|
{
|
||
|
- .name = "e1000",
|
||
|
+ .name = "e1000-82540em",
|
||
|
.device_id = E1000_DEV_ID_82540EM,
|
||
|
.revision = 0x03,
|
||
|
.phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT,
|
||
|
@@ -1784,6 +1794,11 @@ static const E1000Info e1000_devices[] = {
|
||
|
#endif
|
||
|
};
|
||
|
|
||
|
+static const TypeInfo e1000_default_info = {
|
||
|
+ .name = "e1000",
|
||
|
+ .parent = "e1000-82540em",
|
||
|
+};
|
||
|
+
|
||
|
static void e1000_register_types(void)
|
||
|
{
|
||
|
int i;
|
||
|
@@ -1801,6 +1816,7 @@ static void e1000_register_types(void)
|
||
|
|
||
|
type_register(&type_info);
|
||
|
}
|
||
|
+ type_register_static(&e1000_default_info);
|
||
|
}
|
||
|
|
||
|
type_init(e1000_register_types)
|
||
|
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
|
||
|
index 510ddb3..f1de9e5 100644
|
||
|
--- a/hw/net/e1000e.c
|
||
|
+++ b/hw/net/e1000e.c
|
||
|
@@ -75,6 +75,11 @@ typedef struct E1000EState {
|
||
|
|
||
|
E1000ECore core;
|
||
|
|
||
|
+ /* 7.3 had the intr_state field that was in the original e1000e code
|
||
|
+ * but that was removed prior to 2.7's release
|
||
|
+ */
|
||
|
+ bool redhat_7_3_intr_state_enable;
|
||
|
+ uint32_t redhat_7_3_intr_state;
|
||
|
} E1000EState;
|
||
|
|
||
|
#define E1000E_MMIO_IDX 0
|
||
|
@@ -90,6 +95,10 @@ typedef struct E1000EState {
|
||
|
#define E1000E_MSIX_TABLE (0x0000)
|
||
|
#define E1000E_MSIX_PBA (0x2000)
|
||
|
|
||
|
+/* Values as in RHEL 7.3 build and original upstream */
|
||
|
+#define RH_E1000E_USE_MSI BIT(0)
|
||
|
+#define RH_E1000E_USE_MSIX BIT(1)
|
||
|
+
|
||
|
static uint64_t
|
||
|
e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
|
||
|
{
|
||
|
@@ -301,6 +310,8 @@ e1000e_init_msix(E1000EState *s)
|
||
|
} else {
|
||
|
if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
|
||
|
msix_uninit(d, &s->msix, &s->msix);
|
||
|
+ } else {
|
||
|
+ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
@@ -472,6 +483,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
|
||
|
ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
|
||
|
if (ret) {
|
||
|
trace_e1000e_msi_init_fail(ret);
|
||
|
+ } else {
|
||
|
+ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI;
|
||
|
}
|
||
|
|
||
|
if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
|
||
|
@@ -595,6 +608,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
|
||
|
VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0, \
|
||
|
e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
|
||
|
|
||
|
+static bool rhel_7_3_check(void *opaque, int version_id)
|
||
|
+{
|
||
|
+ return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable;
|
||
|
+}
|
||
|
+
|
||
|
static const VMStateDescription e1000e_vmstate = {
|
||
|
.name = "e1000e",
|
||
|
.version_id = 1,
|
||
|
@@ -606,6 +624,7 @@ static const VMStateDescription e1000e_vmstate = {
|
||
|
VMSTATE_MSIX(parent_obj, E1000EState),
|
||
|
|
||
|
VMSTATE_UINT32(ioaddr, E1000EState),
|
||
|
+ VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check),
|
||
|
VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
|
||
|
VMSTATE_UINT8(core.rx_desc_len, E1000EState),
|
||
|
VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
|
||
|
@@ -654,6 +673,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
|
||
|
|
||
|
static Property e1000e_properties[] = {
|
||
|
DEFINE_NIC_PROPERTIES(E1000EState, conf),
|
||
|
+ DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState,
|
||
|
+ redhat_7_3_intr_state_enable, false),
|
||
|
DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false,
|
||
|
e1000e_prop_disable_vnet, bool),
|
||
|
DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
|
||
|
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
|
||
|
index 46daa16..05453e7 100644
|
||
|
--- a/hw/net/rtl8139.c
|
||
|
+++ b/hw/net/rtl8139.c
|
||
|
@@ -3174,7 +3174,7 @@ static int rtl8139_pre_save(void *opaque)
|
||
|
|
||
|
static const VMStateDescription vmstate_rtl8139 = {
|
||
|
.name = "rtl8139",
|
||
|
- .version_id = 5,
|
||
|
+ .version_id = 4,
|
||
|
.minimum_version_id = 3,
|
||
|
.post_load = rtl8139_post_load,
|
||
|
.pre_save = rtl8139_pre_save,
|
||
|
@@ -3255,7 +3255,9 @@ static const VMStateDescription vmstate_rtl8139 = {
|
||
|
VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
|
||
|
VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
|
||
|
VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
|
||
|
+#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */
|
||
|
VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5),
|
||
|
+#endif
|
||
|
VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State),
|
||
|
VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
|
||
|
|
||
|
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
|
||
|
index a27e54b..144e6e9 100644
|
||
|
--- a/hw/smbios/smbios.c
|
||
|
+++ b/hw/smbios/smbios.c
|
||
|
@@ -775,6 +775,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
|
||
|
SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer);
|
||
|
SMBIOS_SET_DEFAULT(type1.product, product);
|
||
|
SMBIOS_SET_DEFAULT(type1.version, version);
|
||
|
+ SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux");
|
||
|
SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer);
|
||
|
SMBIOS_SET_DEFAULT(type2.product, product);
|
||
|
SMBIOS_SET_DEFAULT(type2.version, version);
|
||
|
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
|
||
|
index 6190b6f..ad2ad2d 100644
|
||
|
--- a/hw/timer/i8254_common.c
|
||
|
+++ b/hw/timer/i8254_common.c
|
||
|
@@ -268,7 +268,7 @@ static const VMStateDescription vmstate_pit_common = {
|
||
|
.pre_save = pit_dispatch_pre_save,
|
||
|
.post_load = pit_dispatch_post_load,
|
||
|
.fields = (VMStateField[]) {
|
||
|
- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
|
||
|
+ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
|
||
|
VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
|
||
|
vmstate_pit_channel, PITChannelState),
|
||
|
VMSTATE_INT64(channels[0].next_transition_time,
|
||
|
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
|
||
|
index 6f1f723..68c353f 100644
|
||
|
--- a/hw/timer/mc146818rtc.c
|
||
|
+++ b/hw/timer/mc146818rtc.c
|
||
|
@@ -34,6 +34,7 @@
|
||
|
#include "qapi/qapi-commands-misc.h"
|
||
|
#include "qapi/qapi-events-misc.h"
|
||
|
#include "qapi/visitor.h"
|
||
|
+#include "migration/migration.h"
|
||
|
|
||
|
#ifdef TARGET_I386
|
||
|
#include "hw/i386/apic.h"
|
||
|
@@ -839,6 +840,11 @@ static int rtc_post_load(void *opaque, int version_id)
|
||
|
static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
|
||
|
{
|
||
|
RTCState *s = (RTCState *)opaque;
|
||
|
+
|
||
|
+ if (migrate_pre_2_2) {
|
||
|
+ return false;
|
||
|
+ }
|
||
|
+
|
||
|
return s->irq_reinject_on_ack_count != 0;
|
||
|
}
|
||
|
|
||
|
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
|
||
|
index 836b11f..9d7b9df 100644
|
||
|
--- a/hw/usb/hcd-uhci.c
|
||
|
+++ b/hw/usb/hcd-uhci.c
|
||
|
@@ -1214,12 +1214,14 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
|
||
|
UHCIState *s = UHCI(dev);
|
||
|
uint8_t *pci_conf = s->dev.config;
|
||
|
int i;
|
||
|
+ int irq_pin;
|
||
|
|
||
|
pci_conf[PCI_CLASS_PROG] = 0x00;
|
||
|
/* TODO: reset value should be 0. */
|
||
|
pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
|
||
|
|
||
|
- pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
|
||
|
+ irq_pin = u->info.irq_pin;
|
||
|
+ pci_config_set_interrupt_pin(pci_conf, irq_pin + 1);
|
||
|
|
||
|
if (s->masterbus) {
|
||
|
USBPort *ports[NB_PORTS];
|
||
|
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
||
|
index 8f1a01a..ca19474 100644
|
||
|
--- a/hw/usb/hcd-xhci.c
|
||
|
+++ b/hw/usb/hcd-xhci.c
|
||
|
@@ -3560,9 +3560,27 @@ static const VMStateDescription vmstate_xhci_slot = {
|
||
|
}
|
||
|
};
|
||
|
|
||
|
+static int xhci_event_pre_save(void *opaque)
|
||
|
+{
|
||
|
+ XHCIEvent *s = opaque;
|
||
|
+
|
||
|
+ s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
|
||
|
+ s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
|
||
|
+
|
||
|
+ return 0;
|
||
|
+}
|
||
|
+
|
||
|
+bool migrate_cve_2014_5263_xhci_fields;
|
||
|
+
|
||
|
+static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
|
||
|
+{
|
||
|
+ return migrate_cve_2014_5263_xhci_fields;
|
||
|
+}
|
||
|
+
|
||
|
static const VMStateDescription vmstate_xhci_event = {
|
||
|
.name = "xhci-event",
|
||
|
.version_id = 1,
|
||
|
+ .pre_save = xhci_event_pre_save,
|
||
|
.fields = (VMStateField[]) {
|
||
|
VMSTATE_UINT32(type, XHCIEvent),
|
||
|
VMSTATE_UINT32(ccode, XHCIEvent),
|
||
|
@@ -3571,6 +3589,8 @@ static const VMStateDescription vmstate_xhci_event = {
|
||
|
VMSTATE_UINT32(flags, XHCIEvent),
|
||
|
VMSTATE_UINT8(slotid, XHCIEvent),
|
||
|
VMSTATE_UINT8(epid, XHCIEvent),
|
||
|
+ VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
|
||
|
+ VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
|
||
|
VMSTATE_END_OF_LIST()
|
||
|
}
|
||
|
};
|
||
|
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
|
||
|
index fc36a4c..89d4cf7 100644
|
||
|
--- a/hw/usb/hcd-xhci.h
|
||
|
+++ b/hw/usb/hcd-xhci.h
|
||
|
@@ -153,6 +153,8 @@ typedef struct XHCIEvent {
|
||
|
uint32_t flags;
|
||
|
uint8_t slotid;
|
||
|
uint8_t epid;
|
||
|
+ uint8_t cve_2014_5263_a;
|
||
|
+ uint8_t cve_2014_5263_b;
|
||
|
} XHCIEvent;
|
||
|
|
||
|
typedef struct XHCIInterrupter {
|
||
|
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
|
||
|
index 59aeb06..7b5cc25 100644
|
||
|
--- a/include/hw/acpi/ich9.h
|
||
|
+++ b/include/hw/acpi/ich9.h
|
||
|
@@ -61,6 +61,9 @@ typedef struct ICH9LPCPMRegs {
|
||
|
uint8_t smm_enabled;
|
||
|
bool enable_tco;
|
||
|
TCOIORegs tco_regs;
|
||
|
+
|
||
|
+ /* RH addition, see bz 1489800 */
|
||
|
+ bool force_rev1_fadt;
|
||
|
} ICH9LPCPMRegs;
|
||
|
|
||
|
#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
|
||
|
diff --git a/include/hw/compat.h b/include/hw/compat.h
|
||
|
index c08f404..22262c7 100644
|
||
|
--- a/include/hw/compat.h
|
||
|
+++ b/include/hw/compat.h
|
||
|
@@ -282,4 +282,233 @@
|
||
|
.value = "on",\
|
||
|
},
|
||
|
|
||
|
+/* Mostly like HW_COMPAT_2_1 but:
|
||
|
+ * we don't need virtio-scsi-pci since 7.0 already had that on
|
||
|
+ *
|
||
|
+ * RH: Note, qemu-extended-regs should have been enabled in the 7.1
|
||
|
+ * machine type, but was accidentally turned off in 7.2 onwards.
|
||
|
+ *
|
||
|
+ */
|
||
|
+#define HW_COMPAT_RHEL7_1 \
|
||
|
+ { /* COMPAT_RHEL7.1 */ \
|
||
|
+ .driver = "intel-hda-generic",\
|
||
|
+ .property = "old_msi_addr",\
|
||
|
+ .value = "on",\
|
||
|
+ },{\
|
||
|
+ .driver = "VGA",\
|
||
|
+ .property = "qemu-extended-regs",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "secondary-vga",\
|
||
|
+ .property = "qemu-extended-regs",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "usb-mouse",\
|
||
|
+ .property = "usb_version",\
|
||
|
+ .value = stringify(1),\
|
||
|
+ },{\
|
||
|
+ .driver = "usb-kbd",\
|
||
|
+ .property = "usb_version",\
|
||
|
+ .value = stringify(1),\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "virtio-pci-bus-master-bug-migration",\
|
||
|
+ .value = "on",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-blk-pci",\
|
||
|
+ .property = "any_layout",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-balloon-pci",\
|
||
|
+ .property = "any_layout",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-serial-pci",\
|
||
|
+ .property = "any_layout",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-9p-pci",\
|
||
|
+ .property = "any_layout",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-rng-pci",\
|
||
|
+ .property = "any_layout",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ \
|
||
|
+ .driver = "migration",\
|
||
|
+ .property = "send-configuration",\
|
||
|
+ .value = "off",\
|
||
|
+ },
|
||
|
+
|
||
|
+/* Mostly like HW_COMPAT_2_4 + 2_3 but:
|
||
|
+ * we don't need "any_layout" as it has been backported to 7.2
|
||
|
+ */
|
||
|
+
|
||
|
+#define HW_COMPAT_RHEL7_2 \
|
||
|
+ {\
|
||
|
+ .driver = "virtio-blk-device",\
|
||
|
+ .property = "scsi",\
|
||
|
+ .value = "true",\
|
||
|
+ },{\
|
||
|
+ .driver = "e1000-82540em",\
|
||
|
+ .property = "extra_mac_registers",\
|
||
|
+ .value = "off",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "x-disable-pcie",\
|
||
|
+ .value = "on",\
|
||
|
+ },{\
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "migrate-extra",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "fw_cfg_mem",\
|
||
|
+ .property = "dma_enabled",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "fw_cfg_io",\
|
||
|
+ .property = "dma_enabled",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "isa-fdc",\
|
||
|
+ .property = "fallback",\
|
||
|
+ .value = "144",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "disable-modern",\
|
||
|
+ .value = "on",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "disable-legacy",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = TYPE_PCI_DEVICE,\
|
||
|
+ .property = "x-pcie-lnksta-dllla",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "page-per-vq",\
|
||
|
+ .value = "on",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
|
||
|
+ .driver = "migration",\
|
||
|
+ .property = "send-section-footer",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
|
||
|
+ .driver = "migration",\
|
||
|
+ .property = "store-global-state",\
|
||
|
+ .value = "off",\
|
||
|
+ },
|
||
|
+
|
||
|
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
|
||
|
+ * disable-modern, disable-legacy, page-per-vq have already been
|
||
|
+ * backported to RHEL7.3
|
||
|
+ */
|
||
|
+#define HW_COMPAT_RHEL7_3 \
|
||
|
+ { /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-mmio",\
|
||
|
+ .property = "format_transport_address",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-serial-device",\
|
||
|
+ .property = "emergency-write",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "ioapic",\
|
||
|
+ .property = "version",\
|
||
|
+ .value = "0x11",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "intel-iommu",\
|
||
|
+ .property = "x-buggy-eim",\
|
||
|
+ .value = "true",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "x-ignore-backend-features",\
|
||
|
+ .value = "on",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "fw_cfg_mem",\
|
||
|
+ .property = "x-file-slots",\
|
||
|
+ .value = stringify(0x10),\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "fw_cfg_io",\
|
||
|
+ .property = "x-file-slots",\
|
||
|
+ .value = stringify(0x10),\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "pflash_cfi01",\
|
||
|
+ .property = "old-multiple-chip-handling",\
|
||
|
+ .value = "on",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = TYPE_PCI_DEVICE,\
|
||
|
+ .property = "x-pcie-extcap-init",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "x-pcie-deverr-init",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "x-pcie-lnkctl-init",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-pci",\
|
||
|
+ .property = "x-pcie-pm-init",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "virtio-net-device",\
|
||
|
+ .property = "x-mtu-bypass-backend",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_3 */ \
|
||
|
+ .driver = "e1000e",\
|
||
|
+ .property = "__redhat_e1000e_7_3_intr_state",\
|
||
|
+ .value = "on",\
|
||
|
+ },
|
||
|
+
|
||
|
+/* Mostly like HW_COMPAT_2_9 except
|
||
|
+ * x-mtu-bypass-backend, x-migrate-msix has already been
|
||
|
+ * backported to RHEL7.4. shpc was already on in 7.4.
|
||
|
+ */
|
||
|
+#define HW_COMPAT_RHEL7_4 \
|
||
|
+ { /* HW_COMPAT_RHEL7_4 */ \
|
||
|
+ .driver = "intel-iommu",\
|
||
|
+ .property = "pt",\
|
||
|
+ .value = "off",\
|
||
|
+ },
|
||
|
+
|
||
|
+/* The same as HW_COMPAT_2_11 + HW_COMPAT_2_10 */
|
||
|
+#define HW_COMPAT_RHEL7_5 \
|
||
|
+ { /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
|
||
|
+ .driver = "hpet",\
|
||
|
+ .property = "hpet-offset-saved",\
|
||
|
+ .value = "false",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
|
||
|
+ .driver = "virtio-blk-pci",\
|
||
|
+ .property = "vectors",\
|
||
|
+ .value = "2",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
|
||
|
+ .driver = "vhost-user-blk-pci",\
|
||
|
+ .property = "vectors",\
|
||
|
+ .value = "2",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 but \
|
||
|
+ bz 1608778 modified for our naming */ \
|
||
|
+ .driver = "e1000-82540em",\
|
||
|
+ .property = "migrate_tso_props",\
|
||
|
+ .value = "off",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
|
||
|
+ .driver = "virtio-mouse-device",\
|
||
|
+ .property = "wheel-axis",\
|
||
|
+ .value = "false",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
|
||
|
+ .driver = "virtio-tablet-device",\
|
||
|
+ .property = "wheel-axis",\
|
||
|
+ .value = "false",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 */ \
|
||
|
+ .driver = "cirrus-vga",\
|
||
|
+ .property = "vgamem_mb",\
|
||
|
+ .value = "16",\
|
||
|
+ },{ /* HW_COMPAT_RHEL7_5 */ \
|
||
|
+ .driver = "migration",\
|
||
|
+ .property = "decompress-error-check",\
|
||
|
+ .value = "off",\
|
||
|
+ },
|
||
|
+
|
||
|
+
|
||
|
#endif /* HW_COMPAT_H */
|
||
|
diff --git a/include/hw/usb.h b/include/hw/usb.h
|
||
|
index a5080ad..b943ec9 100644
|
||
|
--- a/include/hw/usb.h
|
||
|
+++ b/include/hw/usb.h
|
||
|
@@ -606,4 +606,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
|
||
|
uint8_t interface_class, uint8_t interface_subclass,
|
||
|
uint8_t interface_protocol);
|
||
|
|
||
|
+
|
||
|
+/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
|
||
|
+extern bool migrate_cve_2014_5263_xhci_fields;
|
||
|
+
|
||
|
#endif
|
||
|
diff --git a/migration/migration.c b/migration/migration.c
|
||
|
index b7d9854..381039c 100644
|
||
|
--- a/migration/migration.c
|
||
|
+++ b/migration/migration.c
|
||
|
@@ -106,6 +106,8 @@ enum mig_rp_message_type {
|
||
|
MIG_RP_MSG_MAX
|
||
|
};
|
||
|
|
||
|
+bool migrate_pre_2_2;
|
||
|
+
|
||
|
/* When we add fault tolerance, we could have several
|
||
|
migrations at once. For now we don't need to add
|
||
|
dynamic creation of migration */
|
||
|
diff --git a/migration/migration.h b/migration/migration.h
|
||
|
index 64a7b33..405d984 100644
|
||
|
--- a/migration/migration.h
|
||
|
+++ b/migration/migration.h
|
||
|
@@ -288,6 +288,11 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
|
||
|
|
||
|
void dirty_bitmap_mig_before_vm_start(void);
|
||
|
void init_dirty_bitmap_incoming_migration(void);
|
||
|
+/*
|
||
|
+ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards
|
||
|
+ * migration compatibility.
|
||
|
+ */
|
||
|
+extern bool migrate_pre_2_2;
|
||
|
|
||
|
#define qemu_ram_foreach_block \
|
||
|
#warning "Use qemu_ram_foreach_block_migratable in migration code"
|
||
|
diff --git a/qdev-monitor.c b/qdev-monitor.c
|
||
|
index 61e0300..f439b83 100644
|
||
|
--- a/qdev-monitor.c
|
||
|
+++ b/qdev-monitor.c
|
||
|
@@ -47,7 +47,6 @@ typedef struct QDevAlias
|
||
|
|
||
|
/* Please keep this table sorted by typename. */
|
||
|
static const QDevAlias qdev_alias_table[] = {
|
||
|
- { "e1000", "e1000-82540em" },
|
||
|
{ "ich9-ahci", "ahci" },
|
||
|
{ "lsi53c895a", "lsi" },
|
||
|
{ "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
|
||
|
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
|
||
|
index d346728..4bca2bf 100755
|
||
|
--- a/scripts/vmstate-static-checker.py
|
||
|
+++ b/scripts/vmstate-static-checker.py
|
||
|
@@ -105,7 +105,6 @@ def get_changed_sec_name(sec):
|
||
|
# Section names can change -- see commit 292b1634 for an example.
|
||
|
changes = {
|
||
|
"ICH9 LPC": "ICH9-LPC",
|
||
|
- "e1000-82540em": "e1000",
|
||
|
}
|
||
|
|
||
|
for item in changes:
|
||
|
--
|
||
|
1.8.3.1
|
||
|
|