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 (machine
->cpu_model
== NULL
) {
61 machine
->cpu_model
= s390_default_cpu_model_name();
63 if (tcg_enabled() && max_cpus
> 1) {
64 error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
65 "supported by TCG (1) on s390x", max_cpus
);
69 /* initialize possible_cpus */
70 mc
->possible_cpu_arch_ids(machine
);
72 for (i
= 0; i
< smp_cpus
; i
++) {
73 s390x_new_cpu(machine
->cpu_model
, i
, &error_fatal
);
77 static const char *const reset_dev_types
[] = {
78 TYPE_VIRTUAL_CSS_BRIDGE
,
79 "s390-sclp-event-facility",
84 void subsystem_reset(void)
89 for (i
= 0; i
< ARRAY_SIZE(reset_dev_types
); i
++) {
90 dev
= DEVICE(object_resolve_path_type("", reset_dev_types
[i
], NULL
));
97 static int virtio_ccw_hcall_notify(const uint64_t *args
)
99 uint64_t subch_id
= args
[0];
100 uint64_t queue
= args
[1];
102 int cssid
, ssid
, schid
, m
;
104 if (ioinst_disassemble_sch_ident(subch_id
, &m
, &cssid
, &ssid
, &schid
)) {
107 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
108 if (!sch
|| !css_subch_visible(sch
)) {
111 if (queue
>= VIRTIO_QUEUE_MAX
) {
114 virtio_queue_notify(virtio_ccw_get_vdev(sch
), queue
);
119 static int virtio_ccw_hcall_early_printk(const uint64_t *args
)
121 uint64_t mem
= args
[0];
123 if (mem
< ram_size
) {
130 static void virtio_ccw_register_hcalls(void)
132 s390_register_virtio_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY
,
133 virtio_ccw_hcall_notify
);
134 /* Tolerate early printk. */
135 s390_register_virtio_hypercall(KVM_S390_VIRTIO_NOTIFY
,
136 virtio_ccw_hcall_early_printk
);
139 static void s390_memory_init(ram_addr_t mem_size
)
141 MemoryRegion
*sysmem
= get_system_memory();
142 MemoryRegion
*ram
= g_new(MemoryRegion
, 1);
144 /* allocate RAM for core */
145 memory_region_allocate_system_memory(ram
, NULL
, "s390.ram", mem_size
);
146 memory_region_add_subregion(sysmem
, 0, ram
);
148 /* Initialize storage key device */
150 /* Initialize storage attributes device */
151 s390_stattrib_init();
154 #define S390_TOD_CLOCK_VALUE_MISSING 0x00
155 #define S390_TOD_CLOCK_VALUE_PRESENT 0x01
157 static void gtod_save(QEMUFile
*f
, void *opaque
)
163 r
= s390_get_clock(&tod_high
, &tod_low
);
165 warn_report("Unable to get guest clock for migration: %s",
167 error_printf("Guest clock will not be migrated "
168 "which could cause the guest to hang.");
169 qemu_put_byte(f
, S390_TOD_CLOCK_VALUE_MISSING
);
173 qemu_put_byte(f
, S390_TOD_CLOCK_VALUE_PRESENT
);
174 qemu_put_byte(f
, tod_high
);
175 qemu_put_be64(f
, tod_low
);
178 static int gtod_load(QEMUFile
*f
, void *opaque
, int version_id
)
184 if (qemu_get_byte(f
) == S390_TOD_CLOCK_VALUE_MISSING
) {
185 warn_report("Guest clock was not migrated. This could "
186 "cause the guest to hang.");
190 tod_high
= qemu_get_byte(f
);
191 tod_low
= qemu_get_be64(f
);
193 r
= s390_set_clock(&tod_high
, &tod_low
);
195 warn_report("Unable to set guest clock for migration: %s",
197 error_printf("Guest clock will not be restored "
198 "which could cause the guest to hang.");
204 static SaveVMHandlers savevm_gtod
= {
205 .save_state
= gtod_save
,
206 .load_state
= gtod_load
,
209 static void s390_init_ipl_dev(const char *kernel_filename
,
210 const char *kernel_cmdline
,
211 const char *initrd_filename
, const char *firmware
,
212 const char *netboot_fw
, bool enforce_bios
)
214 Object
*new = object_new(TYPE_S390_IPL
);
215 DeviceState
*dev
= DEVICE(new);
217 if (kernel_filename
) {
218 qdev_prop_set_string(dev
, "kernel", kernel_filename
);
220 if (initrd_filename
) {
221 qdev_prop_set_string(dev
, "initrd", initrd_filename
);
223 qdev_prop_set_string(dev
, "cmdline", kernel_cmdline
);
224 qdev_prop_set_string(dev
, "firmware", firmware
);
225 qdev_prop_set_string(dev
, "netboot_fw", netboot_fw
);
226 qdev_prop_set_bit(dev
, "enforce_bios", enforce_bios
);
227 object_property_add_child(qdev_get_machine(), TYPE_S390_IPL
,
230 qdev_init_nofail(dev
);
233 static void s390_create_virtio_net(BusState
*bus
, const char *name
)
237 for (i
= 0; i
< nb_nics
; i
++) {
238 NICInfo
*nd
= &nd_table
[i
];
242 nd
->model
= g_strdup("virtio");
245 qemu_check_nic_model(nd
, "virtio");
247 dev
= qdev_create(bus
, name
);
248 qdev_set_nic_properties(dev
, nd
);
249 qdev_init_nofail(dev
);
253 static void ccw_init(MachineState
*machine
)
256 VirtualCssBus
*css_bus
;
259 s390_memory_init(machine
->ram_size
);
261 /* init CPUs (incl. CPU model) early so s390_has_feature() works */
262 s390_init_cpus(machine
);
267 css_bus
= virtual_css_bus_init();
268 s390_init_ipl_dev(machine
->kernel_filename
, machine
->kernel_cmdline
,
269 machine
->initrd_filename
, "s390-ccw.img",
270 "s390-netboot.img", true);
272 if (s390_has_feat(S390_FEAT_ZPCI
)) {
273 DeviceState
*dev
= qdev_create(NULL
, TYPE_S390_PCI_HOST_BRIDGE
);
274 object_property_add_child(qdev_get_machine(),
275 TYPE_S390_PCI_HOST_BRIDGE
,
277 qdev_init_nofail(dev
);
280 /* register hypercalls */
281 virtio_ccw_register_hcalls();
283 s390_enable_css_support(s390_cpu_addr2state(0));
285 * Non mcss-e enabled guests only see the devices from the default
286 * css, which is determined by the value of the squash_mcss property.
287 * Note: we must not squash non virtual devices to css 0xFE.
289 if (css_bus
->squash_mcss
) {
290 ret
= css_create_css_image(0, true);
292 ret
= css_create_css_image(VIRTUAL_CSSID
, true);
296 /* Create VirtIO network adapters */
297 s390_create_virtio_net(BUS(css_bus
), "virtio-net-ccw");
299 /* Register savevm handler for guest TOD clock */
300 register_savevm_live(NULL
, "todclock", 0, 1, &savevm_gtod
, NULL
);
303 static void s390_cpu_plug(HotplugHandler
*hotplug_dev
,
304 DeviceState
*dev
, Error
**errp
)
306 MachineState
*ms
= MACHINE(hotplug_dev
);
307 S390CPU
*cpu
= S390_CPU(dev
);
309 g_assert(!ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
);
310 ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
= OBJECT(dev
);
313 static void s390_machine_reset(void)
315 S390CPU
*ipl_cpu
= S390_CPU(qemu_get_cpu(0));
318 qemu_devices_reset();
321 /* all cpus are stopped - configure and start the ipl cpu only */
322 s390_ipl_prepare_cpu(ipl_cpu
);
323 s390_cpu_set_state(CPU_STATE_OPERATING
, ipl_cpu
);
326 static void s390_machine_device_plug(HotplugHandler
*hotplug_dev
,
327 DeviceState
*dev
, Error
**errp
)
329 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
330 s390_cpu_plug(hotplug_dev
, dev
, errp
);
334 static void s390_machine_device_unplug_request(HotplugHandler
*hotplug_dev
,
335 DeviceState
*dev
, Error
**errp
)
337 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
338 error_setg(errp
, "CPU hot unplug not supported on this machine");
343 static CpuInstanceProperties
s390_cpu_index_to_props(MachineState
*machine
,
346 g_assert(machine
->possible_cpus
&& cpu_index
< machine
->possible_cpus
->len
);
348 return machine
->possible_cpus
->cpus
[cpu_index
].props
;
351 static const CPUArchIdList
*s390_possible_cpu_arch_ids(MachineState
*ms
)
355 if (ms
->possible_cpus
) {
356 g_assert(ms
->possible_cpus
&& ms
->possible_cpus
->len
== max_cpus
);
357 return ms
->possible_cpus
;
360 ms
->possible_cpus
= g_malloc0(sizeof(CPUArchIdList
) +
361 sizeof(CPUArchId
) * max_cpus
);
362 ms
->possible_cpus
->len
= max_cpus
;
363 for (i
= 0; i
< ms
->possible_cpus
->len
; i
++) {
364 ms
->possible_cpus
->cpus
[i
].vcpus_count
= 1;
365 ms
->possible_cpus
->cpus
[i
].arch_id
= i
;
366 ms
->possible_cpus
->cpus
[i
].props
.has_core_id
= true;
367 ms
->possible_cpus
->cpus
[i
].props
.core_id
= i
;
370 return ms
->possible_cpus
;
373 static HotplugHandler
*s390_get_hotplug_handler(MachineState
*machine
,
376 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
377 return HOTPLUG_HANDLER(machine
);
382 static void s390_hot_add_cpu(const int64_t id
, Error
**errp
)
384 MachineState
*machine
= MACHINE(qdev_get_machine());
386 s390x_new_cpu(machine
->cpu_model
, id
, errp
);
389 static void s390_nmi(NMIState
*n
, int cpu_index
, Error
**errp
)
391 CPUState
*cs
= qemu_get_cpu(cpu_index
);
393 if (s390_cpu_restart(S390_CPU(cs
))) {
394 error_setg(errp
, QERR_UNSUPPORTED
);
398 static void ccw_machine_class_init(ObjectClass
*oc
, void *data
)
400 MachineClass
*mc
= MACHINE_CLASS(oc
);
401 NMIClass
*nc
= NMI_CLASS(oc
);
402 HotplugHandlerClass
*hc
= HOTPLUG_HANDLER_CLASS(oc
);
403 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
405 s390mc
->ri_allowed
= true;
406 s390mc
->cpu_model_allowed
= true;
407 s390mc
->css_migration_enabled
= true;
408 s390mc
->gs_allowed
= true;
410 mc
->reset
= s390_machine_reset
;
411 mc
->hot_add_cpu
= s390_hot_add_cpu
;
412 mc
->block_default_type
= IF_VIRTIO
;
420 mc
->has_hotpluggable_cpus
= true;
421 mc
->get_hotplug_handler
= s390_get_hotplug_handler
;
422 mc
->cpu_index_to_instance_props
= s390_cpu_index_to_props
;
423 mc
->possible_cpu_arch_ids
= s390_possible_cpu_arch_ids
;
424 hc
->plug
= s390_machine_device_plug
;
425 hc
->unplug_request
= s390_machine_device_unplug_request
;
426 nc
->nmi_monitor_handler
= s390_nmi
;
429 static inline bool machine_get_aes_key_wrap(Object
*obj
, Error
**errp
)
431 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
433 return ms
->aes_key_wrap
;
436 static inline void machine_set_aes_key_wrap(Object
*obj
, bool value
,
439 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
441 ms
->aes_key_wrap
= value
;
444 static inline bool machine_get_dea_key_wrap(Object
*obj
, Error
**errp
)
446 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
448 return ms
->dea_key_wrap
;
451 static inline void machine_set_dea_key_wrap(Object
*obj
, bool value
,
454 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
456 ms
->dea_key_wrap
= value
;
459 static S390CcwMachineClass
*current_mc
;
461 static S390CcwMachineClass
*get_machine_class(void)
463 if (unlikely(!current_mc
)) {
465 * No s390 ccw machine was instantiated, we are likely to
466 * be called for the 'none' machine. The properties will
467 * have their after-initialization values.
469 current_mc
= S390_MACHINE_CLASS(
470 object_class_by_name(TYPE_S390_CCW_MACHINE
));
475 bool ri_allowed(void)
477 /* for "none" machine this results in true */
478 return get_machine_class()->ri_allowed
;
481 bool cpu_model_allowed(void)
483 /* for "none" machine this results in true */
484 return get_machine_class()->cpu_model_allowed
;
487 bool gs_allowed(void)
489 /* for "none" machine this results in true */
490 return get_machine_class()->gs_allowed
;
493 static char *machine_get_loadparm(Object
*obj
, Error
**errp
)
495 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
497 return g_memdup(ms
->loadparm
, sizeof(ms
->loadparm
));
500 static void machine_set_loadparm(Object
*obj
, const char *val
, Error
**errp
)
502 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
505 for (i
= 0; i
< sizeof(ms
->loadparm
) && val
[i
]; i
++) {
506 uint8_t c
= qemu_toupper(val
[i
]); /* mimic HMC */
508 if (('A' <= c
&& c
<= 'Z') || ('0' <= c
&& c
<= '9') || (c
== '.') ||
512 error_setg(errp
, "LOADPARM: invalid character '%c' (ASCII 0x%02x)",
518 for (; i
< sizeof(ms
->loadparm
); i
++) {
519 ms
->loadparm
[i
] = ' '; /* pad right with spaces */
522 static inline bool machine_get_squash_mcss(Object
*obj
, Error
**errp
)
524 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
526 return ms
->s390_squash_mcss
;
529 static inline void machine_set_squash_mcss(Object
*obj
, bool value
,
532 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
534 ms
->s390_squash_mcss
= value
;
537 static inline void s390_machine_initfn(Object
*obj
)
539 object_property_add_bool(obj
, "aes-key-wrap",
540 machine_get_aes_key_wrap
,
541 machine_set_aes_key_wrap
, NULL
);
542 object_property_set_description(obj
, "aes-key-wrap",
543 "enable/disable AES key wrapping using the CPACF wrapping key",
545 object_property_set_bool(obj
, true, "aes-key-wrap", NULL
);
547 object_property_add_bool(obj
, "dea-key-wrap",
548 machine_get_dea_key_wrap
,
549 machine_set_dea_key_wrap
, NULL
);
550 object_property_set_description(obj
, "dea-key-wrap",
551 "enable/disable DEA key wrapping using the CPACF wrapping key",
553 object_property_set_bool(obj
, true, "dea-key-wrap", NULL
);
554 object_property_add_str(obj
, "loadparm",
555 machine_get_loadparm
, machine_set_loadparm
, NULL
);
556 object_property_set_description(obj
, "loadparm",
557 "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
558 " to upper case) to pass to machine loader, boot manager,"
561 object_property_add_bool(obj
, "s390-squash-mcss",
562 machine_get_squash_mcss
,
563 machine_set_squash_mcss
, NULL
);
564 object_property_set_description(obj
, "s390-squash-mcss",
565 "enable/disable squashing subchannels into the default css",
567 object_property_set_bool(obj
, false, "s390-squash-mcss", NULL
);
570 static const TypeInfo ccw_machine_info
= {
571 .name
= TYPE_S390_CCW_MACHINE
,
572 .parent
= TYPE_MACHINE
,
574 .instance_size
= sizeof(S390CcwMachineState
),
575 .instance_init
= s390_machine_initfn
,
576 .class_size
= sizeof(S390CcwMachineClass
),
577 .class_init
= ccw_machine_class_init
,
578 .interfaces
= (InterfaceInfo
[]) {
580 { TYPE_HOTPLUG_HANDLER
},
585 bool css_migration_enabled(void)
587 return get_machine_class()->css_migration_enabled
;
590 #define DEFINE_CCW_MACHINE(suffix, verstr, latest) \
591 static void ccw_machine_##suffix##_class_init(ObjectClass *oc, \
594 MachineClass *mc = MACHINE_CLASS(oc); \
595 ccw_machine_##suffix##_class_options(mc); \
596 mc->desc = "VirtIO-ccw based S390 machine v" verstr; \
598 mc->alias = "s390-ccw-virtio"; \
599 mc->is_default = 1; \
602 static void ccw_machine_##suffix##_instance_init(Object *obj) \
604 MachineState *machine = MACHINE(obj); \
605 current_mc = S390_MACHINE_CLASS(MACHINE_GET_CLASS(machine)); \
606 ccw_machine_##suffix##_instance_options(machine); \
608 static const TypeInfo ccw_machine_##suffix##_info = { \
609 .name = MACHINE_TYPE_NAME("s390-ccw-virtio-" verstr), \
610 .parent = TYPE_S390_CCW_MACHINE, \
611 .class_init = ccw_machine_##suffix##_class_init, \
612 .instance_init = ccw_machine_##suffix##_instance_init, \
614 static void ccw_machine_register_##suffix(void) \
616 type_register_static(&ccw_machine_##suffix##_info); \
618 type_init(ccw_machine_register_##suffix)
620 #define CCW_COMPAT_2_10 \
623 #define CCW_COMPAT_2_9 \
626 .driver = TYPE_S390_STATTRIB,\
627 .property = "migration-enabled",\
631 #define CCW_COMPAT_2_8 \
634 .driver = TYPE_S390_FLIC_COMMON,\
635 .property = "adapter_routes_max_batch",\
639 #define CCW_COMPAT_2_7 \
642 #define CCW_COMPAT_2_6 \
645 .driver = TYPE_S390_IPL,\
646 .property = "iplbext_migration",\
649 .driver = TYPE_VIRTUAL_CSS_BRIDGE,\
650 .property = "css_dev_path",\
654 #define CCW_COMPAT_2_5 \
657 #define CCW_COMPAT_2_4 \
660 .driver = TYPE_S390_SKEYS,\
661 .property = "migration-enabled",\
664 .driver = "virtio-blk-ccw",\
665 .property = "max_revision",\
668 .driver = "virtio-balloon-ccw",\
669 .property = "max_revision",\
672 .driver = "virtio-serial-ccw",\
673 .property = "max_revision",\
676 .driver = "virtio-9p-ccw",\
677 .property = "max_revision",\
680 .driver = "virtio-rng-ccw",\
681 .property = "max_revision",\
684 .driver = "virtio-net-ccw",\
685 .property = "max_revision",\
688 .driver = "virtio-scsi-ccw",\
689 .property = "max_revision",\
692 .driver = "vhost-scsi-ccw",\
693 .property = "max_revision",\
697 static void ccw_machine_2_11_instance_options(MachineState
*machine
)
701 static void ccw_machine_2_11_class_options(MachineClass
*mc
)
704 DEFINE_CCW_MACHINE(2_11
, "2.11", true);
706 static void ccw_machine_2_10_instance_options(MachineState
*machine
)
708 ccw_machine_2_11_instance_options(machine
);
709 if (css_migration_enabled()) {
710 css_register_vmstate();
714 static void ccw_machine_2_10_class_options(MachineClass
*mc
)
716 ccw_machine_2_11_class_options(mc
);
717 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_10
);
719 DEFINE_CCW_MACHINE(2_10
, "2.10", false);
721 static void ccw_machine_2_9_instance_options(MachineState
*machine
)
723 ccw_machine_2_10_instance_options(machine
);
724 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ESOP
);
725 s390_cpudef_featoff_greater(12, 1, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2
);
726 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ZPCI
);
727 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_INT_SUPPRESSION
);
728 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_EVENT_NOTIFICATION
);
731 static void ccw_machine_2_9_class_options(MachineClass
*mc
)
733 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
735 s390mc
->gs_allowed
= false;
736 ccw_machine_2_10_class_options(mc
);
737 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_9
);
738 s390mc
->css_migration_enabled
= false;
740 DEFINE_CCW_MACHINE(2_9
, "2.9", false);
742 static void ccw_machine_2_8_instance_options(MachineState
*machine
)
744 ccw_machine_2_9_instance_options(machine
);
747 static void ccw_machine_2_8_class_options(MachineClass
*mc
)
749 ccw_machine_2_9_class_options(mc
);
750 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_8
);
752 DEFINE_CCW_MACHINE(2_8
, "2.8", false);
754 static void ccw_machine_2_7_instance_options(MachineState
*machine
)
756 ccw_machine_2_8_instance_options(machine
);
759 static void ccw_machine_2_7_class_options(MachineClass
*mc
)
761 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
763 s390mc
->cpu_model_allowed
= false;
764 ccw_machine_2_8_class_options(mc
);
765 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_7
);
767 DEFINE_CCW_MACHINE(2_7
, "2.7", false);
769 static void ccw_machine_2_6_instance_options(MachineState
*machine
)
771 ccw_machine_2_7_instance_options(machine
);
774 static void ccw_machine_2_6_class_options(MachineClass
*mc
)
776 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
778 s390mc
->ri_allowed
= false;
779 ccw_machine_2_7_class_options(mc
);
780 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_6
);
782 DEFINE_CCW_MACHINE(2_6
, "2.6", false);
784 static void ccw_machine_2_5_instance_options(MachineState
*machine
)
786 ccw_machine_2_6_instance_options(machine
);
789 static void ccw_machine_2_5_class_options(MachineClass
*mc
)
791 ccw_machine_2_6_class_options(mc
);
792 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_5
);
794 DEFINE_CCW_MACHINE(2_5
, "2.5", false);
796 static void ccw_machine_2_4_instance_options(MachineState
*machine
)
798 ccw_machine_2_5_instance_options(machine
);
801 static void ccw_machine_2_4_class_options(MachineClass
*mc
)
803 ccw_machine_2_5_class_options(mc
);
804 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_4
);
806 DEFINE_CCW_MACHINE(2_4
, "2.4", false);
808 static void ccw_machine_register_types(void)
810 type_register_static(&ccw_machine_info
);
813 type_init(ccw_machine_register_types
)