blob: 996864a34e2d9e8fcd15c71b8e370f93f54a84fc [file] [log] [blame]
Janosch Frank8b8a61a2016-03-07 09:04:21 +01001/*
2 * virtio ccw machine definitions
3 *
4 * Copyright 2012, 2016 IBM Corp.
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
9 * directory.
10 */
11#ifndef HW_S390X_S390_VIRTIO_CCW_H
12#define HW_S390X_S390_VIRTIO_CCW_H
13
14#include "hw/boards.h"
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040015#include "qom/object.h"
Cédric Le Goaterb350f6c2024-05-02 15:15:31 +020016#include "hw/s390x/sclp.h"
Janosch Frank8b8a61a2016-03-07 09:04:21 +010017
18#define TYPE_S390_CCW_MACHINE "s390-ccw-machine"
19
Eduardo Habkosta489d192020-09-16 14:25:18 -040020OBJECT_DECLARE_TYPE(S390CcwMachineState, S390CcwMachineClass, S390_CCW_MACHINE)
Janosch Frank8b8a61a2016-03-07 09:04:21 +010021
Janosch Frank8b8a61a2016-03-07 09:04:21 +010022
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040023struct S390CcwMachineState {
Janosch Frank8b8a61a2016-03-07 09:04:21 +010024 /*< private >*/
25 MachineState parent_obj;
26
27 /*< public >*/
28 bool aes_key_wrap;
29 bool dea_key_wrap;
Janosch Frankc3347ed2020-03-23 04:36:06 -040030 bool pv;
Farhan Ali7104bae2016-03-29 16:18:47 +020031 uint8_t loadparm[8];
Cédric Le Goaterb350f6c2024-05-02 15:15:31 +020032
33 SCLPDevice *sclp;
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040034};
Janosch Frank8b8a61a2016-03-07 09:04:21 +010035
Pierre Morelaf37bad2023-10-16 20:39:11 +020036#define S390_PTF_REASON_NONE (0x00 << 8)
37#define S390_PTF_REASON_DONE (0x01 << 8)
38#define S390_PTF_REASON_BUSY (0x02 << 8)
39#define S390_TOPO_FC_MASK 0xffUL
40void s390_handle_ptf(S390CPU *cpu, uint8_t r1, uintptr_t ra);
41
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040042struct S390CcwMachineClass {
Janosch Frank8b8a61a2016-03-07 09:04:21 +010043 /*< private >*/
44 MachineClass parent_class;
45
46 /*< public >*/
Fan Zhang97002302016-03-09 13:11:17 +010047 bool ri_allowed;
Christian Borntraegere73316d2016-09-07 12:50:40 +020048 bool cpu_model_allowed;
Janosch Frank28221f92018-09-28 11:34:35 +020049 bool hpage_1m_allowed;
Pierre Morel6393b292022-11-03 18:01:41 +010050 int max_threads;
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040051};
Janosch Frank8b8a61a2016-03-07 09:04:21 +010052
Fan Zhang97002302016-03-09 13:11:17 +010053/* runtime-instrumentation allowed by the machine */
54bool ri_allowed(void);
Christian Borntraegere73316d2016-09-07 12:50:40 +020055/* cpu model allowed by the machine */
56bool cpu_model_allowed(void);
Janosch Frank28221f92018-09-28 11:34:35 +020057/* 1M huge page mappings allowed by the machine */
58bool hpage_1m_allowed(void);
Fan Zhang97002302016-03-09 13:11:17 +010059
Janosch Frank8b8a61a2016-03-07 09:04:21 +010060#endif