From e145f88a1d3be0e12262c0b3dab80133778ab21a Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Sun, 14 Dec 2014 18:32:18 +0100 Subject: Add RHEL machine types This commit adds all changes related to machine types applied since qemu-kvm-2.12.0-31.el8. Signed-off-by: Miroslav Rezanina Signed-off-by: Danilo C. L. de Paula -- Rebase notes (3.0.0): - spapr_cpu_init merged into spapr_realize_vcpu (upstream) - Commented out virt_machine_device_plug_cb in hw/arm/virt.c - ifdef virt_get_iommu and virt_set_iommu in hw/arm/virt.c - test changes refactored and moved all to this patch Merged patches (3.0.0): - 50dd601 s390x: add RHEL 7.6 machine type for ccw - 8198c8d e1000: Fix tso_props compat for 82540em - e924798 Use 4 MB vram for cirrus. - 738561e Fix x-hv-max-vps compat value for 7.4 machine type - 9cb37fd AArch64: Add virt-rhel7.6 machine type - 2343d56 migration: introduce decompress-error-check (partialy) - 188fa88 pc: rhel7.6.0 machine-types - 88b4505 Remove rhel6* machine types - 8a50b1c Remove rhel6_ctrl_guest_workaround - 71562f4 Remove SeaBIOS shadowing - 40a8867 Remove ich9_uhci123_irqpin_override - 7574808 redhat: define pseries-rhel7.6.0 machine types - 6c2f105 RHEL-8.0: Add pseries-rhel7.6.0-sxxm machine type - 411b30b pc: pc-*-rhel75.5.0 compat code Signed-off-by: Miroslav Rezanina Conflicts: tests/qom-test.c --- hw/acpi/ich9.c | 16 ++ hw/acpi/piix4.c | 6 +- hw/arm/virt.c | 126 ++++++++- hw/char/serial.c | 16 ++ hw/display/cirrus_vga.c | 2 +- hw/display/vga-isa.c | 2 +- hw/i386/acpi-build.c | 3 + hw/i386/pc.c | 7 +- hw/i386/pc_piix.c | 194 ++++++++++++- hw/i386/pc_q35.c | 93 ++++++- hw/net/e1000.c | 18 +- hw/net/e1000e.c | 21 ++ hw/net/rtl8139.c | 4 +- hw/ppc/spapr.c | 252 +++++++++++++++++ hw/ppc/spapr_cpu_core.c | 13 + hw/s390x/s390-virtio-ccw.c | 46 +++- 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/arm/virt.h | 22 ++ include/hw/compat.h | 229 ++++++++++++++++ include/hw/i386/pc.h | 564 ++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 1 + include/hw/usb.h | 4 + migration/migration.c | 2 + migration/migration.h | 5 + qdev-monitor.c | 1 - redhat/qemu-kvm.spec.template | 2 +- scripts/vmstate-static-checker.py | 1 - target/i386/cpu.c | 9 +- target/i386/machine.c | 21 ++ target/ppc/compat.c | 13 +- target/ppc/cpu.h | 1 + tests/Makefile.include | 124 ++++----- tests/boot-serial-test.c | 6 +- tests/cpu-plug-test.c | 3 +- tests/e1000-test.c | 2 + tests/endianness-test.c | 2 + tests/prom-env-test.c | 2 + tests/qemu-iotests/051 | 12 +- tests/qemu-iotests/group | 4 +- tests/qom-test.c | 2 +- tests/test-x86-cpuid-compat.c | 2 + tests/usb-hcd-xhci-test.c | 4 + 48 files changed, 1800 insertions(+), 95 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/arm/virt.c b/hw/arm/virt.c index 281ddcd..b02e4a0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -60,6 +60,7 @@ #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" +#if 0 /* disabled Red Hat Enterprise Linux */ #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ void *data) \ @@ -87,7 +88,36 @@ DEFINE_VIRT_MACHINE_LATEST(major, minor, true) #define DEFINE_VIRT_MACHINE(major, minor) \ DEFINE_VIRT_MACHINE_LATEST(major, minor, false) - +#endif /* disabled for RHEL */ + +#define DEFINE_RHEL_MACHINE_LATEST(m, n, s, latest) \ + static void rhel##m##n##s##_virt_class_init(ObjectClass *oc, \ + void *data) \ + { \ + MachineClass *mc = MACHINE_CLASS(oc); \ + rhel##m##n##s##_virt_options(mc); \ + mc->desc = "RHEL " # m "." # n "." # s " ARM Virtual Machine"; \ + if (latest) { \ + mc->alias = "virt"; \ + mc->is_default = 1; \ + } \ + } \ + static const TypeInfo rhel##m##n##s##_machvirt_info = { \ + .name = MACHINE_TYPE_NAME("virt-rhel" # m "." # n "." # s), \ + .parent = TYPE_RHEL_MACHINE, \ + .instance_init = rhel##m##n##s##_virt_instance_init, \ + .class_init = rhel##m##n##s##_virt_class_init, \ + }; \ + static void rhel##m##n##s##_machvirt_init(void) \ + { \ + type_register_static(&rhel##m##n##s##_machvirt_info); \ + } \ + type_init(rhel##m##n##s##_machvirt_init); + +#define DEFINE_RHEL_MACHINE_AS_LATEST(major, minor, subminor) \ + DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true) +#define DEFINE_RHEL_MACHINE(major, minor, subminor) \ + DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false) /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 256 @@ -1539,6 +1569,7 @@ static void machvirt_init(MachineState *machine) qemu_add_machine_init_done_notifier(&vms->machine_done); } +#if 0 /* disabled for RHEL */ static bool virt_get_secure(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -1567,6 +1598,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp) vms->virt = value; } +#endif /* disabled for RHEL */ static bool virt_get_highmem(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -1621,6 +1653,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp) } } +#if 0 static char *virt_get_iommu(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -1648,6 +1681,7 @@ static void virt_set_iommu(Object *obj, const char *value, Error **errp) error_append_hint(errp, "Valid values are none, smmuv3.\n"); } } +#endif static CpuInstanceProperties virt_cpu_index_to_props(MachineState *ms, unsigned cpu_index) @@ -1687,6 +1721,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms) return ms->possible_cpus; } +#if 0 /* disabled for RHEL */ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { @@ -1835,6 +1870,9 @@ static void virt_machine_3_0_options(MachineClass *mc) } DEFINE_VIRT_MACHINE_AS_LATEST(3, 0) +#define VIRT_COMPAT_2_12 \ + HW_COMPAT_2_12 + static void virt_2_12_instance_init(Object *obj) { virt_3_0_instance_init(obj); @@ -1960,3 +1998,89 @@ static void virt_machine_2_6_options(MachineClass *mc) vmc->no_pmu = true; } DEFINE_VIRT_MACHINE(2, 6) +#endif /* disabled for RHEL */ + +static void rhel_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->family = "virt-rhel-Z"; + mc->init = machvirt_init; + /* Start max_cpus at the maximum QEMU supports. We'll further restrict + * it later in machvirt_init, where we have more information about the + * configuration of the particular instance. + */ + mc->max_cpus = 255; + mc->block_default_type = IF_VIRTIO; + mc->no_cdrom = 1; + mc->pci_allow_0_address = true; + /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */ + mc->minimum_page_bits = 12; + mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids; + mc->cpu_index_to_instance_props = virt_cpu_index_to_props; + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57"); + mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; +} + +static const TypeInfo rhel_machine_info = { + .name = TYPE_RHEL_MACHINE, + .parent = TYPE_MACHINE, + .abstract = true, + .instance_size = sizeof(VirtMachineState), + .class_size = sizeof(VirtMachineClass), + .class_init = rhel_machine_class_init, +}; + +static void rhel_machine_init(void) +{ + type_register_static(&rhel_machine_info); +} +type_init(rhel_machine_init); + +static void rhel760_virt_instance_init(Object *obj) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); + + /* EL3 is disabled by default and non-configurable for RHEL */ + vms->secure = false; + /* EL2 is disabled by default and non-configurable for RHEL */ + vms->virt = false; + /* High memory is enabled by default for RHEL */ + vms->highmem = true; + object_property_add_bool(obj, "highmem", virt_get_highmem, + virt_set_highmem, NULL); + object_property_set_description(obj, "highmem", + "Set on/off to enable/disable using " + "physical address space above 32 bits", + NULL); + /* Default GIC type is still v2, but became configurable for RHEL */ + vms->gic_version = 2; + object_property_add_str(obj, "gic-version", virt_get_gic_version, + virt_set_gic_version, NULL); + object_property_set_description(obj, "gic-version", + "Set GIC version. " + "Valid values are 2, 3 and host", NULL); + + if (vmc->no_its) { + vms->its = false; + } else { + /* Default allows ITS instantiation */ + vms->its = true; + object_property_add_bool(obj, "its", virt_get_its, + virt_set_its, NULL); + object_property_set_description(obj, "its", + "Set on/off to enable/disable " + "ITS instantiation", + NULL); + } + + vms->memmap=a15memmap; + vms->irqmap=a15irqmap; +} + +static void rhel760_virt_options(MachineClass *mc) +{ + SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT); +} +DEFINE_RHEL_MACHINE_AS_LATEST(7, 6, 0) 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/i386/acpi-build.c b/hw/i386/acpi-build.c index e1ee8ae..be9bdb5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -184,6 +184,9 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) pm->fadt.reset_reg = r; pm->fadt.reset_val = 0xf; pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; + if (object_property_get_bool(lpc, + "__com.redhat_force-rev1-fadt", NULL)) + pm->fadt.rev = 1; pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; } assert(obj); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 11c287e..253d48d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1419,7 +1419,8 @@ void pc_memory_init(PCMachineState *pcms, option_rom_mr = g_malloc(sizeof(*option_rom_mr)); memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE, &error_fatal); - if (pcmc->pci_enabled) { + /* RH difference: See bz 1489800, explicitly make ROM ro */ + if (pcmc->pc_rom_ro) { memory_region_set_readonly(option_rom_mr, true); } memory_region_add_subregion_overlap(rom_memory, @@ -2387,6 +2388,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->save_tsc_khz = true; pcmc->linuxboot_dma_enabled = true; assert(!mc->get_hotplug_handler); + pcmc->pc_rom_ro = true; mc->get_hotplug_handler = pc_get_hotpug_handler; mc->cpu_index_to_instance_props = pc_cpu_index_to_props; mc->get_default_cpu_node_id = pc_get_default_cpu_node_id; @@ -2396,7 +2398,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) mc->default_boot_order = "cad"; mc->hot_add_cpu = pc_hot_add_cpu; mc->block_default_type = IF_IDE; - mc->max_cpus = 255; + /* 240: max CPU count for RHEL */ + mc->max_cpus = 240; mc->reset = pc_machine_reset; hc->pre_plug = pc_machine_device_pre_plug_cb; hc->plug = pc_machine_device_plug_cb; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index dc09466..f0484ec 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -50,6 +50,7 @@ #include "cpu.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "migration/migration.h" #ifdef CONFIG_XEN #include #include "hw/xen/xen_pt.h" @@ -170,8 +171,8 @@ static void pc_init1(MachineState *machine, if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", - mc->name, pcmc->smbios_legacy_mode, + smbios_set_defaults("Red Hat", "KVM", + mc->desc, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, SMBIOS_ENTRY_POINT_21); } @@ -309,6 +310,7 @@ static void pc_init1(MachineState *machine, * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options(). */ +#if 0 /* Disabled for Red Hat Enterprise Linux */ static void pc_compat_2_3(MachineState *machine) { PCMachineState *pcms = PC_MACHINE(machine); @@ -433,6 +435,7 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m) pc_i440fx_machine_options(m); m->alias = "pc"; m->is_default = 1; + SET_MACHINE_COMPAT(m, PC_COMPAT_2_12); } DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL, @@ -1148,3 +1151,190 @@ static void xenfv_machine_options(MachineClass *m) DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init, xenfv_machine_options); #endif +machine_init(pc_machine_init); + +#endif /* Disabled for Red Hat Enterprise Linux */ + +/* Red Hat Enterprise Linux machine types */ + +/* Options for the latest rhel7 machine type */ +static void pc_machine_rhel7_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + m->family = "pc_piix_Y"; + m->default_machine_opts = "firmware=bios-256k.bin"; + pcmc->default_nic_model = "e1000"; + m->default_display = "std"; + SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); + m->alias = "pc"; + m->is_default = 1; +} + +static void pc_init_rhel760(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel760_options(MachineClass *m) +{ + pc_machine_rhel7_options(m); + m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)"; +} + +DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760, + pc_machine_rhel760_options); + +static void pc_init_rhel750(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel750_options(MachineClass *m) +{ + pc_machine_rhel760_options(m); + m->alias = NULL; + m->is_default = 0; + m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)"; + m->auto_enable_numa_with_memhp = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_5_COMPAT); +} + +DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750, + pc_machine_rhel750_options); + +static void pc_init_rhel740(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel740_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_machine_rhel750_options(m); + m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)"; + m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; + pcmc->pc_rom_ro = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT); +} + +DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740, + pc_machine_rhel740_options); + +static void pc_init_rhel730(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel730_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_machine_rhel740_options(m); + m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)"; + pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); +} + +DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730, + pc_machine_rhel730_options); + + +static void pc_init_rhel720(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel720_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_machine_rhel730_options(m); + m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)"; + /* From pc_i440fx_2_5_machine_options */ + pcmc->save_tsc_khz = false; + m->legacy_fw_cfg_order = 1; + /* Note: broken_reserved_end was already in 7.2 */ + /* From pc_i440fx_2_6_machine_options */ + pcmc->legacy_cpu_hotplug = true; + SET_MACHINE_COMPAT(m, PC_RHEL7_2_COMPAT); +} + +DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720, + pc_machine_rhel720_options); + +static void pc_compat_rhel710(MachineState *machine) +{ + PCMachineState *pcms = PC_MACHINE(machine); + PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); + + /* From pc_compat_2_2 */ + pcmc->rsdp_in_ram = false; + machine->suppress_vmdesc = true; + + /* From pc_compat_2_1 */ + pcmc->smbios_uuid_encoded = false; + x86_cpu_change_kvm_default("svm", NULL); + pcmc->enforce_aligned_dimm = false; + + /* Disable all the extra subsections that were added in 2.2 */ + migrate_pre_2_2 = true; + + /* From pc_i440fx_2_4_machine_options */ + pcmc->broken_reserved_end = true; +} + +static void pc_init_rhel710(MachineState *machine) +{ + pc_compat_rhel710(machine); + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel710_options(MachineClass *m) +{ + pc_machine_rhel720_options(m); + m->family = "pc_piix_Y"; + m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)"; + m->default_display = "cirrus"; + SET_MACHINE_COMPAT(m, PC_RHEL7_1_COMPAT); +} + +DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710, + pc_machine_rhel710_options); + +static void pc_compat_rhel700(MachineState *machine) +{ + PCMachineState *pcms = PC_MACHINE(machine); + PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); + + pc_compat_rhel710(machine); + + /* Upstream enables it for everyone, we're a little more selective */ + x86_cpu_change_kvm_default("x2apic", NULL); + x86_cpu_change_kvm_default("svm", NULL); + pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ + pcmc->smbios_legacy_mode = true; + pcmc->has_reserved_memory = false; + migrate_cve_2014_5263_xhci_fields = true; +} + +static void pc_init_rhel700(MachineState *machine) +{ + pc_compat_rhel700(machine); + pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + TYPE_I440FX_PCI_DEVICE); +} + +static void pc_machine_rhel700_options(MachineClass *m) +{ + pc_machine_rhel710_options(m); + m->family = "pc_piix_Y"; + m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)"; + SET_MACHINE_COMPAT(m, PC_RHEL7_0_COMPAT); +} + +DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700, + pc_machine_rhel700_options); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 532241e..c1024c5 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -145,8 +145,8 @@ static void pc_q35_init(MachineState *machine) if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", - mc->name, pcmc->smbios_legacy_mode, + smbios_set_defaults("Red Hat", "KVM", + mc->desc, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, SMBIOS_ENTRY_POINT_21); } @@ -294,6 +294,7 @@ static void pc_q35_init(MachineState *machine) DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) +#if 0 /* Disabled for Red Hat Enterprise Linux */ static void pc_q35_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); @@ -315,6 +316,7 @@ static void pc_q35_3_0_machine_options(MachineClass *m) { pc_q35_machine_options(m); m->alias = "q35"; + SET_MACHINE_COMPAT(m, PC_COMPAT_2_12); } DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL, @@ -416,3 +418,90 @@ static void pc_q35_2_4_machine_options(MachineClass *m) DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, pc_q35_2_4_machine_options); +#endif /* Disabled for Red Hat Enterprise Linux */ + +/* Red Hat Enterprise Linux machine types */ + +/* Options for the latest rhel7 q35 machine type */ +static void pc_q35_machine_rhel7_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pcmc->default_nic_model = "e1000e"; + m->family = "pc_q35_Z"; + m->default_machine_opts = "firmware=bios-256k.bin"; + m->default_display = "std"; + m->no_floppy = 1; + machine_class_allow_dynamic_sysbus_dev(m, TYPE_SYS_BUS_DEVICE); + m->alias = "q35"; + m->max_cpus = 384; + SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); +} + +static void pc_q35_init_rhel760(MachineState *machine) +{ + pc_q35_init(machine); +} + +static void pc_q35_machine_rhel760_options(MachineClass *m) +{ + pc_q35_machine_rhel7_options(m); + m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)"; +} + +DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760, + pc_q35_machine_rhel760_options); + +static void pc_q35_init_rhel750(MachineState *machine) +{ + pc_q35_init(machine); +} + +static void pc_q35_machine_rhel750_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_rhel760_options(m); + m->alias = NULL; + m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)"; + m->auto_enable_numa_with_memhp = false; + pcmc->default_nic_model = "e1000"; + SET_MACHINE_COMPAT(m, PC_RHEL7_5_COMPAT); +} + +DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750, + pc_q35_machine_rhel750_options); + +static void pc_q35_init_rhel740(MachineState *machine) +{ + pc_q35_init(machine); +} + +static void pc_q35_machine_rhel740_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_rhel750_options(m); + m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)"; + m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; + pcmc->pc_rom_ro = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_4_COMPAT); +} + +DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740, + pc_q35_machine_rhel740_options); + +static void pc_q35_init_rhel730(MachineState *machine) +{ + pc_q35_init(machine); +} + +static void pc_q35_machine_rhel730_options(MachineClass *m) +{ + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_rhel740_options(m); + m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; + m->max_cpus = 255; + pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); +} + +DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730, + pc_q35_machine_rhel730_options); 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/ppc/spapr.c b/hw/ppc/spapr.c index 2f8c304..b8bdb69 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4009,6 +4009,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN; smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 16; /* 64kiB */ spapr_caps_add_properties(smc, &error_abort); + smc->has_power9_support = true; } static const TypeInfo spapr_machine_info = { @@ -4059,6 +4060,7 @@ static const TypeInfo spapr_machine_info = { } \ type_init(spapr_machine_register_##suffix) +#if 0 /* Disabled for Red Hat Enterprise Linux */ /* * pseries-3.0 */ @@ -4248,6 +4250,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false); .property = "pre-2.8-migration", \ .value = "on", \ }, +#endif static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, uint64_t *buid, hwaddr *pio, @@ -4298,6 +4301,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, */ } +#if 0 /* Disabled for Red Hat Enterprise Linux */ static void spapr_machine_2_7_instance_options(MachineState *machine) { sPAPRMachineState *spapr = SPAPR_MACHINE(machine); @@ -4457,6 +4461,254 @@ static void spapr_machine_2_1_class_options(MachineClass *mc) SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1); } DEFINE_SPAPR_MACHINE(2_1, "2.1", false); +#endif + +/* + * pseries-rhel7.6.0 + */ + +static void spapr_machine_rhel760_instance_options(MachineState *machine) +{ +} + +static void spapr_machine_rhel760_class_options(MachineClass *mc) +{ + /* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", true); + +/* + * pseries-rhel7.6.0-sxxm + * + * pseries-rhel7.6.0 with speculative execution exploit mitigations enabled by default + */ +static void spapr_machine_rhel760sxxm_instance_options(MachineState *machine) +{ + spapr_machine_rhel760_instance_options(machine); +} + +static void spapr_machine_rhel760sxxm_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel760_class_options(mc); + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD; +} + +DEFINE_SPAPR_MACHINE(rhel760sxxm, "rhel7.6.0-sxxm", false); + +/* + * pseries-rhel7.5.0 + * like SPAPR_COMPAT_2_11 and SPAPR_COMPAT_2_10 + * SPAPR_CAP_HTM already enabled in 7.4 + * + */ +#define SPAPR_COMPAT_RHEL7_5 \ + HW_COMPAT_RHEL7_5 \ + +static void spapr_machine_rhel750_instance_options(MachineState *machine) +{ + spapr_machine_rhel760_instance_options(machine); +} + +static void spapr_machine_rhel750_class_options(MachineClass *mc) +{ + spapr_machine_rhel760_class_options(mc); + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_5); +} + +DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", false); + +/* + * pseries-rhel7.5.0-sxxm + * + * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default + */ +static void spapr_machine_rhel750sxxm_instance_options(MachineState *machine) +{ + spapr_machine_rhel750_instance_options(machine); +} + +static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel750_class_options(mc); + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD; +} + +DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false); + +/* + * pseries-rhel7.4.0 + * like SPAPR_COMPAT_2_9 + */ + +#define SPAPR_COMPAT_RHEL7_4 \ + HW_COMPAT_RHEL7_4 \ + { \ + .driver = TYPE_POWERPC_CPU, \ + .property = "pre-2.10-migration", \ + .value = "on", \ + }, \ + +static void spapr_machine_rhel740_instance_options(MachineState *machine) +{ + spapr_machine_rhel750_instance_options(machine); +} + +static void spapr_machine_rhel740_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel750_class_options(mc); + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_4); + mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram; + smc->has_power9_support = false; + smc->pre_2_10_has_unused_icps = true; + smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED; + smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; +} + +DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false); + +/* + * pseries-rhel7.4.0-sxxm + * + * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default + */ +static void spapr_machine_rhel740sxxm_instance_options(MachineState *machine) +{ + spapr_machine_rhel740_instance_options(machine); +} + +static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel740_class_options(mc); + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD; +} + +DEFINE_SPAPR_MACHINE(rhel740sxxm, "rhel7.4.0-sxxm", false); + +/* + * pseries-rhel7.3.0 + * like SPAPR_COMPAT_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3 + */ +#define SPAPR_COMPAT_RHEL7_3 \ + HW_COMPAT_RHEL7_3 \ + { \ + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ + .property = "mem_win_size", \ + .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\ + }, \ + { \ + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ + .property = "mem64_win_size", \ + .value = "0", \ + }, \ + { \ + .driver = TYPE_POWERPC_CPU, \ + .property = "pre-2.8-migration", \ + .value = "on", \ + }, \ + { \ + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ + .property = "pre-2.8-migration", \ + .value = "on", \ + }, \ + { \ + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ + .property = "pcie-extended-configuration-space",\ + .value = "off", \ + }, + +static void spapr_machine_rhel730_instance_options(MachineState *machine) +{ + sPAPRMachineState *spapr = SPAPR_MACHINE(machine); + + spapr_machine_rhel740_instance_options(machine); + spapr->use_hotplug_event_source = false; +} + +static void spapr_machine_rhel730_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel740_class_options(mc); + mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_3); + smc->phb_placement = phb_placement_2_7; +} + +DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false); + +/* + * pseries-rhel7.3.0-sxxm + * + * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default + */ +static void spapr_machine_rhel730sxxm_instance_options(MachineState *machine) +{ + spapr_machine_rhel730_instance_options(machine); +} + +static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel730_class_options(mc); + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD; +} + +DEFINE_SPAPR_MACHINE(rhel730sxxm, "rhel7.3.0-sxxm", false); + +/* + * pseries-rhel7.2.0 + */ +/* Should be like SPAPR_COMPAT_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration" + * has been backported to RHEL7_2 so we don't need it here. + */ + +#define SPAPR_COMPAT_RHEL7_2 \ + HW_COMPAT_RHEL7_2 \ + { \ + .driver = "spapr-vlan", \ + .property = "use-rx-buffer-pools", \ + .value = "off", \ + },{ \ + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ + .property = "ddw",\ + .value = stringify(off),\ + }, + + +static void spapr_machine_rhel720_instance_options(MachineState *machine) +{ + spapr_machine_rhel730_instance_options(machine); +} + +static void spapr_machine_rhel720_class_options(MachineClass *mc) +{ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + spapr_machine_rhel730_class_options(mc); + smc->use_ohci_by_default = true; + mc->has_hotpluggable_cpus = NULL; + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_2); +} + +DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false); static void spapr_machine_register_types(void) { diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index fb29eec..a081b01 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -21,6 +21,7 @@ #include "sysemu/numa.h" #include "sysemu/hw_accel.h" #include "qemu/error-report.h" +#include "cpu-models.h" static void spapr_cpu_reset(void *opaque) { @@ -212,6 +213,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, sPAPRMachineState *spapr, { CPUPPCState *env = &cpu->env; Error *local_err = NULL; + sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); object_property_set_bool(OBJECT(cpu), true, "realized", &local_err); if (local_err) { @@ -224,6 +226,17 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, sPAPRMachineState *spapr, cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr)); kvmppc_set_papr(cpu); + if (!smc->has_power9_support && + (((spapr->max_compat_pvr && + ppc_compat_cmp(spapr->max_compat_pvr, + CPU_POWERPC_LOGICAL_3_00) >= 0)) || + (!spapr->max_compat_pvr && + ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, 0)))) { + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "POWER9 CPU is not supported by this machine class"); + return; + } + qemu_register_reset(spapr_cpu_reset, cpu); spapr_cpu_reset(cpu); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 7983185..0f135c9 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -649,7 +649,7 @@ bool css_migration_enabled(void) { \ MachineClass *mc = MACHINE_CLASS(oc); \ ccw_machine_##suffix##_class_options(mc); \ - mc->desc = "VirtIO-ccw based S390 machine v" verstr; \ + mc->desc = "VirtIO-ccw based S390 machine " verstr; \ if (latest) { \ mc->alias = "s390-ccw-virtio"; \ mc->is_default = 1; \ @@ -676,6 +676,8 @@ bool css_migration_enabled(void) #define CCW_COMPAT_2_12 \ HW_COMPAT_2_12 +#if 0 /* Disabled for Red Hat Enterprise Linux */ + #define CCW_COMPAT_2_11 \ HW_COMPAT_2_11 \ {\ @@ -898,6 +900,48 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(2_4, "2.4", false); +#else + +/* + * like CCW_COMPAT_2_11, but includes HW_COMPAT_RHEL7_5 (derived from + * HW_COMPAT_2_11 and HW_COMPAT_2_10) instead of HW_COMPAT_2_11 + */ +#define CCW_COMPAT_RHEL7_5 \ + HW_COMPAT_RHEL7_5 \ + {\ + .driver = TYPE_SCLP_EVENT_FACILITY,\ + .property = "allow_all_mask_sizes",\ + .value = "off",\ + }, + +static void ccw_machine_rhel760_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_rhel760_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", true); + +static void ccw_machine_rhel750_instance_options(MachineState *machine) +{ + static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 }; + ccw_machine_rhel760_instance_options(machine); + + /* before 2.12 we emulated the very first z900, and RHEL 7.5 is + based on 2.10 */ + s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat); +} + +static void ccw_machine_rhel750_class_options(MachineClass *mc) +{ + ccw_machine_rhel760_class_options(mc); + SET_MACHINE_COMPAT(mc, CCW_COMPAT_RHEL7_5); +} +DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false); + +#endif + static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); 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/arm/virt.h b/include/hw/arm/virt.h index 9a870cc..2293315 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -128,6 +128,7 @@ typedef struct { #define VIRT_ECAM_ID(high) (high ? VIRT_PCIE_ECAM_HIGH : VIRT_PCIE_ECAM) +#if 0 /* disabled for Red Hat Enterprise Linux */ #define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") #define VIRT_MACHINE(obj) \ OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE) @@ -136,6 +137,27 @@ typedef struct { #define VIRT_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE) +#else +#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel") +#define VIRT_MACHINE(obj) \ + OBJECT_CHECK(VirtMachineState, (obj), TYPE_RHEL_MACHINE) +#define VIRT_MACHINE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_RHEL_MACHINE) +#define VIRT_MACHINE_CLASS(klass) \ + OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE) +#endif + +/* This macro is for changes to properties that are RHEL specific, + * different to the current upstream and to be applied to the latest + * machine type. + */ +#define ARM_RHEL_COMPAT \ + {\ + .driver = "virtio-net-pci",\ + .property = "romfile",\ + .value = "",\ + }, + void virt_acpi_setup(VirtMachineState *vms); /* Return the number of used redistributor regions */ 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/i386/pc.h b/include/hw/i386/pc.h index 6894f37..ef82513 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -134,6 +134,9 @@ struct PCMachineClass { /* use DMA capable linuxboot option rom */ bool linuxboot_dma_enabled; + + /* RH only, see bz 1489800 */ + bool pc_rom_ro; }; #define TYPE_PC_MACHINE "generic-pc-machine" @@ -960,4 +963,565 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); type_init(pc_machine_init_##suffix) extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + +/* See include/hw/compat.h for shared compatibility lists */ + +/* This macro is for changes to properties that are RHEL specific, + * different to the current upstream and to be applied to the latest + * machine type. + */ +#define PC_RHEL_COMPAT \ + { /* PC_RHEL_COMPAT */ \ + .driver = TYPE_X86_CPU,\ + .property = "host-phys-bits",\ + .value = "on",\ + },\ + { /* PC_RHEL_COMPAT bz 1508330 */ \ + .driver = "vfio-pci",\ + .property = "x-no-geforce-quirks",\ + .value = "on",\ + }, + +/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but: + * - x-hv-max-vps was backported to 7.5 + * - x-pci-hole64-fix was backported to 7.5 + */ +#define PC_RHEL7_5_COMPAT \ + HW_COMPAT_RHEL7_5 \ + { /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_11 */ \ + .driver = "Skylake-Server" "-" TYPE_X86_CPU,\ + .property = "clflushopt",\ + .value = "off",\ + }, + + +#define PC_RHEL7_4_COMPAT \ + HW_COMPAT_RHEL7_4 \ + { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_9 */ \ + .driver = "mch",\ + .property = "extended-tseg-mbytes",\ + .value = stringify(0),\ + },\ + { /* PC_RHEL7_4_COMPAT bz 1489800 */ \ + .driver = "ICH9-LPC",\ + .property = "__com.redhat_force-rev1-fadt",\ + .value = "on",\ + },\ + { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \ + .driver = "i440FX-pcihost",\ + .property = "x-pci-hole64-fix",\ + .value = "off",\ + },\ + { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \ + .driver = "q35-pcihost",\ + .property = "x-pci-hole64-fix",\ + .value = "off",\ + },\ + { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_10 */ \ + .driver = TYPE_X86_CPU,\ + .property = "x-hv-max-vps",\ + .value = "0x40",\ + }, + +#define PC_RHEL7_3_COMPAT \ + HW_COMPAT_RHEL7_3 \ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ + .driver = "kvmclock",\ + .property = "x-mach-use-reliable-get-clock",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = TYPE_X86_CPU,\ + .property = "l3-cache",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = TYPE_X86_CPU,\ + .property = "full-cpuid-auto-level",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ + .property = "family",\ + .value = "15",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ + .property = "model",\ + .value = "6",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ + .property = "stepping",\ + .value = "1",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ + .driver = "isa-pcspk",\ + .property = "migrate",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \ + .driver = TYPE_X86_CPU,\ + .property = "cpuid-0xb",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ + .driver = "ICH9-LPC",\ + .property = "x-smi-broadcast",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ + .driver = TYPE_X86_CPU,\ + .property = "vmware-cpuid-freq",\ + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ + .driver = "Haswell-" TYPE_X86_CPU,\ + .property = "stepping",\ + .value = "1",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_3 added in 2.9 */ \ + .driver = TYPE_X86_CPU,\ + .property = "kvm-no-smi-migration",\ + .value = "on",\ + }, + +#define PC_RHEL7_2_COMPAT \ + HW_COMPAT_RHEL7_2 \ + {\ + .driver = "phenom" "-" TYPE_X86_CPU,\ + .property = "rdtscp",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "sse4a",\ + .value = "on",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "on",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "Haswell-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \ + .driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "Haswell-noTSX-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \ + .driver = "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "Broadwell-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \ + .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT (copied from the entry above) */ \ + .driver = "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "host" "-" TYPE_X86_CPU,\ + .property = "host-cache-info",\ + .value = "on",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = TYPE_X86_CPU,\ + .property = "check",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "qemu32" "-" TYPE_X86_CPU,\ + .property = "popcnt",\ + .value = "on",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = TYPE_X86_CPU,\ + .property = "arat",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "usb-redir",\ + .property = "streams",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = TYPE_X86_CPU,\ + .property = "fill-mtrr-mask",\ + .value = "off",\ + },\ + { /* PC_RHEL7_2_COMPAT */ \ + .driver = "apic-common",\ + .property = "legacy-instance-id",\ + .value = "on",\ + }, + + + +#define PC_RHEL7_1_COMPAT \ + HW_COMPAT_RHEL7_1 \ + {\ + .driver = "kvm64" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "kvm32" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Conroe" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Penryn" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Westmere" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "SandyBridge" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "SandyBridge-IBRS" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Haswell" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Broadwell" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Opteron_G1" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Opteron_G2" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Opteron_G4" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Opteron_G5" "-" TYPE_X86_CPU,\ + .property = "vme",\ + .value = "off",\ + },\ + {\ + .driver = "Haswell" "-" TYPE_X86_CPU,\ + .property = "f16c",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\ + .property = "f16c",\ + .value = "off",\ + },\ + {\ + .driver = "Haswell" "-" TYPE_X86_CPU,\ + .property = "rdrand",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Haswell-IBRS" "-" TYPE_X86_CPU,\ + .property = "rdrand",\ + .value = "off",\ + },\ + {\ + .driver = "Broadwell" "-" TYPE_X86_CPU,\ + .property = "f16c",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\ + .property = "f16c",\ + .value = "off",\ + },\ + {\ + .driver = "Broadwell" "-" TYPE_X86_CPU,\ + .property = "rdrand",\ + .value = "off",\ + },\ + { /* PC_RHEL7_1_COMPAT (copied from the entry above) */ \ + .driver = "Broadwell-IBRS" "-" TYPE_X86_CPU,\ + .property = "rdrand",\ + .value = "off",\ + },\ + {\ + .driver = "coreduo" "-" TYPE_X86_CPU,\ + .property = "vmx",\ + .value = "on",\ + },\ + {\ + .driver = "core2duo" "-" TYPE_X86_CPU,\ + .property = "vmx",\ + .value = "on",\ + },\ + { /* PC_RHEL7_1_COMPAT */ \ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "kvm64" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(5),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "pentium3" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(2),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "n270" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(5),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Conroe" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Penryn" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ + .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "n270" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Penryn" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Conroe" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Westmere" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "SandyBridge" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "IvyBridge" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Haswell" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Broadwell" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\ + .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + }, + +/* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. + * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. + */ + +/* + * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_* + * between our base and 1.5, less stuff backported to RHEL-7.0 + * (usb-device.msos-desc), less stuff for devices we changed + * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x, + * pci-serial-4x) in 7.0. + */ +#define PC_RHEL7_0_COMPAT \ + {\ + .driver = "virtio-scsi-pci",\ + .property = "any_layout",\ + .value = "off",\ + },{\ + .driver = "PIIX4_PM",\ + .property = "memory-hotplug-support",\ + .value = "off",\ + },{\ + .driver = "apic",\ + .property = "version",\ + .value = stringify(0x11),\ + },{\ + .driver = "nec-usb-xhci",\ + .property = "superspeed-ports-first",\ + .value = "off",\ + },{\ + .driver = "nec-usb-xhci",\ + .property = "force-pcie-endcap",\ + .value = "on",\ + },{\ + .driver = "pci-serial",\ + .property = "prog_if",\ + .value = stringify(0),\ + },{\ + .driver = "virtio-net-pci",\ + .property = "guest_announce",\ + .value = "off",\ + },{\ + .driver = "ICH9-LPC",\ + .property = "memory-hotplug-support",\ + .value = "off",\ + },{\ + .driver = "xio3130-downstream",\ + .property = COMPAT_PROP_PCP,\ + .value = "off",\ + },{\ + .driver = "ioh3420",\ + .property = COMPAT_PROP_PCP,\ + .value = "off",\ + },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ + },{\ + .driver = "e1000",\ + .property = "mitigation",\ + .value = "off",\ + },{ \ + .driver = "virtio-net-pci", \ + .property = "ctrl_guest_offloads", \ + .value = "off", \ + },\ + {\ + .driver = "Conroe" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Penryn" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + { /* PC_RHEL7_0_COMPAT (copied from the entry above) */ \ + .driver = "Nehalem-IBRS" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Westmere" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + { /* PC_RHEL7_0_COMPAT (copied from the entry above) */ \ + .driver = "Westmere-IBRS" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Opteron_G1" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Opteron_G2" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Opteron_G4" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + },\ + {\ + .driver = "Opteron_G5" "-" TYPE_X86_CPU,\ + .property = "x2apic",\ + .value = "on",\ + }, #endif diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 7e5de1a..330c370 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -101,6 +101,7 @@ struct sPAPRMachineClass { bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMBs */ bool use_ohci_by_default; /* use USB-OHCI instead of XHCI */ bool pre_2_10_has_unused_icps; + bool has_power9_support; void (*phb_placement)(sPAPRMachineState *spapr, uint32_t index, uint64_t *buid, hwaddr *pio, hwaddr *mmio32, hwaddr *mmio64, 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: diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 338ee37..051018a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1360,11 +1360,17 @@ static CPUCaches epyc_cache_info = { static X86CPUDefinition builtin_x86_defs[] = { { + /* qemu64 is the default CPU model for all *-rhel7.* machine-types. + * The default on RHEL-6 was cpu64-rhel6. + * libvirt assumes that qemu64 is the default for _all_ machine-types, + * so we should try to keep qemu64 and cpu64-rhel6 as similar as + * possible. + */ .name = "qemu64", .level = 0xd, .vendor = CPUID_VENDOR_AMD, .family = 6, - .model = 6, + .model = 13, .stepping = 3, .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | @@ -2684,6 +2690,7 @@ static PropValue kvm_default_props[] = { { "acpi", "off" }, { "monitor", "off" }, { "svm", "off" }, + { "kvm-pv-unhalt", "on" }, { NULL, NULL }, }; diff --git a/target/i386/machine.c b/target/i386/machine.c index 084c2c7..0c57c26 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -955,6 +955,26 @@ static const VMStateDescription vmstate_svm_npt = { } }; +static bool vmstate_xsave_needed(void *opaque) +{ + /* The xsave state is already on the main "cpu" section */ + return false; +} + +static const VMStateDescription vmstate_xsave ={ + .name = "cpu/xsave", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .needed = vmstate_xsave_needed, + .fields = (VMStateField []) { + VMSTATE_UINT64_V(env.xcr0, X86CPU, 1), + VMSTATE_UINT64_V(env.xstate_bv, X86CPU, 1), + VMSTATE_YMMH_REGS_VARS(env.xmm_regs, X86CPU, CPU_NB_REGS, 1), + VMSTATE_END_OF_LIST() + } +}; + VMStateDescription vmstate_x86_cpu = { .name = "cpu", .version_id = 12, @@ -1080,6 +1100,7 @@ VMStateDescription vmstate_x86_cpu = { &vmstate_msr_intel_pt, &vmstate_msr_virt_ssbd, &vmstate_svm_npt, + &vmstate_xsave, NULL } }; diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 7de4bf3..3e2e353 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -105,8 +105,19 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr) return NULL; } +long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2) +{ + const CompatInfo *compat1 = compat_by_pvr(pvr1); + const CompatInfo *compat2 = compat_by_pvr(pvr2); + + g_assert(compat1); + g_assert(compat2); + + return compat1 - compat2; +} + static bool pcc_compat(PowerPCCPUClass *pcc, uint32_t compat_pvr, - uint32_t min_compat_pvr, uint32_t max_compat_pvr) + uint32_t min_compat_pvr, uint32_t max_compat_pvr) { const CompatInfo *compat = compat_by_pvr(compat_pvr); const CompatInfo *min = compat_by_pvr(min_compat_pvr); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 4edcf62..532f0d5 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1365,6 +1365,7 @@ static inline int cpu_mmu_index (CPUPPCState *env, bool ifetch) /* Compatibility modes */ #if defined(TARGET_PPC64) +long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2); bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr, uint32_t min_compat_pvr, uint32_t max_compat_pvr); bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr, diff --git a/tests/Makefile.include b/tests/Makefile.include index a492827..6016df2 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -184,8 +184,8 @@ gcov-files-generic-y = qdev-monitor.c qmp.c check-qtest-generic-y += tests/cdrom-test$(EXESUF) gcov-files-ipack-y += hw/ipack/ipack.c -check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) -gcov-files-ipack-y += hw/char/ipoctal232.c +#check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) +#gcov-files-ipack-y += hw/char/ipoctal232.c check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF) gcov-files-virtioserial-y += hw/char/virtio-console.c @@ -217,23 +217,23 @@ check-qtest-pci-y += tests/e1000e-test$(EXESUF) gcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c check-qtest-pci-y += tests/rtl8139-test$(EXESUF) gcov-files-pci-y += hw/net/rtl8139.c -check-qtest-pci-y += tests/pcnet-test$(EXESUF) -gcov-files-pci-y += hw/net/pcnet.c -gcov-files-pci-y += hw/net/pcnet-pci.c -check-qtest-pci-y += tests/eepro100-test$(EXESUF) -gcov-files-pci-y += hw/net/eepro100.c -check-qtest-pci-y += tests/ne2000-test$(EXESUF) -gcov-files-pci-y += hw/net/ne2000.c -check-qtest-pci-y += tests/nvme-test$(EXESUF) -gcov-files-pci-y += hw/block/nvme.c +#check-qtest-pci-y += tests/pcnet-test$(EXESUF) +#gcov-files-pci-y += hw/net/pcnet.c +#gcov-files-pci-y += hw/net/pcnet-pci.c +#check-qtest-pci-y += tests/eepro100-test$(EXESUF) +#gcov-files-pci-y += hw/net/eepro100.c +#check-qtest-pci-y += tests/ne2000-test$(EXESUF) +#gcov-files-pci-y += hw/net/ne2000.c +#check-qtest-pci-y += tests/nvme-test$(EXESUF) +#gcov-files-pci-y += hw/block/nvme.c check-qtest-pci-y += tests/ac97-test$(EXESUF) gcov-files-pci-y += hw/audio/ac97.c -check-qtest-pci-y += tests/es1370-test$(EXESUF) -gcov-files-pci-y += hw/audio/es1370.c +#check-qtest-pci-y += tests/es1370-test$(EXESUF) +#gcov-files-pci-y += hw/audio/es1370.c check-qtest-pci-y += $(check-qtest-virtio-y) gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c -check-qtest-pci-y += tests/tpci200-test$(EXESUF) -gcov-files-pci-y += hw/ipack/tpci200.c +#check-qtest-pci-y += tests/tpci200-test$(EXESUF) +#gcov-files-pci-y += hw/ipack/tpci200.c check-qtest-pci-y += $(check-qtest-ipack-y) gcov-files-pci-y += $(gcov-files-ipack-y) check-qtest-pci-y += tests/display-vga-test$(EXESUF) @@ -245,25 +245,25 @@ gcov-files-pci-y += hw/display/virtio-gpu-pci.c gcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c check-qtest-pci-y += tests/intel-hda-test$(EXESUF) gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c -check-qtest-pci-$(CONFIG_IVSHMEM) += tests/ivshmem-test$(EXESUF) -gcov-files-pci-y += hw/misc/ivshmem.c -check-qtest-pci-y += tests/megasas-test$(EXESUF) -gcov-files-pci-y += hw/scsi/megasas.c +#check-qtest-pci-$(CONFIG_IVSHMEM) += tests/ivshmem-test$(EXESUF) +#gcov-files-pci-y += hw/misc/ivshmem.c +#check-qtest-pci-y += tests/megasas-test$(EXESUF) +#gcov-files-pci-y += hw/scsi/megasas.c check-qtest-i386-y = tests/endianness-test$(EXESUF) -check-qtest-i386-y += tests/fdc-test$(EXESUF) -gcov-files-i386-y = hw/block/fdc.c +#check-qtest-i386-y += tests/fdc-test$(EXESUF) +#gcov-files-i386-y = hw/block/fdc.c check-qtest-i386-y += tests/ide-test$(EXESUF) check-qtest-i386-y += tests/ahci-test$(EXESUF) check-qtest-i386-y += tests/hd-geo-test$(EXESUF) gcov-files-i386-y += hw/block/hd-geometry.c check-qtest-i386-y += tests/boot-order-test$(EXESUF) -check-qtest-i386-y += tests/bios-tables-test$(EXESUF) +#check-qtest-i386-y += tests/bios-tables-test$(EXESUF) check-qtest-i386-y += tests/boot-serial-test$(EXESUF) check-qtest-i386-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-i386-y += tests/rtc-test$(EXESUF) -check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF) -check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF) +#check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF) +#check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF) check-qtest-i386-y += tests/i440fx-test$(EXESUF) check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) check-qtest-i386-y += tests/drive_del-test$(EXESUF) @@ -272,8 +272,8 @@ check-qtest-i386-y += tests/tco-test$(EXESUF) gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c check-qtest-i386-y += $(check-qtest-pci-y) gcov-files-i386-y += $(gcov-files-pci-y) -check-qtest-i386-y += tests/vmxnet3-test$(EXESUF) -gcov-files-i386-y += hw/net/vmxnet3.c +#check-qtest-i386-y += tests/vmxnet3-test$(EXESUF) +#gcov-files-i386-y += hw/net/vmxnet3.c gcov-files-i386-y += hw/net/net_rx_pkt.c gcov-files-i386-y += hw/net/net_tx_pkt.c check-qtest-i386-y += tests/pvpanic-test$(EXESUF) @@ -282,8 +282,8 @@ check-qtest-i386-y += tests/i82801b11-test$(EXESUF) gcov-files-i386-y += hw/pci-bridge/i82801b11.c check-qtest-i386-y += tests/ioh3420-test$(EXESUF) gcov-files-i386-y += hw/pci-bridge/ioh3420.c -check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF) -gcov-files-i386-y += hw/usb/hcd-ohci.c +#check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF) +#gcov-files-i386-y += hw/usb/hcd-ohci.c check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF) gcov-files-i386-y += hw/usb/hcd-uhci.c check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF) @@ -311,7 +311,7 @@ check-qtest-i386-y += tests/migration-test$(EXESUF) check-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF) check-qtest-i386-y += tests/numa-test$(EXESUF) check-qtest-x86_64-y += $(check-qtest-i386-y) -check-qtest-x86_64-y += tests/sdhci-test$(EXESUF) +#check-qtest-x86_64-y += tests/sdhci-test$(EXESUF) gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)) @@ -332,34 +332,34 @@ check-qtest-mips64el-y = tests/endianness-test$(EXESUF) check-qtest-moxie-y = tests/boot-serial-test$(EXESUF) check-qtest-ppc-y = tests/endianness-test$(EXESUF) -check-qtest-ppc-y += tests/boot-order-test$(EXESUF) +#check-qtest-ppc-y += tests/boot-order-test$(EXESUF) check-qtest-ppc-y += tests/prom-env-test$(EXESUF) check-qtest-ppc-y += tests/drive_del-test$(EXESUF) check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) -check-qtest-ppc-y += tests/m48t59-test$(EXESUF) -gcov-files-ppc-y += hw/timer/m48t59.c +#check-qtest-ppc-y += tests/m48t59-test$(EXESUF) +#gcov-files-ppc-y += hw/timer/m48t59.c check-qtest-ppc64-y = $(check-qtest-ppc-y) gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y)) check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c -check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) +#check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF) check-qtest-ppc64-y += tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) -check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF) -gcov-files-ppc64-y += hw/usb/hcd-ohci.c -check-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF) -gcov-files-ppc64-y += hw/usb/hcd-uhci.c +#check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF) +#gcov-files-ppc64-y += hw/usb/hcd-ohci.c +#check-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF) +#gcov-files-ppc64-y += hw/usb/hcd-uhci.c check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF) gcov-files-ppc64-y += hw/usb/hcd-xhci.c check-qtest-ppc64-y += $(check-qtest-virtio-y) -check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) -check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) -check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) +#check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) +#check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) +#check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) check-qtest-ppc64-y += tests/display-vga-test$(EXESUF) check-qtest-ppc64-y += tests/numa-test$(EXESUF) -check-qtest-ppc64-$(CONFIG_IVSHMEM) += tests/ivshmem-test$(EXESUF) +#check-qtest-ppc64-$(CONFIG_IVSHMEM) += tests/ivshmem-test$(EXESUF) check-qtest-ppc64-y += tests/cpu-plug-test$(EXESUF) check-qtest-sh4-y = tests/endianness-test$(EXESUF) @@ -388,7 +388,7 @@ check-qtest-arm-y += tests/boot-serial-test$(EXESUF) check-qtest-arm-y += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y = tests/numa-test$(EXESUF) -check-qtest-aarch64-y += tests/sdhci-test$(EXESUF) +#check-qtest-aarch64-y += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF) check-qtest-microblazeel-y = $(check-qtest-microblaze-y) @@ -777,15 +777,15 @@ tests/endianness-test$(EXESUF): tests/endianness-test.o tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y) tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y) tests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y) -tests/fdc-test$(EXESUF): tests/fdc-test.o +#tests/fdc-test$(EXESUF): tests/fdc-test.o tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y) tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y) -tests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o -tests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o +#tests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o +#tests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y) tests/boot-serial-test$(EXESUF): tests/boot-serial-test.o $(libqos-obj-y) -tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o \ +#tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o \ tests/boot-sector.o tests/acpi-utils.o $(libqos-obj-y) tests/pxe-test$(EXESUF): tests/pxe-test.o tests/boot-sector.o $(libqos-obj-y) tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y) @@ -798,11 +798,11 @@ tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/e1000e-test$(EXESUF): tests/e1000e-test.o $(libqos-pc-obj-y) tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) -tests/pcnet-test$(EXESUF): tests/pcnet-test.o -tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o -tests/eepro100-test$(EXESUF): tests/eepro100-test.o -tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o -tests/ne2000-test$(EXESUF): tests/ne2000-test.o +#tests/pcnet-test$(EXESUF): tests/pcnet-test.o +#tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o +#tests/eepro100-test$(EXESUF): tests/eepro100-test.o +#tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o +#tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o $(libqos-virtio-obj-y) @@ -813,22 +813,22 @@ tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y) tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o $(libqos-virtio-obj-y) tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o $(libqos-virtio-obj-y) -tests/tpci200-test$(EXESUF): tests/tpci200-test.o +#tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o -tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o +#tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-virtio-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) -tests/nvme-test$(EXESUF): tests/nvme-test.o +#tests/nvme-test$(EXESUF): tests/nvme-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/ac97-test$(EXESUF): tests/ac97-test.o -tests/es1370-test$(EXESUF): tests/es1370-test.o +#tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o -tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) +#tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y) tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y) tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y) @@ -841,19 +841,19 @@ tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y) tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y) tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y) -tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y) -tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y) -tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y) +#tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y) +#tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y) +#tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y) tests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y) -tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y) -tests/megasas-test$(EXESUF): tests/megasas-test.o $(libqos-spapr-obj-y) $(libqos-pc-obj-y) +#tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y) +#tests/megasas-test$(EXESUF): tests/megasas-test.o $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y) tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y) tests/numa-test$(EXESUF): tests/numa-test.o tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o tests/acpi-utils.o -tests/sdhci-test$(EXESUF): tests/sdhci-test.o $(libqos-pc-obj-y) +#tests/sdhci-test$(EXESUF): tests/sdhci-test.o $(libqos-pc-obj-y) tests/cdrom-test$(EXESUF): tests/cdrom-test.o tests/boot-sector.o $(libqos-obj-y) tests/migration/stress$(EXESUF): tests/migration/stress.o diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index 952a2e7..5217a39 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.c @@ -80,17 +80,21 @@ static testdef_t tests[] = { { "ppc", "g3beige", "", "PowerPC,750" }, { "ppc", "mac99", "", "PowerPC,G4" }, { "ppc", "sam460ex", "-m 256", "DRAM: 256 MiB" }, +#if 0 /* Disabled for Red Hat Enterprise Linux */ { "ppc64", "ppce500", "", "U-Boot" }, { "ppc64", "prep", "-boot e", "Booting from device e" }, { "ppc64", "40p", "-m 192", "Memory size: 192 MB" }, { "ppc64", "mac99", "", "PowerPC,970FX" }, +#endif { "ppc64", "pseries", "", "Open Firmware" }, +#if 0 /* Disabled for Red Hat Enterprise Linux */ { "ppc64", "powernv", "-cpu POWER8", "OPAL" }, { "ppc64", "sam460ex", "-device e1000", "8086 100e" }, +#endif { "i386", "isapc", "-cpu qemu32 -device sga", "SGABIOS" }, { "i386", "pc", "-device sga", "SGABIOS" }, { "i386", "q35", "-device sga", "SGABIOS" }, - { "x86_64", "isapc", "-cpu qemu32 -device sga", "SGABIOS" }, + { "x86_64", "pc", "-cpu qemu32 -device sga", "SGABIOS" }, { "x86_64", "q35", "-device sga", "SGABIOS" }, { "sparc", "LX", "", "TMS390S10" }, { "sparc", "SS-4", "", "MB86904" }, diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index 5f39ba0..48b8d09 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -192,7 +192,8 @@ static void add_pseries_test_case(const char *mname) PlugTestData *data; if (!g_str_has_prefix(mname, "pseries-") || - (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) { + (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7) || + strcmp(mname,"pseries-rhel7.2.0") == 0) { return; } data = g_new(PlugTestData, 1); diff --git a/tests/e1000-test.c b/tests/e1000-test.c index 0c5fcdc..b830432 100644 --- a/tests/e1000-test.c +++ b/tests/e1000-test.c @@ -29,8 +29,10 @@ static void test_device(gconstpointer data) static const char *models[] = { "e1000", "e1000-82540em", +#if 0 /* Disabled for Red Hat Enterprise Linux */ "e1000-82544gc", "e1000-82545em", +#endif }; int main(int argc, char **argv) diff --git a/tests/endianness-test.c b/tests/endianness-test.c index 546e096..440353d 100644 --- a/tests/endianness-test.c +++ b/tests/endianness-test.c @@ -37,10 +37,12 @@ static const TestCase test_cases[] = { { "ppc", "g3beige", 0xfe000000, .bswap = true, .superio = "i82378" }, { "ppc", "prep", 0x80000000, .bswap = true }, { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" }, +#if 0 /* Disabled for RHEL, since ISA is not enabled */ { "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" }, { "ppc64", "pseries", (1ULL << 45), .bswap = true, .superio = "i82378" }, { "ppc64", "pseries-2.7", 0x10080000000ULL, .bswap = true, .superio = "i82378" }, +#endif /* Disabled for RHEL, since ISA is not enabled */ { "sh4", "r2d", 0xfe240000, .superio = "i82378" }, { "sh4eb", "r2d", 0xfe240000, .bswap = true, .superio = "i82378" }, { "sparc64", "sun4u", 0x1fe02000000LL, .bswap = true }, diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c index 8c867e6..cc9b6ec 100644 --- a/tests/prom-env-test.c +++ b/tests/prom-env-test.c @@ -82,7 +82,9 @@ int main(int argc, char *argv[]) if (!strcmp(arch, "ppc")) { add_tests(ppc_machines); } else if (!strcmp(arch, "ppc64")) { +#if 0 /* Disabled for Red Hat Enterprise Linux */ add_tests(ppc_machines); +#endif if (g_test_slow()) { qtest_add_data_func("prom-env/pseries", "pseries", test_machine); } diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index ee9c820..c5cc0ee 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -183,11 +183,11 @@ run_qemu -drive if=virtio case "$QEMU_DEFAULT_MACHINE" in pc) run_qemu -drive if=none,id=disk -device ide-cd,drive=disk - run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk +# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk run_qemu -drive if=none,id=disk -device ide-drive,drive=disk run_qemu -drive if=none,id=disk -device ide-hd,drive=disk - run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk - run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk +# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk +# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk ;; *) ;; @@ -212,11 +212,11 @@ run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on case "$QEMU_DEFAULT_MACHINE" in pc) run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk - run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk +# run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk - run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk - run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk +# run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk +# run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk ;; *) ;; diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index b973dc8..f1059f6 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -77,7 +77,7 @@ 068 rw auto quick 069 rw auto quick 070 rw auto quick -071 rw auto quick +# 071 rw auto quick -- requires whitelisted blkverify 072 rw auto quick 073 rw auto quick 074 rw auto quick @@ -105,7 +105,7 @@ 096 rw auto quick 097 rw auto backing 098 rw auto backing quick -099 rw auto quick +# 099 rw auto quick -- requires whitelisted blkverify # 100 was removed, do not reuse 101 rw auto quick 102 rw auto quick diff --git a/tests/qom-test.c b/tests/qom-test.c index e6f712c..ebd15fd 100644 --- a/tests/qom-test.c +++ b/tests/qom-test.c @@ -16,7 +16,7 @@ #include "libqtest.h" static const char *blacklist_x86[] = { - "xenfv", "xenpv", NULL + "xenfv", "xenpv", "isapc", NULL }; static const struct { diff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c index 84ce9c7..c1ee197 100644 --- a/tests/test-x86-cpuid-compat.c +++ b/tests/test-x86-cpuid-compat.c @@ -306,6 +306,7 @@ int main(int argc, char **argv) "-cpu 486,xlevel2=0xC0000002,+xstore", "xlevel2", 0xC0000002); +#if 0 /* Disabled in Red Hat Enterprise Linux */ /* Check compatibility of old machine-types that didn't * auto-increase level/xlevel/xlevel2: */ @@ -356,6 +357,7 @@ int main(int argc, char **argv) add_cpuid_test("x86/cpuid/xlevel-compat/pc-i440fx-2.4/npt-on", "-machine pc-i440fx-2.4 -cpu SandyBridge,+npt", "xlevel", 0x80000008); +#endif /* Test feature parsing */ add_feature_test("x86/cpuid/features/plus", diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c index 5b1b681..85fa150 100644 --- a/tests/usb-hcd-xhci-test.c +++ b/tests/usb-hcd-xhci-test.c @@ -21,6 +21,7 @@ static void test_xhci_hotplug(void) usb_test_hotplug("xhci", 1, NULL); } +#if 0 /* Disabled for Red Hat Enterprise Linux */ static void test_usb_uas_hotplug(void) { qtest_qmp_device_add("usb-uas", "uas", NULL); @@ -34,6 +35,7 @@ static void test_usb_uas_hotplug(void) qtest_qmp_device_del("scsihd"); qtest_qmp_device_del("uas"); } +#endif static void test_usb_ccid_hotplug(void) { @@ -52,7 +54,9 @@ int main(int argc, char **argv) qtest_add_func("/xhci/pci/init", test_xhci_init); qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug); +#if 0 /* Disabled for Red Hat Enterprise Linux */ qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug); +#endif qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug); qtest_start("-device nec-usb-xhci,id=xhci" -- 1.8.3.1