hw/clock: Only propagate clock changes if the clock is changed
[qemu.git] / include / hw / s390x / pv.h
1 /*
2 * Protected Virtualization header
3 *
4 * Copyright IBM Corp. 2020
5 * Author(s):
6 * Janosch Frank <frankja@linux.ibm.com>
7 *
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
10 * directory.
11 */
12 #ifndef HW_S390_PV_H
13 #define HW_S390_PV_H
14
15 #ifdef CONFIG_KVM
16 #include "cpu.h"
17 #include "hw/s390x/s390-virtio-ccw.h"
18
19 static inline bool s390_is_pv(void)
20 {
21 static S390CcwMachineState *ccw;
22 Object *obj;
23
24 if (ccw) {
25 return ccw->pv;
26 }
27
28 /* we have to bail out for the "none" machine */
29 obj = object_dynamic_cast(qdev_get_machine(),
30 TYPE_S390_CCW_MACHINE);
31 if (!obj) {
32 return false;
33 }
34 ccw = S390_CCW_MACHINE(obj);
35 return ccw->pv;
36 }
37
38 int s390_pv_vm_enable(void);
39 void s390_pv_vm_disable(void);
40 int s390_pv_set_sec_parms(uint64_t origin, uint64_t length);
41 int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tweak);
42 void s390_pv_prep_reset(void);
43 int s390_pv_verify(void);
44 void s390_pv_unshare(void);
45 void s390_pv_inject_reset_error(CPUState *cs);
46 #else /* CONFIG_KVM */
47 static inline bool s390_is_pv(void) { return false; }
48 static inline int s390_pv_vm_enable(void) { return 0; }
49 static inline void s390_pv_vm_disable(void) {}
50 static inline int s390_pv_set_sec_parms(uint64_t origin, uint64_t length) { return 0; }
51 static inline int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tweak) { return 0; }
52 static inline void s390_pv_prep_reset(void) {}
53 static inline int s390_pv_verify(void) { return 0; }
54 static inline void s390_pv_unshare(void) {}
55 static inline void s390_pv_inject_reset_error(CPUState *cs) {};
56 #endif /* CONFIG_KVM */
57
58 #endif /* HW_S390_PV_H */