Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 1 | /* |
| 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 Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 15 | #include "qom/object.h" |
Cédric Le Goater | b350f6c | 2024-05-02 15:15:31 +0200 | [diff] [blame] | 16 | #include "hw/s390x/sclp.h" |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 17 | |
| 18 | #define TYPE_S390_CCW_MACHINE "s390-ccw-machine" |
| 19 | |
Eduardo Habkost | a489d19 | 2020-09-16 14:25:18 -0400 | [diff] [blame] | 20 | OBJECT_DECLARE_TYPE(S390CcwMachineState, S390CcwMachineClass, S390_CCW_MACHINE) |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 21 | |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 22 | |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 23 | struct S390CcwMachineState { |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 24 | /*< private >*/ |
| 25 | MachineState parent_obj; |
| 26 | |
| 27 | /*< public >*/ |
| 28 | bool aes_key_wrap; |
| 29 | bool dea_key_wrap; |
Janosch Frank | c3347ed | 2020-03-23 04:36:06 -0400 | [diff] [blame] | 30 | bool pv; |
Farhan Ali | 7104bae | 2016-03-29 16:18:47 +0200 | [diff] [blame] | 31 | uint8_t loadparm[8]; |
Cédric Le Goater | b350f6c | 2024-05-02 15:15:31 +0200 | [diff] [blame] | 32 | |
| 33 | SCLPDevice *sclp; |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 34 | }; |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 35 | |
Pierre Morel | af37bad | 2023-10-16 20:39:11 +0200 | [diff] [blame] | 36 | #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 |
| 40 | void s390_handle_ptf(S390CPU *cpu, uint8_t r1, uintptr_t ra); |
| 41 | |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 42 | struct S390CcwMachineClass { |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 43 | /*< private >*/ |
| 44 | MachineClass parent_class; |
| 45 | |
| 46 | /*< public >*/ |
Fan Zhang | 9700230 | 2016-03-09 13:11:17 +0100 | [diff] [blame] | 47 | bool ri_allowed; |
Christian Borntraeger | e73316d | 2016-09-07 12:50:40 +0200 | [diff] [blame] | 48 | bool cpu_model_allowed; |
Janosch Frank | 28221f9 | 2018-09-28 11:34:35 +0200 | [diff] [blame] | 49 | bool hpage_1m_allowed; |
Pierre Morel | 6393b29 | 2022-11-03 18:01:41 +0100 | [diff] [blame] | 50 | int max_threads; |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 51 | }; |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 52 | |
Fan Zhang | 9700230 | 2016-03-09 13:11:17 +0100 | [diff] [blame] | 53 | /* runtime-instrumentation allowed by the machine */ |
| 54 | bool ri_allowed(void); |
Christian Borntraeger | e73316d | 2016-09-07 12:50:40 +0200 | [diff] [blame] | 55 | /* cpu model allowed by the machine */ |
| 56 | bool cpu_model_allowed(void); |
Janosch Frank | 28221f9 | 2018-09-28 11:34:35 +0200 | [diff] [blame] | 57 | /* 1M huge page mappings allowed by the machine */ |
| 58 | bool hpage_1m_allowed(void); |
Fan Zhang | 9700230 | 2016-03-09 13:11:17 +0100 | [diff] [blame] | 59 | |
Janosch Frank | 8b8a61a | 2016-03-07 09:04:21 +0100 | [diff] [blame] | 60 | #endif |