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"
16 #include "hw/boards.h"
17 #include "exec/address-spaces.h"
18 #include "hw/s390x/s390-virtio-hcall.h"
19 #include "hw/s390x/sclp.h"
20 #include "hw/s390x/s390_flic.h"
21 #include "hw/s390x/ioinst.h"
22 #include "hw/s390x/css.h"
23 #include "virtio-ccw.h"
24 #include "qemu/config-file.h"
25 #include "qemu/error-report.h"
26 #include "qemu/option.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"
38 S390CPU
*s390_cpu_addr2state(uint16_t cpu_addr
)
40 static MachineState
*ms
;
43 ms
= MACHINE(qdev_get_machine());
44 g_assert(ms
->possible_cpus
);
47 /* CPU address corresponds to the core_id and the index */
48 if (cpu_addr
>= ms
->possible_cpus
->len
) {
51 return S390_CPU(ms
->possible_cpus
->cpus
[cpu_addr
].cpu
);
54 static S390CPU
*s390x_new_cpu(const char *typename
, uint32_t core_id
,
57 S390CPU
*cpu
= S390_CPU(object_new(typename
));
60 object_property_set_int(OBJECT(cpu
), core_id
, "core-id", &err
);
64 object_property_set_bool(OBJECT(cpu
), true, "realized", &err
);
67 object_unref(OBJECT(cpu
));
69 error_propagate(errp
, err
);
75 static void s390_init_cpus(MachineState
*machine
)
77 MachineClass
*mc
= MACHINE_GET_CLASS(machine
);
80 /* initialize possible_cpus */
81 mc
->possible_cpu_arch_ids(machine
);
83 for (i
= 0; i
< smp_cpus
; i
++) {
84 s390x_new_cpu(machine
->cpu_type
, i
, &error_fatal
);
88 static const char *const reset_dev_types
[] = {
89 TYPE_VIRTUAL_CSS_BRIDGE
,
90 "s390-sclp-event-facility",
95 void subsystem_reset(void)
100 for (i
= 0; i
< ARRAY_SIZE(reset_dev_types
); i
++) {
101 dev
= DEVICE(object_resolve_path_type("", reset_dev_types
[i
], NULL
));
108 static int virtio_ccw_hcall_notify(const uint64_t *args
)
110 uint64_t subch_id
= args
[0];
111 uint64_t queue
= args
[1];
113 int cssid
, ssid
, schid
, m
;
115 if (ioinst_disassemble_sch_ident(subch_id
, &m
, &cssid
, &ssid
, &schid
)) {
118 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
119 if (!sch
|| !css_subch_visible(sch
)) {
122 if (queue
>= VIRTIO_QUEUE_MAX
) {
125 virtio_queue_notify(virtio_ccw_get_vdev(sch
), queue
);
130 static int virtio_ccw_hcall_early_printk(const uint64_t *args
)
132 uint64_t mem
= args
[0];
134 if (mem
< ram_size
) {
141 static void virtio_ccw_register_hcalls(void)
143 s390_register_virtio_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY
,
144 virtio_ccw_hcall_notify
);
145 /* Tolerate early printk. */
146 s390_register_virtio_hypercall(KVM_S390_VIRTIO_NOTIFY
,
147 virtio_ccw_hcall_early_printk
);
151 * KVM does only support memory slots up to KVM_MEM_MAX_NR_PAGES pages
152 * as the dirty bitmap must be managed by bitops that take an int as
153 * position indicator. If we have a guest beyond that we will split off
154 * new subregions. The split must happen on a segment boundary (1MB).
156 #define KVM_MEM_MAX_NR_PAGES ((1ULL << 31) - 1)
157 #define SEG_MSK (~0xfffffULL)
158 #define KVM_SLOT_MAX_BYTES ((KVM_MEM_MAX_NR_PAGES * TARGET_PAGE_SIZE) & SEG_MSK)
159 static void s390_memory_init(ram_addr_t mem_size
)
161 MemoryRegion
*sysmem
= get_system_memory();
162 ram_addr_t chunk
, offset
= 0;
163 unsigned int number
= 0;
166 /* allocate RAM for core */
167 name
= g_strdup_printf("s390.ram");
169 MemoryRegion
*ram
= g_new(MemoryRegion
, 1);
170 uint64_t size
= mem_size
;
172 /* KVM does not allow memslots >= 8 TB */
173 chunk
= MIN(size
, KVM_SLOT_MAX_BYTES
);
174 memory_region_allocate_system_memory(ram
, NULL
, name
, chunk
);
175 memory_region_add_subregion(sysmem
, offset
, ram
);
179 name
= g_strdup_printf("s390.ram.%u", ++number
);
183 /* Initialize storage key device */
185 /* Initialize storage attributes device */
186 s390_stattrib_init();
189 #define S390_TOD_CLOCK_VALUE_MISSING 0x00
190 #define S390_TOD_CLOCK_VALUE_PRESENT 0x01
192 static void gtod_save(QEMUFile
*f
, void *opaque
)
198 r
= s390_get_clock(&tod_high
, &tod_low
);
200 warn_report("Unable to get guest clock for migration: %s",
202 error_printf("Guest clock will not be migrated "
203 "which could cause the guest to hang.");
204 qemu_put_byte(f
, S390_TOD_CLOCK_VALUE_MISSING
);
208 qemu_put_byte(f
, S390_TOD_CLOCK_VALUE_PRESENT
);
209 qemu_put_byte(f
, tod_high
);
210 qemu_put_be64(f
, tod_low
);
213 static int gtod_load(QEMUFile
*f
, void *opaque
, int version_id
)
219 if (qemu_get_byte(f
) == S390_TOD_CLOCK_VALUE_MISSING
) {
220 warn_report("Guest clock was not migrated. This could "
221 "cause the guest to hang.");
225 tod_high
= qemu_get_byte(f
);
226 tod_low
= qemu_get_be64(f
);
228 r
= s390_set_clock(&tod_high
, &tod_low
);
230 error_report("Unable to set KVM guest TOD clock: %s", strerror(-r
));
236 static SaveVMHandlers savevm_gtod
= {
237 .save_state
= gtod_save
,
238 .load_state
= gtod_load
,
241 static void s390_init_ipl_dev(const char *kernel_filename
,
242 const char *kernel_cmdline
,
243 const char *initrd_filename
, const char *firmware
,
244 const char *netboot_fw
, bool enforce_bios
)
246 Object
*new = object_new(TYPE_S390_IPL
);
247 DeviceState
*dev
= DEVICE(new);
249 if (kernel_filename
) {
250 qdev_prop_set_string(dev
, "kernel", kernel_filename
);
252 if (initrd_filename
) {
253 qdev_prop_set_string(dev
, "initrd", initrd_filename
);
255 qdev_prop_set_string(dev
, "cmdline", kernel_cmdline
);
256 qdev_prop_set_string(dev
, "firmware", firmware
);
257 qdev_prop_set_string(dev
, "netboot_fw", netboot_fw
);
258 qdev_prop_set_bit(dev
, "enforce_bios", enforce_bios
);
259 object_property_add_child(qdev_get_machine(), TYPE_S390_IPL
,
262 qdev_init_nofail(dev
);
265 static void s390_create_virtio_net(BusState
*bus
, const char *name
)
269 for (i
= 0; i
< nb_nics
; i
++) {
270 NICInfo
*nd
= &nd_table
[i
];
274 nd
->model
= g_strdup("virtio");
277 qemu_check_nic_model(nd
, "virtio");
279 dev
= qdev_create(bus
, name
);
280 qdev_set_nic_properties(dev
, nd
);
281 qdev_init_nofail(dev
);
285 static void ccw_init(MachineState
*machine
)
288 VirtualCssBus
*css_bus
;
292 s390_memory_init(machine
->ram_size
);
294 /* init CPUs (incl. CPU model) early so s390_has_feature() works */
295 s390_init_cpus(machine
);
299 /* init the SIGP facility */
303 css_bus
= virtual_css_bus_init();
304 s390_init_ipl_dev(machine
->kernel_filename
, machine
->kernel_cmdline
,
305 machine
->initrd_filename
, "s390-ccw.img",
306 "s390-netboot.img", true);
309 * We cannot easily make the pci host bridge conditional as older QEMUs
310 * always created it. Doing so would break migration across QEMU versions.
312 dev
= qdev_create(NULL
, TYPE_S390_PCI_HOST_BRIDGE
);
313 object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE
,
315 qdev_init_nofail(dev
);
317 /* register hypercalls */
318 virtio_ccw_register_hcalls();
320 s390_enable_css_support(s390_cpu_addr2state(0));
322 * Non mcss-e enabled guests only see the devices from the default
323 * css, which is determined by the value of the squash_mcss property.
325 if (css_bus
->squash_mcss
) {
326 ret
= css_create_css_image(0, true);
328 ret
= css_create_css_image(VIRTUAL_CSSID
, true);
330 if (qemu_opt_get(qemu_get_machine_opts(), "s390-squash-mcss")) {
331 warn_report("The machine property 's390-squash-mcss' is deprecated"
332 " (obsoleted by lifting the cssid restrictions).");
336 if (css_migration_enabled()) {
337 css_register_vmstate();
340 /* Create VirtIO network adapters */
341 s390_create_virtio_net(BUS(css_bus
), "virtio-net-ccw");
343 /* Register savevm handler for guest TOD clock */
344 register_savevm_live(NULL
, "todclock", 0, 1, &savevm_gtod
, NULL
);
347 static void s390_cpu_plug(HotplugHandler
*hotplug_dev
,
348 DeviceState
*dev
, Error
**errp
)
350 MachineState
*ms
= MACHINE(hotplug_dev
);
351 S390CPU
*cpu
= S390_CPU(dev
);
353 g_assert(!ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
);
354 ms
->possible_cpus
->cpus
[cpu
->env
.core_id
].cpu
= OBJECT(dev
);
356 if (dev
->hotplugged
) {
357 raise_irq_cpu_hotplug();
361 static void s390_machine_reset(void)
363 S390CPU
*ipl_cpu
= S390_CPU(qemu_get_cpu(0));
366 qemu_devices_reset();
369 /* all cpus are stopped - configure and start the ipl cpu only */
370 s390_ipl_prepare_cpu(ipl_cpu
);
371 s390_cpu_set_state(CPU_STATE_OPERATING
, ipl_cpu
);
374 static void s390_machine_device_plug(HotplugHandler
*hotplug_dev
,
375 DeviceState
*dev
, Error
**errp
)
377 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
378 s390_cpu_plug(hotplug_dev
, dev
, errp
);
382 static void s390_machine_device_unplug_request(HotplugHandler
*hotplug_dev
,
383 DeviceState
*dev
, Error
**errp
)
385 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
386 error_setg(errp
, "CPU hot unplug not supported on this machine");
391 static CpuInstanceProperties
s390_cpu_index_to_props(MachineState
*machine
,
394 g_assert(machine
->possible_cpus
&& cpu_index
< machine
->possible_cpus
->len
);
396 return machine
->possible_cpus
->cpus
[cpu_index
].props
;
399 static const CPUArchIdList
*s390_possible_cpu_arch_ids(MachineState
*ms
)
403 if (ms
->possible_cpus
) {
404 g_assert(ms
->possible_cpus
&& ms
->possible_cpus
->len
== max_cpus
);
405 return ms
->possible_cpus
;
408 ms
->possible_cpus
= g_malloc0(sizeof(CPUArchIdList
) +
409 sizeof(CPUArchId
) * max_cpus
);
410 ms
->possible_cpus
->len
= max_cpus
;
411 for (i
= 0; i
< ms
->possible_cpus
->len
; i
++) {
412 ms
->possible_cpus
->cpus
[i
].type
= ms
->cpu_type
;
413 ms
->possible_cpus
->cpus
[i
].vcpus_count
= 1;
414 ms
->possible_cpus
->cpus
[i
].arch_id
= i
;
415 ms
->possible_cpus
->cpus
[i
].props
.has_core_id
= true;
416 ms
->possible_cpus
->cpus
[i
].props
.core_id
= i
;
419 return ms
->possible_cpus
;
422 static HotplugHandler
*s390_get_hotplug_handler(MachineState
*machine
,
425 if (object_dynamic_cast(OBJECT(dev
), TYPE_CPU
)) {
426 return HOTPLUG_HANDLER(machine
);
431 static void s390_hot_add_cpu(const int64_t id
, Error
**errp
)
433 MachineState
*machine
= MACHINE(qdev_get_machine());
436 g_assert(machine
->possible_cpus
->cpus
[0].cpu
);
437 oc
= OBJECT_CLASS(CPU_GET_CLASS(machine
->possible_cpus
->cpus
[0].cpu
));
439 s390x_new_cpu(object_class_get_name(oc
), id
, errp
);
442 static void s390_nmi(NMIState
*n
, int cpu_index
, Error
**errp
)
444 CPUState
*cs
= qemu_get_cpu(cpu_index
);
446 s390_cpu_restart(S390_CPU(cs
));
449 static void ccw_machine_class_init(ObjectClass
*oc
, void *data
)
451 MachineClass
*mc
= MACHINE_CLASS(oc
);
452 NMIClass
*nc
= NMI_CLASS(oc
);
453 HotplugHandlerClass
*hc
= HOTPLUG_HANDLER_CLASS(oc
);
454 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
456 s390mc
->ri_allowed
= true;
457 s390mc
->cpu_model_allowed
= true;
458 s390mc
->css_migration_enabled
= true;
460 mc
->reset
= s390_machine_reset
;
461 mc
->hot_add_cpu
= s390_hot_add_cpu
;
462 mc
->block_default_type
= IF_VIRTIO
;
469 mc
->max_cpus
= S390_MAX_CPUS
;
470 mc
->has_hotpluggable_cpus
= true;
471 mc
->get_hotplug_handler
= s390_get_hotplug_handler
;
472 mc
->cpu_index_to_instance_props
= s390_cpu_index_to_props
;
473 mc
->possible_cpu_arch_ids
= s390_possible_cpu_arch_ids
;
474 /* it is overridden with 'host' cpu *in kvm_arch_init* */
475 mc
->default_cpu_type
= S390_CPU_TYPE_NAME("qemu");
476 hc
->plug
= s390_machine_device_plug
;
477 hc
->unplug_request
= s390_machine_device_unplug_request
;
478 nc
->nmi_monitor_handler
= s390_nmi
;
481 static inline bool machine_get_aes_key_wrap(Object
*obj
, Error
**errp
)
483 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
485 return ms
->aes_key_wrap
;
488 static inline void machine_set_aes_key_wrap(Object
*obj
, bool value
,
491 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
493 ms
->aes_key_wrap
= value
;
496 static inline bool machine_get_dea_key_wrap(Object
*obj
, Error
**errp
)
498 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
500 return ms
->dea_key_wrap
;
503 static inline void machine_set_dea_key_wrap(Object
*obj
, bool value
,
506 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
508 ms
->dea_key_wrap
= value
;
511 static S390CcwMachineClass
*current_mc
;
513 static S390CcwMachineClass
*get_machine_class(void)
515 if (unlikely(!current_mc
)) {
517 * No s390 ccw machine was instantiated, we are likely to
518 * be called for the 'none' machine. The properties will
519 * have their after-initialization values.
521 current_mc
= S390_MACHINE_CLASS(
522 object_class_by_name(TYPE_S390_CCW_MACHINE
));
527 bool ri_allowed(void)
529 /* for "none" machine this results in true */
530 return get_machine_class()->ri_allowed
;
533 bool cpu_model_allowed(void)
535 /* for "none" machine this results in true */
536 return get_machine_class()->cpu_model_allowed
;
539 static char *machine_get_loadparm(Object
*obj
, Error
**errp
)
541 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
543 return g_memdup(ms
->loadparm
, sizeof(ms
->loadparm
));
546 static void machine_set_loadparm(Object
*obj
, const char *val
, Error
**errp
)
548 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
551 for (i
= 0; i
< sizeof(ms
->loadparm
) && val
[i
]; i
++) {
552 uint8_t c
= qemu_toupper(val
[i
]); /* mimic HMC */
554 if (('A' <= c
&& c
<= 'Z') || ('0' <= c
&& c
<= '9') || (c
== '.') ||
558 error_setg(errp
, "LOADPARM: invalid character '%c' (ASCII 0x%02x)",
564 for (; i
< sizeof(ms
->loadparm
); i
++) {
565 ms
->loadparm
[i
] = ' '; /* pad right with spaces */
568 static inline bool machine_get_squash_mcss(Object
*obj
, Error
**errp
)
570 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
572 return ms
->s390_squash_mcss
;
575 static inline void machine_set_squash_mcss(Object
*obj
, bool value
,
578 S390CcwMachineState
*ms
= S390_CCW_MACHINE(obj
);
580 ms
->s390_squash_mcss
= value
;
583 static inline void s390_machine_initfn(Object
*obj
)
585 object_property_add_bool(obj
, "aes-key-wrap",
586 machine_get_aes_key_wrap
,
587 machine_set_aes_key_wrap
, NULL
);
588 object_property_set_description(obj
, "aes-key-wrap",
589 "enable/disable AES key wrapping using the CPACF wrapping key",
591 object_property_set_bool(obj
, true, "aes-key-wrap", NULL
);
593 object_property_add_bool(obj
, "dea-key-wrap",
594 machine_get_dea_key_wrap
,
595 machine_set_dea_key_wrap
, NULL
);
596 object_property_set_description(obj
, "dea-key-wrap",
597 "enable/disable DEA key wrapping using the CPACF wrapping key",
599 object_property_set_bool(obj
, true, "dea-key-wrap", NULL
);
600 object_property_add_str(obj
, "loadparm",
601 machine_get_loadparm
, machine_set_loadparm
, NULL
);
602 object_property_set_description(obj
, "loadparm",
603 "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
604 " to upper case) to pass to machine loader, boot manager,"
607 object_property_add_bool(obj
, "s390-squash-mcss",
608 machine_get_squash_mcss
,
609 machine_set_squash_mcss
, NULL
);
610 object_property_set_description(obj
, "s390-squash-mcss", "(deprecated) "
611 "enable/disable squashing subchannels into the default css",
613 object_property_set_bool(obj
, false, "s390-squash-mcss", NULL
);
616 static const TypeInfo ccw_machine_info
= {
617 .name
= TYPE_S390_CCW_MACHINE
,
618 .parent
= TYPE_MACHINE
,
620 .instance_size
= sizeof(S390CcwMachineState
),
621 .instance_init
= s390_machine_initfn
,
622 .class_size
= sizeof(S390CcwMachineClass
),
623 .class_init
= ccw_machine_class_init
,
624 .interfaces
= (InterfaceInfo
[]) {
626 { TYPE_HOTPLUG_HANDLER
},
631 bool css_migration_enabled(void)
633 return get_machine_class()->css_migration_enabled
;
636 #define DEFINE_CCW_MACHINE(suffix, verstr, latest) \
637 static void ccw_machine_##suffix##_class_init(ObjectClass *oc, \
640 MachineClass *mc = MACHINE_CLASS(oc); \
641 ccw_machine_##suffix##_class_options(mc); \
642 mc->desc = "VirtIO-ccw based S390 machine v" verstr; \
644 mc->alias = "s390-ccw-virtio"; \
645 mc->is_default = 1; \
648 static void ccw_machine_##suffix##_instance_init(Object *obj) \
650 MachineState *machine = MACHINE(obj); \
651 current_mc = S390_MACHINE_CLASS(MACHINE_GET_CLASS(machine)); \
652 ccw_machine_##suffix##_instance_options(machine); \
654 static const TypeInfo ccw_machine_##suffix##_info = { \
655 .name = MACHINE_TYPE_NAME("s390-ccw-virtio-" verstr), \
656 .parent = TYPE_S390_CCW_MACHINE, \
657 .class_init = ccw_machine_##suffix##_class_init, \
658 .instance_init = ccw_machine_##suffix##_instance_init, \
660 static void ccw_machine_register_##suffix(void) \
662 type_register_static(&ccw_machine_##suffix##_info); \
664 type_init(ccw_machine_register_##suffix)
666 #define CCW_COMPAT_2_11 \
669 #define CCW_COMPAT_2_10 \
672 #define CCW_COMPAT_2_9 \
675 .driver = TYPE_S390_STATTRIB,\
676 .property = "migration-enabled",\
680 #define CCW_COMPAT_2_8 \
683 .driver = TYPE_S390_FLIC_COMMON,\
684 .property = "adapter_routes_max_batch",\
688 #define CCW_COMPAT_2_7 \
691 #define CCW_COMPAT_2_6 \
694 .driver = TYPE_S390_IPL,\
695 .property = "iplbext_migration",\
698 .driver = TYPE_VIRTUAL_CSS_BRIDGE,\
699 .property = "css_dev_path",\
703 #define CCW_COMPAT_2_5 \
706 #define CCW_COMPAT_2_4 \
709 .driver = TYPE_S390_SKEYS,\
710 .property = "migration-enabled",\
713 .driver = "virtio-blk-ccw",\
714 .property = "max_revision",\
717 .driver = "virtio-balloon-ccw",\
718 .property = "max_revision",\
721 .driver = "virtio-serial-ccw",\
722 .property = "max_revision",\
725 .driver = "virtio-9p-ccw",\
726 .property = "max_revision",\
729 .driver = "virtio-rng-ccw",\
730 .property = "max_revision",\
733 .driver = "virtio-net-ccw",\
734 .property = "max_revision",\
737 .driver = "virtio-scsi-ccw",\
738 .property = "max_revision",\
741 .driver = "vhost-scsi-ccw",\
742 .property = "max_revision",\
746 static void ccw_machine_2_12_instance_options(MachineState
*machine
)
750 static void ccw_machine_2_12_class_options(MachineClass
*mc
)
753 DEFINE_CCW_MACHINE(2_12
, "2.12", true);
755 static void ccw_machine_2_11_instance_options(MachineState
*machine
)
757 static const S390FeatInit qemu_cpu_feat
= { S390_FEAT_LIST_QEMU_V2_11
};
758 ccw_machine_2_12_instance_options(machine
);
760 /* before 2.12 we emulated the very first z900 */
761 s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat
);
764 static void ccw_machine_2_11_class_options(MachineClass
*mc
)
766 ccw_machine_2_12_class_options(mc
);
767 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_11
);
769 DEFINE_CCW_MACHINE(2_11
, "2.11", false);
771 static void ccw_machine_2_10_instance_options(MachineState
*machine
)
773 ccw_machine_2_11_instance_options(machine
);
776 static void ccw_machine_2_10_class_options(MachineClass
*mc
)
778 ccw_machine_2_11_class_options(mc
);
779 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_10
);
781 DEFINE_CCW_MACHINE(2_10
, "2.10", false);
783 static void ccw_machine_2_9_instance_options(MachineState
*machine
)
785 ccw_machine_2_10_instance_options(machine
);
786 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ESOP
);
787 s390_cpudef_featoff_greater(12, 1, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2
);
788 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ZPCI
);
789 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_INT_SUPPRESSION
);
790 s390_cpudef_featoff_greater(12, 1, S390_FEAT_ADAPTER_EVENT_NOTIFICATION
);
793 static void ccw_machine_2_9_class_options(MachineClass
*mc
)
795 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
797 ccw_machine_2_10_class_options(mc
);
798 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_9
);
799 s390mc
->css_migration_enabled
= false;
801 DEFINE_CCW_MACHINE(2_9
, "2.9", false);
803 static void ccw_machine_2_8_instance_options(MachineState
*machine
)
805 ccw_machine_2_9_instance_options(machine
);
808 static void ccw_machine_2_8_class_options(MachineClass
*mc
)
810 ccw_machine_2_9_class_options(mc
);
811 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_8
);
813 DEFINE_CCW_MACHINE(2_8
, "2.8", false);
815 static void ccw_machine_2_7_instance_options(MachineState
*machine
)
817 ccw_machine_2_8_instance_options(machine
);
820 static void ccw_machine_2_7_class_options(MachineClass
*mc
)
822 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
824 s390mc
->cpu_model_allowed
= false;
825 ccw_machine_2_8_class_options(mc
);
826 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_7
);
828 DEFINE_CCW_MACHINE(2_7
, "2.7", false);
830 static void ccw_machine_2_6_instance_options(MachineState
*machine
)
832 ccw_machine_2_7_instance_options(machine
);
835 static void ccw_machine_2_6_class_options(MachineClass
*mc
)
837 S390CcwMachineClass
*s390mc
= S390_MACHINE_CLASS(mc
);
839 s390mc
->ri_allowed
= false;
840 ccw_machine_2_7_class_options(mc
);
841 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_6
);
843 DEFINE_CCW_MACHINE(2_6
, "2.6", false);
845 static void ccw_machine_2_5_instance_options(MachineState
*machine
)
847 ccw_machine_2_6_instance_options(machine
);
850 static void ccw_machine_2_5_class_options(MachineClass
*mc
)
852 ccw_machine_2_6_class_options(mc
);
853 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_5
);
855 DEFINE_CCW_MACHINE(2_5
, "2.5", false);
857 static void ccw_machine_2_4_instance_options(MachineState
*machine
)
859 ccw_machine_2_5_instance_options(machine
);
862 static void ccw_machine_2_4_class_options(MachineClass
*mc
)
864 ccw_machine_2_5_class_options(mc
);
865 SET_MACHINE_COMPAT(mc
, CCW_COMPAT_2_4
);
867 DEFINE_CCW_MACHINE(2_4
, "2.4", false);
869 static void ccw_machine_register_types(void)
871 type_register_static(&ccw_machine_info
);
874 type_init(ccw_machine_register_types
)