Revert "s390x/ccw: create s390 phb conditionally"
[qemu/ar7.git] / hw / s390x / s390-virtio-ccw.c
blob2c689d50bc3acebaed237cffae1df5982657332e
1 /*
2 * virtio ccw machine
4 * Copyright 2012 IBM Corp.
5 * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
6 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at
9 * your option) any later version. See the COPYING file in the top-level
10 * directory.
13 #include "qemu/osdep.h"
14 #include "qapi/error.h"
15 #include "qemu-common.h"
16 #include "cpu.h"
17 #include "hw/boards.h"
18 #include "exec/address-spaces.h"
19 #include "hw/s390x/s390-virtio-hcall.h"
20 #include "hw/s390x/sclp.h"
21 #include "hw/s390x/s390_flic.h"
22 #include "hw/s390x/ioinst.h"
23 #include "hw/s390x/css.h"
24 #include "virtio-ccw.h"
25 #include "qemu/config-file.h"
26 #include "qemu/error-report.h"
27 #include "s390-pci-bus.h"
28 #include "hw/s390x/storage-keys.h"
29 #include "hw/s390x/storage-attributes.h"
30 #include "hw/compat.h"
31 #include "ipl.h"
32 #include "hw/s390x/s390-virtio-ccw.h"
33 #include "hw/s390x/css-bridge.h"
34 #include "migration/register.h"
35 #include "cpu_models.h"
36 #include "qapi/qmp/qerror.h"
37 #include "hw/nmi.h"
39 S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)
41 static MachineState *ms;
43 if (!ms) {
44 ms = MACHINE(qdev_get_machine());
45 g_assert(ms->possible_cpus);
48 /* CPU address corresponds to the core_id and the index */
49 if (cpu_addr >= ms->possible_cpus->len) {
50 return NULL;
52 return S390_CPU(ms->possible_cpus->cpus[cpu_addr].cpu);
55 static void s390_init_cpus(MachineState *machine)
57 MachineClass *mc = MACHINE_GET_CLASS(machine);
58 int i;
60 if (tcg_enabled() && max_cpus > 1) {
61 error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
62 "supported by TCG (1) on s390x", max_cpus);
63 exit(1);
66 /* initialize possible_cpus */
67 mc->possible_cpu_arch_ids(machine);
69 for (i = 0; i < smp_cpus; i++) {
70 s390x_new_cpu(machine->cpu_type, i, &error_fatal);
74 static const char *const reset_dev_types[] = {
75 TYPE_VIRTUAL_CSS_BRIDGE,
76 "s390-sclp-event-facility",
77 "s390-flic",
78 "diag288",
81 void subsystem_reset(void)
83 DeviceState *dev;
84 int i;
86 for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) {
87 dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL));
88 if (dev) {
89 qdev_reset_all(dev);
94 static int virtio_ccw_hcall_notify(const uint64_t *args)
96 uint64_t subch_id = args[0];
97 uint64_t queue = args[1];
98 SubchDev *sch;
99 int cssid, ssid, schid, m;
101 if (ioinst_disassemble_sch_ident(subch_id, &m, &cssid, &ssid, &schid)) {
102 return -EINVAL;
104 sch = css_find_subch(m, cssid, ssid, schid);
105 if (!sch || !css_subch_visible(sch)) {
106 return -EINVAL;
108 if (queue >= VIRTIO_QUEUE_MAX) {
109 return -EINVAL;
111 virtio_queue_notify(virtio_ccw_get_vdev(sch), queue);
112 return 0;
116 static int virtio_ccw_hcall_early_printk(const uint64_t *args)
118 uint64_t mem = args[0];
120 if (mem < ram_size) {
121 /* Early printk */
122 return 0;
124 return -EINVAL;
127 static void virtio_ccw_register_hcalls(void)
129 s390_register_virtio_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY,
130 virtio_ccw_hcall_notify);
131 /* Tolerate early printk. */
132 s390_register_virtio_hypercall(KVM_S390_VIRTIO_NOTIFY,
133 virtio_ccw_hcall_early_printk);
136 static void s390_memory_init(ram_addr_t mem_size)
138 MemoryRegion *sysmem = get_system_memory();
139 MemoryRegion *ram = g_new(MemoryRegion, 1);
141 /* allocate RAM for core */
142 memory_region_allocate_system_memory(ram, NULL, "s390.ram", mem_size);
143 memory_region_add_subregion(sysmem, 0, ram);
145 /* Initialize storage key device */
146 s390_skeys_init();
147 /* Initialize storage attributes device */
148 s390_stattrib_init();
151 #define S390_TOD_CLOCK_VALUE_MISSING 0x00
152 #define S390_TOD_CLOCK_VALUE_PRESENT 0x01
154 static void gtod_save(QEMUFile *f, void *opaque)
156 uint64_t tod_low;
157 uint8_t tod_high;
158 int r;
160 r = s390_get_clock(&tod_high, &tod_low);
161 if (r) {
162 warn_report("Unable to get guest clock for migration: %s",
163 strerror(-r));
164 error_printf("Guest clock will not be migrated "
165 "which could cause the guest to hang.");
166 qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING);
167 return;
170 qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT);
171 qemu_put_byte(f, tod_high);
172 qemu_put_be64(f, tod_low);
175 static int gtod_load(QEMUFile *f, void *opaque, int version_id)
177 uint64_t tod_low;
178 uint8_t tod_high;
179 int r;
181 if (qemu_get_byte(f) == S390_TOD_CLOCK_VALUE_MISSING) {
182 warn_report("Guest clock was not migrated. This could "
183 "cause the guest to hang.");
184 return 0;
187 tod_high = qemu_get_byte(f);
188 tod_low = qemu_get_be64(f);
190 r = s390_set_clock(&tod_high, &tod_low);
191 if (r) {
192 warn_report("Unable to set guest clock for migration: %s",
193 strerror(-r));
194 error_printf("Guest clock will not be restored "
195 "which could cause the guest to hang.");
198 return 0;
201 static SaveVMHandlers savevm_gtod = {
202 .save_state = gtod_save,
203 .load_state = gtod_load,
206 static void s390_init_ipl_dev(const char *kernel_filename,
207 const char *kernel_cmdline,
208 const char *initrd_filename, const char *firmware,
209 const char *netboot_fw, bool enforce_bios)
211 Object *new = object_new(TYPE_S390_IPL);
212 DeviceState *dev = DEVICE(new);
214 if (kernel_filename) {
215 qdev_prop_set_string(dev, "kernel", kernel_filename);
217 if (initrd_filename) {
218 qdev_prop_set_string(dev, "initrd", initrd_filename);
220 qdev_prop_set_string(dev, "cmdline", kernel_cmdline);
221 qdev_prop_set_string(dev, "firmware", firmware);
222 qdev_prop_set_string(dev, "netboot_fw", netboot_fw);
223 qdev_prop_set_bit(dev, "enforce_bios", enforce_bios);
224 object_property_add_child(qdev_get_machine(), TYPE_S390_IPL,
225 new, NULL);
226 object_unref(new);
227 qdev_init_nofail(dev);
230 static void s390_create_virtio_net(BusState *bus, const char *name)
232 int i;
234 for (i = 0; i < nb_nics; i++) {
235 NICInfo *nd = &nd_table[i];
236 DeviceState *dev;
238 if (!nd->model) {
239 nd->model = g_strdup("virtio");
242 qemu_check_nic_model(nd, "virtio");
244 dev = qdev_create(bus, name);
245 qdev_set_nic_properties(dev, nd);
246 qdev_init_nofail(dev);
250 static void ccw_init(MachineState *machine)
252 int ret;
253 VirtualCssBus *css_bus;
254 DeviceState *dev;
256 s390_sclp_init();
257 s390_memory_init(machine->ram_size);
259 /* init CPUs (incl. CPU model) early so s390_has_feature() works */
260 s390_init_cpus(machine);
262 s390_flic_init();
264 /* get a BUS */
265 css_bus = virtual_css_bus_init();
266 s390_init_ipl_dev(machine->kernel_filename, machine->kernel_cmdline,
267 machine->initrd_filename, "s390-ccw.img",
268 "s390-netboot.img", true);
271 * We cannot easily make the pci host bridge conditional as older QEMUs
272 * always created it. Doing so would break migration across QEMU versions.
274 dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
275 object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE,
276 OBJECT(dev), NULL);
277 qdev_init_nofail(dev);
279 /* register hypercalls */
280 virtio_ccw_register_hcalls();
282 s390_enable_css_support(s390_cpu_addr2state(0));
284 * Non mcss-e enabled guests only see the devices from the default
285 * css, which is determined by the value of the squash_mcss property.
286 * Note: we must not squash non virtual devices to css 0xFE.
288 if (css_bus->squash_mcss) {
289 ret = css_create_css_image(0, true);
290 } else {
291 ret = css_create_css_image(VIRTUAL_CSSID, true);
293 assert(ret == 0);
295 /* Create VirtIO network adapters */
296 s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
298 /* Register savevm handler for guest TOD clock */
299 register_savevm_live(NULL, "todclock", 0, 1, &savevm_gtod, NULL);
302 static void s390_cpu_plug(HotplugHandler *hotplug_dev,
303 DeviceState *dev, Error **errp)
305 MachineState *ms = MACHINE(hotplug_dev);
306 S390CPU *cpu = S390_CPU(dev);
308 g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu);
309 ms->possible_cpus->cpus[cpu->env.core_id].cpu = OBJECT(dev);
312 static void s390_machine_reset(void)
314 S390CPU *ipl_cpu = S390_CPU(qemu_get_cpu(0));
316 s390_cmma_reset();
317 qemu_devices_reset();
318 s390_crypto_reset();
320 /* all cpus are stopped - configure and start the ipl cpu only */
321 s390_ipl_prepare_cpu(ipl_cpu);
322 s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu);
325 static void s390_machine_device_plug(HotplugHandler *hotplug_dev,
326 DeviceState *dev, Error **errp)
328 if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
329 s390_cpu_plug(hotplug_dev, dev, errp);
333 static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev,
334 DeviceState *dev, Error **errp)
336 if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
337 error_setg(errp, "CPU hot unplug not supported on this machine");
338 return;
342 static CpuInstanceProperties s390_cpu_index_to_props(MachineState *machine,
343 unsigned cpu_index)
345 g_assert(machine->possible_cpus && cpu_index < machine->possible_cpus->len);
347 return machine->possible_cpus->cpus[cpu_index].props;
350 static const CPUArchIdList *s390_possible_cpu_arch_ids(MachineState *ms)
352 int i;
354 if (ms->possible_cpus) {
355 g_assert(ms->possible_cpus && ms->possible_cpus->len == max_cpus);
356 return ms->possible_cpus;
359 ms->possible_cpus = g_malloc0(sizeof(CPUArchIdList) +
360 sizeof(CPUArchId) * max_cpus);
361 ms->possible_cpus->len = max_cpus;
362 for (i = 0; i < ms->possible_cpus->len; i++) {
363 ms->possible_cpus->cpus[i].vcpus_count = 1;
364 ms->possible_cpus->cpus[i].arch_id = i;
365 ms->possible_cpus->cpus[i].props.has_core_id = true;
366 ms->possible_cpus->cpus[i].props.core_id = i;
369 return ms->possible_cpus;
372 static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,
373 DeviceState *dev)
375 if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
376 return HOTPLUG_HANDLER(machine);
378 return NULL;
381 static void s390_hot_add_cpu(const int64_t id, Error **errp)
383 MachineState *machine = MACHINE(qdev_get_machine());
384 ObjectClass *oc;
386 g_assert(machine->possible_cpus->cpus[0].cpu);
387 oc = OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu));
389 s390x_new_cpu(object_class_get_name(oc), id, errp);
392 static void s390_nmi(NMIState *n, int cpu_index, Error **errp)
394 CPUState *cs = qemu_get_cpu(cpu_index);
396 if (s390_cpu_restart(S390_CPU(cs))) {
397 error_setg(errp, QERR_UNSUPPORTED);
401 static void ccw_machine_class_init(ObjectClass *oc, void *data)
403 MachineClass *mc = MACHINE_CLASS(oc);
404 NMIClass *nc = NMI_CLASS(oc);
405 HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
406 S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
408 s390mc->ri_allowed = true;
409 s390mc->cpu_model_allowed = true;
410 s390mc->css_migration_enabled = true;
411 s390mc->gs_allowed = true;
412 mc->init = ccw_init;
413 mc->reset = s390_machine_reset;
414 mc->hot_add_cpu = s390_hot_add_cpu;
415 mc->block_default_type = IF_VIRTIO;
416 mc->no_cdrom = 1;
417 mc->no_floppy = 1;
418 mc->no_serial = 1;
419 mc->no_parallel = 1;
420 mc->no_sdcard = 1;
421 mc->use_sclp = 1;
422 mc->max_cpus = 248;
423 mc->has_hotpluggable_cpus = true;
424 mc->get_hotplug_handler = s390_get_hotplug_handler;
425 mc->cpu_index_to_instance_props = s390_cpu_index_to_props;
426 mc->possible_cpu_arch_ids = s390_possible_cpu_arch_ids;
427 /* it is overridden with 'host' cpu *in kvm_arch_init* */
428 mc->default_cpu_type = S390_CPU_TYPE_NAME("qemu");
429 hc->plug = s390_machine_device_plug;
430 hc->unplug_request = s390_machine_device_unplug_request;
431 nc->nmi_monitor_handler = s390_nmi;
434 static inline bool machine_get_aes_key_wrap(Object *obj, Error **errp)
436 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
438 return ms->aes_key_wrap;
441 static inline void machine_set_aes_key_wrap(Object *obj, bool value,
442 Error **errp)
444 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
446 ms->aes_key_wrap = value;
449 static inline bool machine_get_dea_key_wrap(Object *obj, Error **errp)
451 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
453 return ms->dea_key_wrap;
456 static inline void machine_set_dea_key_wrap(Object *obj, bool value,
457 Error **errp)
459 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
461 ms->dea_key_wrap = value;
464 static S390CcwMachineClass *current_mc;
466 static S390CcwMachineClass *get_machine_class(void)
468 if (unlikely(!current_mc)) {
470 * No s390 ccw machine was instantiated, we are likely to
471 * be called for the 'none' machine. The properties will
472 * have their after-initialization values.
474 current_mc = S390_MACHINE_CLASS(
475 object_class_by_name(TYPE_S390_CCW_MACHINE));
477 return current_mc;
480 bool ri_allowed(void)
482 /* for "none" machine this results in true */
483 return get_machine_class()->ri_allowed;
486 bool cpu_model_allowed(void)
488 /* for "none" machine this results in true */
489 return get_machine_class()->cpu_model_allowed;
492 bool gs_allowed(void)
494 /* for "none" machine this results in true */
495 return get_machine_class()->gs_allowed;
498 static char *machine_get_loadparm(Object *obj, Error **errp)
500 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
502 return g_memdup(ms->loadparm, sizeof(ms->loadparm));
505 static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
507 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
508 int i;
510 for (i = 0; i < sizeof(ms->loadparm) && val[i]; i++) {
511 uint8_t c = qemu_toupper(val[i]); /* mimic HMC */
513 if (('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || (c == '.') ||
514 (c == ' ')) {
515 ms->loadparm[i] = c;
516 } else {
517 error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%02x)",
518 c, c);
519 return;
523 for (; i < sizeof(ms->loadparm); i++) {
524 ms->loadparm[i] = ' '; /* pad right with spaces */
527 static inline bool machine_get_squash_mcss(Object *obj, Error **errp)
529 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
531 return ms->s390_squash_mcss;
534 static inline void machine_set_squash_mcss(Object *obj, bool value,
535 Error **errp)
537 S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
539 ms->s390_squash_mcss = value;
542 static inline void s390_machine_initfn(Object *obj)
544 object_property_add_bool(obj, "aes-key-wrap",
545 machine_get_aes_key_wrap,
546 machine_set_aes_key_wrap, NULL);
547 object_property_set_description(obj, "aes-key-wrap",
548 "enable/disable AES key wrapping using the CPACF wrapping key",
549 NULL);
550 object_property_set_bool(obj, true, "aes-key-wrap", NULL);
552 object_property_add_bool(obj, "dea-key-wrap",
553 machine_get_dea_key_wrap,
554 machine_set_dea_key_wrap, NULL);
555 object_property_set_description(obj, "dea-key-wrap",
556 "enable/disable DEA key wrapping using the CPACF wrapping key",
557 NULL);
558 object_property_set_bool(obj, true, "dea-key-wrap", NULL);
559 object_property_add_str(obj, "loadparm",
560 machine_get_loadparm, machine_set_loadparm, NULL);
561 object_property_set_description(obj, "loadparm",
562 "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
563 " to upper case) to pass to machine loader, boot manager,"
564 " and guest kernel",
565 NULL);
566 object_property_add_bool(obj, "s390-squash-mcss",
567 machine_get_squash_mcss,
568 machine_set_squash_mcss, NULL);
569 object_property_set_description(obj, "s390-squash-mcss",
570 "enable/disable squashing subchannels into the default css",
571 NULL);
572 object_property_set_bool(obj, false, "s390-squash-mcss", NULL);
575 static const TypeInfo ccw_machine_info = {
576 .name = TYPE_S390_CCW_MACHINE,
577 .parent = TYPE_MACHINE,
578 .abstract = true,
579 .instance_size = sizeof(S390CcwMachineState),
580 .instance_init = s390_machine_initfn,
581 .class_size = sizeof(S390CcwMachineClass),
582 .class_init = ccw_machine_class_init,
583 .interfaces = (InterfaceInfo[]) {
584 { TYPE_NMI },
585 { TYPE_HOTPLUG_HANDLER},
590 bool css_migration_enabled(void)
592 return get_machine_class()->css_migration_enabled;
595 #define DEFINE_CCW_MACHINE(suffix, verstr, latest) \
596 static void ccw_machine_##suffix##_class_init(ObjectClass *oc, \
597 void *data) \
599 MachineClass *mc = MACHINE_CLASS(oc); \
600 ccw_machine_##suffix##_class_options(mc); \
601 mc->desc = "VirtIO-ccw based S390 machine v" verstr; \
602 if (latest) { \
603 mc->alias = "s390-ccw-virtio"; \
604 mc->is_default = 1; \
607 static void ccw_machine_##suffix##_instance_init(Object *obj) \
609 MachineState *machine = MACHINE(obj); \
610 current_mc = S390_MACHINE_CLASS(MACHINE_GET_CLASS(machine)); \
611 ccw_machine_##suffix##_instance_options(machine); \
613 static const TypeInfo ccw_machine_##suffix##_info = { \
614 .name = MACHINE_TYPE_NAME("s390-ccw-virtio-" verstr), \
615 .parent = TYPE_S390_CCW_MACHINE, \
616 .class_init = ccw_machine_##suffix##_class_init, \
617 .instance_init = ccw_machine_##suffix##_instance_init, \
618 }; \
619 static void ccw_machine_register_##suffix(void) \
621 type_register_static(&ccw_machine_##suffix##_info); \
623 type_init(ccw_machine_register_##suffix)
625 #define CCW_COMPAT_2_10 \
626 HW_COMPAT_2_10
628 #define CCW_COMPAT_2_9 \
629 HW_COMPAT_2_9 \
631 .driver = TYPE_S390_STATTRIB,\
632 .property = "migration-enabled",\
633 .value = "off",\
636 #define CCW_COMPAT_2_8 \
637 HW_COMPAT_2_8 \
639 .driver = TYPE_S390_FLIC_COMMON,\
640 .property = "adapter_routes_max_batch",\
641 .value = "64",\
644 #define CCW_COMPAT_2_7 \
645 HW_COMPAT_2_7
647 #define CCW_COMPAT_2_6 \
648 HW_COMPAT_2_6 \
650 .driver = TYPE_S390_IPL,\
651 .property = "iplbext_migration",\
652 .value = "off",\
653 }, {\
654 .driver = TYPE_VIRTUAL_CSS_BRIDGE,\
655 .property = "css_dev_path",\
656 .value = "off",\
659 #define CCW_COMPAT_2_5 \
660 HW_COMPAT_2_5
662 #define CCW_COMPAT_2_4 \
663 HW_COMPAT_2_4 \
665 .driver = TYPE_S390_SKEYS,\
666 .property = "migration-enabled",\
667 .value = "off",\
668 },{\
669 .driver = "virtio-blk-ccw",\
670 .property = "max_revision",\
671 .value = "0",\
672 },{\
673 .driver = "virtio-balloon-ccw",\
674 .property = "max_revision",\
675 .value = "0",\
676 },{\
677 .driver = "virtio-serial-ccw",\
678 .property = "max_revision",\
679 .value = "0",\
680 },{\
681 .driver = "virtio-9p-ccw",\
682 .property = "max_revision",\
683 .value = "0",\
684 },{\
685 .driver = "virtio-rng-ccw",\
686 .property = "max_revision",\
687 .value = "0",\
688 },{\
689 .driver = "virtio-net-ccw",\
690 .property = "max_revision",\
691 .value = "0",\
692 },{\
693 .driver = "virtio-scsi-ccw",\
694 .property = "max_revision",\
695 .value = "0",\
696 },{\
697 .driver = "vhost-scsi-ccw",\
698 .property = "max_revision",\
699 .value = "0",\
702 static void ccw_machine_2_11_instance_options(MachineState *machine)
706 static void ccw_machine_2_11_class_options(MachineClass *mc)
709 DEFINE_CCW_MACHINE(2_11, "2.11", true);
711 static void ccw_machine_2_10_instance_options(MachineState *machine)
713 ccw_machine_2_11_instance_options(machine);
714 if (css_migration_enabled()) {
715 css_register_vmstate();
719 static void ccw_machine_2_10_class_options(MachineClass *mc)
721 ccw_machine_2_11_class_options(mc);
722 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_10);
724 DEFINE_CCW_MACHINE(2_10, "2.10", false);
726 static void ccw_machine_2_9_instance_options(MachineState *machine)
728 ccw_machine_2_10_instance_options(machine);
729 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ESOP);
730 s390_cpudef_featoff_greater(12, 1, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2);
731 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ZPCI);
732 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_INT_SUPPRESSION);
733 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_EVENT_NOTIFICATION);
736 static void ccw_machine_2_9_class_options(MachineClass *mc)
738 S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
740 s390mc->gs_allowed = false;
741 ccw_machine_2_10_class_options(mc);
742 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);
743 s390mc->css_migration_enabled = false;
745 DEFINE_CCW_MACHINE(2_9, "2.9", false);
747 static void ccw_machine_2_8_instance_options(MachineState *machine)
749 ccw_machine_2_9_instance_options(machine);
752 static void ccw_machine_2_8_class_options(MachineClass *mc)
754 ccw_machine_2_9_class_options(mc);
755 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_8);
757 DEFINE_CCW_MACHINE(2_8, "2.8", false);
759 static void ccw_machine_2_7_instance_options(MachineState *machine)
761 ccw_machine_2_8_instance_options(machine);
764 static void ccw_machine_2_7_class_options(MachineClass *mc)
766 S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
768 s390mc->cpu_model_allowed = false;
769 ccw_machine_2_8_class_options(mc);
770 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_7);
772 DEFINE_CCW_MACHINE(2_7, "2.7", false);
774 static void ccw_machine_2_6_instance_options(MachineState *machine)
776 ccw_machine_2_7_instance_options(machine);
779 static void ccw_machine_2_6_class_options(MachineClass *mc)
781 S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
783 s390mc->ri_allowed = false;
784 ccw_machine_2_7_class_options(mc);
785 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_6);
787 DEFINE_CCW_MACHINE(2_6, "2.6", false);
789 static void ccw_machine_2_5_instance_options(MachineState *machine)
791 ccw_machine_2_6_instance_options(machine);
794 static void ccw_machine_2_5_class_options(MachineClass *mc)
796 ccw_machine_2_6_class_options(mc);
797 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_5);
799 DEFINE_CCW_MACHINE(2_5, "2.5", false);
801 static void ccw_machine_2_4_instance_options(MachineState *machine)
803 ccw_machine_2_5_instance_options(machine);
806 static void ccw_machine_2_4_class_options(MachineClass *mc)
808 ccw_machine_2_5_class_options(mc);
809 SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_4);
811 DEFINE_CCW_MACHINE(2_4, "2.4", false);
813 static void ccw_machine_register_types(void)
815 type_register_static(&ccw_machine_info);
818 type_init(ccw_machine_register_types)