]> git.proxmox.com Git - qemu.git/blame - target-ppc/kvm_ppc.h
pseries: Correct vmx/dfp handling in both KVM and TCG cases
[qemu.git] / target-ppc / kvm_ppc.h
CommitLineData
d76d1650
AJ
1/*
2 * Copyright 2008 IBM Corporation.
3 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
4 *
5 * This work is licensed under the GNU GPL license version 2 or later.
6 *
7 */
8
9#ifndef __KVM_PPC_H__
10#define __KVM_PPC_H__
11
354ac20a
DG
12#include "memory.h"
13
d76d1650 14void kvmppc_init(void);
d76d1650 15
921e28db
AG
16#ifdef CONFIG_KVM
17
dc333cd6 18uint32_t kvmppc_get_tbfreq(void);
eadaada1 19uint64_t kvmppc_get_clockfreq(void);
6659394f
DG
20uint32_t kvmppc_get_vmx(void);
21uint32_t kvmppc_get_dfp(void);
45024f09 22int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
fc87e185 23int kvmppc_set_interrupt(CPUState *env, int irq, int level);
f61b4bed 24void kvmppc_set_papr(CPUState *env);
e97c3636 25int kvmppc_smt_threads(void);
354ac20a 26off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
0f5cb298
DG
27void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
28int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size);
a1e98583 29const ppc_def_t *kvmppc_host_cpu_def(void);
fc87e185 30
921e28db
AG
31#else
32
33static inline uint32_t kvmppc_get_tbfreq(void)
34{
35 return 0;
36}
37
38static inline uint64_t kvmppc_get_clockfreq(void)
39{
40 return 0;
41}
42
6659394f
DG
43static inline uint32_t kvmppc_get_vmx(void)
44{
45 return 0;
46}
47
48static inline uint32_t kvmppc_get_dfp(void)
49{
50 return 0;
51}
52
921e28db
AG
53static inline int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)
54{
55 return -1;
56}
57
58static inline int kvmppc_set_interrupt(CPUState *env, int irq, int level)
59{
60 return -1;
61}
62
f61b4bed
AG
63static inline void kvmppc_set_papr(CPUState *env)
64{
65}
66
e97c3636
DG
67static inline int kvmppc_smt_threads(void)
68{
69 return 1;
70}
71
354ac20a
DG
72static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
73{
74 return 0;
75}
76
0f5cb298
DG
77static inline void *kvmppc_create_spapr_tce(uint32_t liobn,
78 uint32_t window_size, int *fd)
79{
80 return NULL;
81}
82
83static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
84 uint32_t window_size)
85{
86 return -1;
87}
88
a1e98583
DG
89static inline const ppc_def_t *kvmppc_host_cpu_def(void)
90{
91 return NULL;
92}
93
921e28db
AG
94#endif
95
b45d63b6
BH
96#ifndef CONFIG_KVM
97#define kvmppc_eieio() do { } while (0)
98#else
99#define kvmppc_eieio() \
100 do { \
101 if (kvm_enabled()) { \
102 asm volatile("eieio" : : : "memory"); \
103 } \
104 } while (0)
105#endif
106
fc87e185
AG
107#ifndef KVM_INTERRUPT_SET
108#define KVM_INTERRUPT_SET -1
109#endif
110
111#ifndef KVM_INTERRUPT_UNSET
112#define KVM_INTERRUPT_UNSET -2
113#endif
114
115#ifndef KVM_INTERRUPT_SET_LEVEL
116#define KVM_INTERRUPT_SET_LEVEL -3
117#endif
dc333cd6 118
d76d1650 119#endif /* __KVM_PPC_H__ */