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
13 #include "qemu/osdep.h"
14 #include "qapi/error.h"
15 #include "qemu-common.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"
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"
39 S390CPU
*s390_cpu_addr2state(uint16_t cpu_addr
)
41 static MachineState
*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
) {
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
);
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
);
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",
81 void subsystem_reset(void)
86 for (i
= 0; i
< ARRAY_SIZE(reset_dev_types
); i
++) {
87 dev
= DEVICE(object_resolve_path_type("", reset_dev_types
[i
], NULL
));
94 static int virtio_ccw_hcall_notify(const uint64_t *args
)
96 uint64_t subch_id
= args
[0];
97 uint64_t queue
= args
[1];
99 int cssid
, ssid
, schid
, m
;
101 if (ioinst_disassemble_sch_ident(subch_id
, &m
, &cssid
, &ssid
, &schid
)) {
104 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
105 if (!sch
|| !css_subch_visible(sch
)) {
108 if (queue
>= VIRTIO_QUEUE_MAX
) {
111 virtio_queue_notify(virtio_ccw_get_vdev(sch
), queue
);
116 static int virtio_ccw_hcall_early_printk(const uint64_t *args
)
118 uint64_t mem
= args
[0];
120 if (mem
< ram_size
) {
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 */
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
)
160 r
= s390_get_clock(&tod_high
, &tod_low
);
162 warn_report("Unable to get guest clock for migration: %s",
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
);
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
)
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.");
187 tod_high
= qemu_get_byte(f
);
188 tod_low
= qemu_get_be64(f
);
190 r
= s390_set_clock(&tod_high
, &tod_low
);
192 error_report("Unable to set KVM guest TOD clock: %s", strerror(-r
));
198 static SaveVMHandlers savevm_gtod
= {
199 .save_state
= gtod_save
,
200 .load_state
= gtod_load
,
203 static void s390_init_ipl_dev(const char *kernel_filename
,
204 const char *kernel_cmdline
,
205 const char *initrd_filename
, const char *firmware
,
206 const char *netboot_fw
, bool enforce_bios
)
208 Object
*new = object_new(TYPE_S390_IPL
);
209 DeviceState
*dev
= DEVICE(new);
211 if (kernel_filename
) {
212 qdev_prop_set_string(dev
, "kernel", kernel_filename
);
214 if (initrd_filename
) {
215 qdev_prop_set_string(dev
, "initrd", initrd_filename
);
217 qdev_prop_set_string(dev
, "cmdline", kernel_cmdline
);
218 qdev_prop_set_string(dev
, "firmware", firmware
);
219 qdev_prop_set_string(dev
, "netboot_fw", netboot_fw
);
220 qdev_prop_set_bit(dev
, "enforce_bios", enforce_bios
);
221 object_property_add_child(qdev_get_machine(), TYPE_S390_IPL
,
224 qdev_init_nofail(dev
);
227 static void s390_create_virtio_net(BusState
*bus
, const char *name
)
231 for (i
= 0; i
< nb_nics
; i
++) {
232 NICInfo
*nd
= &nd_table
[i
];
236 nd
->model
= g_strdup("virtio");
239 qemu_check_nic_model(nd
, "virtio");
241 dev
= qdev_create(bus
, name
);
242 qdev_set_nic_properties(dev
, nd
);
243 qdev_init_nofail(dev
);
247 static void ccw_init(MachineState
*machine
)
250 VirtualCssBus
*css_bus
;
254 s390_memory_init(machine
->ram_size
);
256 /* init CPUs (incl. CPU model) early so s390_has_feature() works */
257 s390_init_cpus(machine
);
261 /* init the SIGP facility */
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
,
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);
291 ret
= css_create_css_image(VIRTUAL_CSSID
, true);
294 if (css_migration_enabled()) {
295 css_register_vmstate();
298 /* Create VirtIO network adapters */
299 s390_create_virtio_net(BUS(css_bus
), "virtio-net-ccw");
301 /* Register savevm handler for guest TOD clock */
302 register_savevm_live(NULL
, "todclock", 0, 1, &savevm_gtod
, NULL
);
305 static void s390_cpu_plug(HotplugHandler
*hotplug_dev
,
306 DeviceState
*dev
, Error
**errp
)
308 MachineState
*ms
= MACHINE(hotplug_dev
);
309 S390CPU
*cpu
= S390_CPU(dev
);
311 g_assert(!ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
);
312 ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
= OBJECT(dev
);
314 if (dev
->hotplugged
) {
315 raise_irq_cpu_hotplug();
319 static void s390_machine_reset(void)
321 S390CPU
*ipl_cpu
= S390_CPU(qemu_get_cpu(0));
324 qemu_devices_reset();
327 /* all cpus are stopped - configure and start the ipl cpu only */
328 s390_ipl_prepare_cpu(ipl_cpu
);
329 s390_cpu_set_state(CPU_STATE_OPERATING
, ipl_cpu
);
332 static void s390_machine_device_plug(HotplugHandler
*hotplug_dev
,
333 DeviceState
*dev
, Error
**errp
)
335 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
336 s390_cpu_plug(hotplug_dev
, dev
, errp
);
340 static void s390_machine_device_unplug_request(HotplugHandler
*hotplug_dev
,
341 DeviceState
*dev
, Error
**errp
)
343 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
344 error_setg(errp
, "CPU hot unplug not supported on this machine");
349 static CpuInstanceProperties
s390_cpu_index_to_props(MachineState
*machine
,
352 g_assert(machine
->possible_cpus
&& cpu_index
< machine
->possible_cpus
->len
);
354 return machine
->possible_cpus
->cpus
[cpu_index
].props
;
357 static const CPUArchIdList
*s390_possible_cpu_arch_ids(MachineState
*ms
)
361 if (ms
->possible_cpus
) {
362 g_assert(ms
->possible_cpus
&& ms
->possible_cpus
->len
== max_cpus
);
363 return ms
->possible_cpus
;
366 ms
->possible_cpus
= g_malloc0(sizeof(CPUArchIdList
) +
367 sizeof(CPUArchId
) * max_cpus
);
368 ms
->possible_cpus
->len
= max_cpus
;
369 for (i
= 0; i
< ms
->possible_cpus
->len
; i
++) {
370 ms
->possible_cpus
->cpus
[i
].vcpus_count
= 1;
371 ms
->possible_cpus
->cpus
[i
].arch_id
= i
;
372 ms
->possible_cpus
->cpus
[i
].props
.has_core_id
= true;
373 ms
->possible_cpus
->cpus
[i
].props
.core_id
= i
;
376 return ms
->possible_cpus
;
379 static HotplugHandler
*s390_get_hotplug_handler(MachineState
*machine
,
382 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
383 return HOTPLUG_HANDLER(machine
);
388 static void s390_hot_add_cpu(const int64_t id
, Error
**errp
)
390 MachineState
*machine
= MACHINE(qdev_get_machine());
393 g_assert(machine
->possible_cpus
->cpus
[0].cpu
);
394 oc
= OBJECT_CLASS(CPU_GET_CLASS(machine
->possible_cpus
->cpus
[0].cpu
));
396 s390x_new_cpu(object_class_get_name(oc
), id
, errp
);
399 static void s390_nmi(NMIState
*n
, int cpu_index
, Error
**errp
)
401 CPUState
*cs
= qemu_get_cpu(cpu_index
);
403 if (s390_cpu_restart(S390_CPU(cs
))) {
404 error_setg(errp
, QERR_UNSUPPORTED
);
408 static void ccw_machine_class_init(ObjectClass
*oc
, void *data
)
410 MachineClass
*mc
= MACHINE_CLASS(oc
);
411 NMIClass
*nc
= NMI_CLASS(oc
);
412 HotplugHandlerClass
*hc
= HOTPLUG_HANDLER_CLASS(oc
);
413 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
415 s390mc
->ri_allowed
= true;
416 s390mc
->cpu_model_allowed
= true;
417 s390mc
->css_migration_enabled
= true;
418 s390mc
->gs_allowed
= true;
420 mc
->reset
= s390_machine_reset
;
421 mc
->hot_add_cpu
= s390_hot_add_cpu
;
422 mc
->block_default_type
= IF_VIRTIO
;
429 mc
->max_cpus
= S390_MAX_CPUS
;
430 mc
->has_hotpluggable_cpus
= true;
431 mc
->get_hotplug_handler
= s390_get_hotplug_handler
;
432 mc
->cpu_index_to_instance_props
= s390_cpu_index_to_props
;
433 mc
->possible_cpu_arch_ids
= s390_possible_cpu_arch_ids
;
434 /* it is overridden with 'host' cpu *in kvm_arch_init* */
435 mc
->default_cpu_type
= S390_CPU_TYPE_NAME("qemu");
436 hc
->plug
= s390_machine_device_plug
;
437 hc
->unplug_request
= s390_machine_device_unplug_request
;
438 nc
->nmi_monitor_handler
= s390_nmi
;
441 static inline bool machine_get_aes_key_wrap(Object
*obj
, Error
**errp
)
443 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
445 return ms
->aes_key_wrap
;
448 static inline void machine_set_aes_key_wrap(Object
*obj
, bool value
,
451 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
453 ms
->aes_key_wrap
= value
;
456 static inline bool machine_get_dea_key_wrap(Object
*obj
, Error
**errp
)
458 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
460 return ms
->dea_key_wrap
;
463 static inline void machine_set_dea_key_wrap(Object
*obj
, bool value
,
466 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
468 ms
->dea_key_wrap
= value
;
471 static S390CcwMachineClass
*current_mc
;
473 static S390CcwMachineClass
*get_machine_class(void)
475 if (unlikely(!current_mc
)) {
477 * No s390 ccw machine was instantiated, we are likely to
478 * be called for the 'none' machine. The properties will
479 * have their after-initialization values.
481 current_mc
= S390_MACHINE_CLASS(
482 object_class_by_name(TYPE_S390_CCW_MACHINE
));
487 bool ri_allowed(void)
489 /* for "none" machine this results in true */
490 return get_machine_class()->ri_allowed
;
493 bool cpu_model_allowed(void)
495 /* for "none" machine this results in true */
496 return get_machine_class()->cpu_model_allowed
;
499 bool gs_allowed(void)
501 /* for "none" machine this results in true */
502 return get_machine_class()->gs_allowed
;
505 static char *machine_get_loadparm(Object
*obj
, Error
**errp
)
507 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
509 return g_memdup(ms
->loadparm
, sizeof(ms
->loadparm
));
512 static void machine_set_loadparm(Object
*obj
, const char *val
, Error
**errp
)
514 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
517 for (i
= 0; i
< sizeof(ms
->loadparm
) && val
[i
]; i
++) {
518 uint8_t c
= qemu_toupper(val
[i
]); /* mimic HMC */
520 if (('A' <= c
&& c
<= 'Z') || ('0' <= c
&& c
<= '9') || (c
== '.') ||
524 error_setg(errp
, "LOADPARM: invalid character '%c' (ASCII 0x%02x)",
530 for (; i
< sizeof(ms
->loadparm
); i
++) {
531 ms
->loadparm
[i
] = ' '; /* pad right with spaces */
534 static inline bool machine_get_squash_mcss(Object
*obj
, Error
**errp
)
536 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
538 return ms
->s390_squash_mcss
;
541 static inline void machine_set_squash_mcss(Object
*obj
, bool value
,
544 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
546 ms
->s390_squash_mcss
= value
;
549 static inline void s390_machine_initfn(Object
*obj
)
551 object_property_add_bool(obj
, "aes-key-wrap",
552 machine_get_aes_key_wrap
,
553 machine_set_aes_key_wrap
, NULL
);
554 object_property_set_description(obj
, "aes-key-wrap",
555 "enable/disable AES key wrapping using the CPACF wrapping key",
557 object_property_set_bool(obj
, true, "aes-key-wrap", NULL
);
559 object_property_add_bool(obj
, "dea-key-wrap",
560 machine_get_dea_key_wrap
,
561 machine_set_dea_key_wrap
, NULL
);
562 object_property_set_description(obj
, "dea-key-wrap",
563 "enable/disable DEA key wrapping using the CPACF wrapping key",
565 object_property_set_bool(obj
, true, "dea-key-wrap", NULL
);
566 object_property_add_str(obj
, "loadparm",
567 machine_get_loadparm
, machine_set_loadparm
, NULL
);
568 object_property_set_description(obj
, "loadparm",
569 "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
570 " to upper case) to pass to machine loader, boot manager,"
573 object_property_add_bool(obj
, "s390-squash-mcss",
574 machine_get_squash_mcss
,
575 machine_set_squash_mcss
, NULL
);
576 object_property_set_description(obj
, "s390-squash-mcss",
577 "enable/disable squashing subchannels into the default css",
579 object_property_set_bool(obj
, false, "s390-squash-mcss", NULL
);
582 static const TypeInfo ccw_machine_info
= {
583 .name
= TYPE_S390_CCW_MACHINE
,
584 .parent
= TYPE_MACHINE
,
586 .instance_size
= sizeof(S390CcwMachineState
),
587 .instance_init
= s390_machine_initfn
,
588 .class_size
= sizeof(S390CcwMachineClass
),
589 .class_init
= ccw_machine_class_init
,
590 .interfaces
= (InterfaceInfo
[]) {
592 { TYPE_HOTPLUG_HANDLER
},
597 bool css_migration_enabled(void)
599 return get_machine_class()->css_migration_enabled
;
602 #define DEFINE_CCW_MACHINE(suffix, verstr, latest) \
603 static void ccw_machine_##suffix##_class_init(ObjectClass *oc, \
606 MachineClass *mc = MACHINE_CLASS(oc); \
607 ccw_machine_##suffix##_class_options(mc); \
608 mc->desc = "VirtIO-ccw based S390 machine v" verstr; \
610 mc->alias = "s390-ccw-virtio"; \
611 mc->is_default = 1; \
614 static void ccw_machine_##suffix##_instance_init(Object *obj) \
616 MachineState *machine = MACHINE(obj); \
617 current_mc = S390_MACHINE_CLASS(MACHINE_GET_CLASS(machine)); \
618 ccw_machine_##suffix##_instance_options(machine); \
620 static const TypeInfo ccw_machine_##suffix##_info = { \
621 .name = MACHINE_TYPE_NAME("s390-ccw-virtio-" verstr), \
622 .parent = TYPE_S390_CCW_MACHINE, \
623 .class_init = ccw_machine_##suffix##_class_init, \
624 .instance_init = ccw_machine_##suffix##_instance_init, \
626 static void ccw_machine_register_##suffix(void) \
628 type_register_static(&ccw_machine_##suffix##_info); \
630 type_init(ccw_machine_register_##suffix)
632 #define CCW_COMPAT_2_10 \
635 #define CCW_COMPAT_2_9 \
638 .driver = TYPE_S390_STATTRIB,\
639 .property = "migration-enabled",\
643 #define CCW_COMPAT_2_8 \
646 .driver = TYPE_S390_FLIC_COMMON,\
647 .property = "adapter_routes_max_batch",\
651 #define CCW_COMPAT_2_7 \
654 #define CCW_COMPAT_2_6 \
657 .driver = TYPE_S390_IPL,\
658 .property = "iplbext_migration",\
661 .driver = TYPE_VIRTUAL_CSS_BRIDGE,\
662 .property = "css_dev_path",\
666 #define CCW_COMPAT_2_5 \
669 #define CCW_COMPAT_2_4 \
672 .driver = TYPE_S390_SKEYS,\
673 .property = "migration-enabled",\
676 .driver = "virtio-blk-ccw",\
677 .property = "max_revision",\
680 .driver = "virtio-balloon-ccw",\
681 .property = "max_revision",\
684 .driver = "virtio-serial-ccw",\
685 .property = "max_revision",\
688 .driver = "virtio-9p-ccw",\
689 .property = "max_revision",\
692 .driver = "virtio-rng-ccw",\
693 .property = "max_revision",\
696 .driver = "virtio-net-ccw",\
697 .property = "max_revision",\
700 .driver = "virtio-scsi-ccw",\
701 .property = "max_revision",\
704 .driver = "vhost-scsi-ccw",\
705 .property = "max_revision",\
709 static void ccw_machine_2_11_instance_options(MachineState
*machine
)
713 static void ccw_machine_2_11_class_options(MachineClass
*mc
)
716 DEFINE_CCW_MACHINE(2_11
, "2.11", true);
718 static void ccw_machine_2_10_instance_options(MachineState
*machine
)
720 ccw_machine_2_11_instance_options(machine
);
723 static void ccw_machine_2_10_class_options(MachineClass
*mc
)
725 ccw_machine_2_11_class_options(mc
);
726 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_10
);
728 DEFINE_CCW_MACHINE(2_10
, "2.10", false);
730 static void ccw_machine_2_9_instance_options(MachineState
*machine
)
732 ccw_machine_2_10_instance_options(machine
);
733 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ESOP
);
734 s390_cpudef_featoff_greater(12, 1, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2
);
735 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ZPCI
);
736 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_INT_SUPPRESSION
);
737 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_EVENT_NOTIFICATION
);
740 static void ccw_machine_2_9_class_options(MachineClass
*mc
)
742 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
744 s390mc
->gs_allowed
= false;
745 ccw_machine_2_10_class_options(mc
);
746 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_9
);
747 s390mc
->css_migration_enabled
= false;
749 DEFINE_CCW_MACHINE(2_9
, "2.9", false);
751 static void ccw_machine_2_8_instance_options(MachineState
*machine
)
753 ccw_machine_2_9_instance_options(machine
);
756 static void ccw_machine_2_8_class_options(MachineClass
*mc
)
758 ccw_machine_2_9_class_options(mc
);
759 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_8
);
761 DEFINE_CCW_MACHINE(2_8
, "2.8", false);
763 static void ccw_machine_2_7_instance_options(MachineState
*machine
)
765 ccw_machine_2_8_instance_options(machine
);
768 static void ccw_machine_2_7_class_options(MachineClass
*mc
)
770 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
772 s390mc
->cpu_model_allowed
= false;
773 ccw_machine_2_8_class_options(mc
);
774 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_7
);
776 DEFINE_CCW_MACHINE(2_7
, "2.7", false);
778 static void ccw_machine_2_6_instance_options(MachineState
*machine
)
780 ccw_machine_2_7_instance_options(machine
);
783 static void ccw_machine_2_6_class_options(MachineClass
*mc
)
785 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
787 s390mc
->ri_allowed
= false;
788 ccw_machine_2_7_class_options(mc
);
789 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_6
);
791 DEFINE_CCW_MACHINE(2_6
, "2.6", false);
793 static void ccw_machine_2_5_instance_options(MachineState
*machine
)
795 ccw_machine_2_6_instance_options(machine
);
798 static void ccw_machine_2_5_class_options(MachineClass
*mc
)
800 ccw_machine_2_6_class_options(mc
);
801 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_5
);
803 DEFINE_CCW_MACHINE(2_5
, "2.5", false);
805 static void ccw_machine_2_4_instance_options(MachineState
*machine
)
807 ccw_machine_2_5_instance_options(machine
);
810 static void ccw_machine_2_4_class_options(MachineClass
*mc
)
812 ccw_machine_2_5_class_options(mc
);
813 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_4
);
815 DEFINE_CCW_MACHINE(2_4
, "2.4", false);
817 static void ccw_machine_register_types(void)
819 type_register_static(&ccw_machine_info
);
822 type_init(ccw_machine_register_types
)