]>
git.proxmox.com Git - mirror_qemu.git/blob - include/hw/s390x/pv.h
2 * Protected Virtualization header
4 * Copyright IBM Corp. 2020
6 * Janosch Frank <frankja@linux.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
15 #include "qapi/error.h"
16 #include "sysemu/kvm.h"
17 #include "hw/s390x/s390-virtio-ccw.h"
22 static inline bool s390_is_pv(void)
24 static S390CcwMachineState
*ccw
;
31 /* we have to bail out for the "none" machine */
32 obj
= object_dynamic_cast(qdev_get_machine(),
33 TYPE_S390_CCW_MACHINE
);
37 ccw
= S390_CCW_MACHINE(obj
);
41 int s390_pv_query_info(void);
42 int s390_pv_vm_enable(void);
43 void s390_pv_vm_disable(void);
44 bool s390_pv_vm_try_disable_async(S390CcwMachineState
*ms
);
45 int s390_pv_set_sec_parms(uint64_t origin
, uint64_t length
);
46 int s390_pv_unpack(uint64_t addr
, uint64_t size
, uint64_t tweak
);
47 void s390_pv_prep_reset(void);
48 int s390_pv_verify(void);
49 void s390_pv_unshare(void);
50 void s390_pv_inject_reset_error(CPUState
*cs
);
51 uint64_t kvm_s390_pv_dmp_get_size_cpu(void);
52 uint64_t kvm_s390_pv_dmp_get_size_mem_state(void);
53 uint64_t kvm_s390_pv_dmp_get_size_completion_data(void);
54 bool kvm_s390_pv_info_basic_valid(void);
55 int kvm_s390_dump_init(void);
56 int kvm_s390_dump_cpu(S390CPU
*cpu
, void *buff
);
57 int kvm_s390_dump_mem_state(uint64_t addr
, size_t len
, void *dest
);
58 int kvm_s390_dump_completion_data(void *buff
);
59 #else /* CONFIG_KVM */
60 static inline bool s390_is_pv(void) { return false; }
61 static inline int s390_pv_query_info(void) { return 0; }
62 static inline int s390_pv_vm_enable(void) { return 0; }
63 static inline void s390_pv_vm_disable(void) {}
64 static inline bool s390_pv_vm_try_disable_async(S390CcwMachineState
*ms
) { return false; }
65 static inline int s390_pv_set_sec_parms(uint64_t origin
, uint64_t length
) { return 0; }
66 static inline int s390_pv_unpack(uint64_t addr
, uint64_t size
, uint64_t tweak
) { return 0; }
67 static inline void s390_pv_prep_reset(void) {}
68 static inline int s390_pv_verify(void) { return 0; }
69 static inline void s390_pv_unshare(void) {}
70 static inline void s390_pv_inject_reset_error(CPUState
*cs
) {};
71 static inline uint64_t kvm_s390_pv_dmp_get_size_cpu(void) { return 0; }
72 static inline uint64_t kvm_s390_pv_dmp_get_size_mem_state(void) { return 0; }
73 static inline uint64_t kvm_s390_pv_dmp_get_size_completion_data(void) { return 0; }
74 static inline bool kvm_s390_pv_info_basic_valid(void) { return false; }
75 static inline int kvm_s390_dump_init(void) { return 0; }
76 static inline int kvm_s390_dump_cpu(S390CPU
*cpu
, void *buff
) { return 0; }
77 static inline int kvm_s390_dump_mem_state(uint64_t addr
, size_t len
,
78 void *dest
) { return 0; }
79 static inline int kvm_s390_dump_completion_data(void *buff
) { return 0; }
80 #endif /* CONFIG_KVM */
82 int s390_pv_kvm_init(ConfidentialGuestSupport
*cgs
, Error
**errp
);
83 static inline int s390_pv_init(ConfidentialGuestSupport
*cgs
, Error
**errp
)
89 return s390_pv_kvm_init(cgs
, errp
);
92 error_setg(errp
, "Protected Virtualization requires KVM");
96 #endif /* HW_S390_PV_H */