2 * Copyright 2008 IBM Corporation.
3 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
5 * This work is licensed under the GNU GPL license version 2 or later.
12 #define TYPE_HOST_POWERPC_CPU "host-" TYPE_POWERPC_CPU
14 void kvmppc_init(void);
18 uint32_t kvmppc_get_tbfreq(void);
19 uint64_t kvmppc_get_clockfreq(void);
20 uint32_t kvmppc_get_vmx(void);
21 uint32_t kvmppc_get_dfp(void);
22 int kvmppc_get_hasidle(CPUPPCState
*env
);
23 int kvmppc_get_hypercall(CPUPPCState
*env
, uint8_t *buf
, int buf_len
);
24 int kvmppc_set_interrupt(PowerPCCPU
*cpu
, int irq
, int level
);
25 void kvmppc_set_papr(PowerPCCPU
*cpu
);
26 void kvmppc_set_mpic_proxy(PowerPCCPU
*cpu
, int mpic_proxy
);
27 int kvmppc_smt_threads(void);
28 #ifndef CONFIG_USER_ONLY
29 off_t
kvmppc_alloc_rma(const char *name
, MemoryRegion
*sysmem
);
30 void *kvmppc_create_spapr_tce(uint32_t liobn
, uint32_t window_size
, int *pfd
);
31 int kvmppc_remove_spapr_tce(void *table
, int pfd
, uint32_t window_size
);
32 int kvmppc_reset_htab(int shift_hint
);
33 uint64_t kvmppc_rma_size(uint64_t current_size
, unsigned int hash_shift
);
34 #endif /* !CONFIG_USER_ONLY */
35 int kvmppc_fixup_cpu(PowerPCCPU
*cpu
);
39 static inline uint32_t kvmppc_get_tbfreq(void)
44 static inline uint64_t kvmppc_get_clockfreq(void)
49 static inline uint32_t kvmppc_get_vmx(void)
54 static inline uint32_t kvmppc_get_dfp(void)
59 static inline int kvmppc_get_hasidle(CPUPPCState
*env
)
64 static inline int kvmppc_get_hypercall(CPUPPCState
*env
, uint8_t *buf
, int buf_len
)
69 static inline int kvmppc_read_segment_page_sizes(uint32_t *prop
, int maxcells
)
74 static inline int kvmppc_set_interrupt(PowerPCCPU
*cpu
, int irq
, int level
)
79 static inline void kvmppc_set_papr(PowerPCCPU
*cpu
)
83 static inline void kvmppc_set_mpic_proxy(PowerPCCPU
*cpu
, int mpic_proxy
)
87 static inline int kvmppc_smt_threads(void)
92 #ifndef CONFIG_USER_ONLY
93 static inline off_t
kvmppc_alloc_rma(const char *name
, MemoryRegion
*sysmem
)
98 static inline void *kvmppc_create_spapr_tce(uint32_t liobn
,
99 uint32_t window_size
, int *fd
)
104 static inline int kvmppc_remove_spapr_tce(void *table
, int pfd
,
105 uint32_t window_size
)
110 static inline int kvmppc_reset_htab(int shift_hint
)
115 static inline uint64_t kvmppc_rma_size(uint64_t current_size
,
116 unsigned int hash_shift
)
121 static inline int kvmppc_update_sdr1(CPUPPCState
*env
)
126 #endif /* !CONFIG_USER_ONLY */
128 static inline int kvmppc_fixup_cpu(PowerPCCPU
*cpu
)
135 #define kvmppc_eieio() do { } while (0)
137 #define kvmppc_eieio() \
139 if (kvm_enabled()) { \
140 asm volatile("eieio" : : : "memory"); \
145 #ifndef KVM_INTERRUPT_SET
146 #define KVM_INTERRUPT_SET -1
149 #ifndef KVM_INTERRUPT_UNSET
150 #define KVM_INTERRUPT_UNSET -2
153 #ifndef KVM_INTERRUPT_SET_LEVEL
154 #define KVM_INTERRUPT_SET_LEVEL -3
157 #endif /* __KVM_PPC_H__ */