diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-29 08:01:17 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-29 10:35:53 -0400 |
commit | 656473003bc7e056c3bbd4a4d9832dad01e86f76 (patch) | |
tree | bc703dbf33c098a13c028aad2a99d9fba2a21643 /arch | |
parent | d5b77069701600b8189d3b4409b69f23ac4f5bc2 (diff) |
KVM: forward declare structs in kvm_types.h
Opaque KVM structs are useful for prototypes in asm/kvm_host.h, to avoid
"'struct foo' declared inside parameter list" warnings (and consequent
breakage due to conflicting types).
Move them from individual files to a generic place in linux/kvm_types.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/kvm_host.h | 7 | ||||
-rw-r--r-- | arch/arm64/include/asm/kvm_host.h | 6 | ||||
-rw-r--r-- | arch/ia64/include/asm/kvm_host.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/kvm_host.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 5 | ||||
-rw-r--r-- | arch/s390/include/asm/kvm_host.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 4 |
7 files changed, 7 insertions, 28 deletions
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 6dfb404f6c46..4843397b812c 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __ARM_KVM_HOST_H__ | 19 | #ifndef __ARM_KVM_HOST_H__ |
20 | #define __ARM_KVM_HOST_H__ | 20 | #define __ARM_KVM_HOST_H__ |
21 | 21 | ||
22 | #include <linux/types.h> | ||
23 | #include <linux/kvm_types.h> | ||
22 | #include <asm/kvm.h> | 24 | #include <asm/kvm.h> |
23 | #include <asm/kvm_asm.h> | 25 | #include <asm/kvm_asm.h> |
24 | #include <asm/kvm_mmio.h> | 26 | #include <asm/kvm_mmio.h> |
@@ -40,7 +42,6 @@ | |||
40 | 42 | ||
41 | #include <kvm/arm_vgic.h> | 43 | #include <kvm/arm_vgic.h> |
42 | 44 | ||
43 | struct kvm_vcpu; | ||
44 | u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); | 45 | u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); |
45 | int kvm_target_cpu(void); | 46 | int kvm_target_cpu(void); |
46 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); | 47 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); |
@@ -149,20 +150,17 @@ struct kvm_vcpu_stat { | |||
149 | u32 halt_wakeup; | 150 | u32 halt_wakeup; |
150 | }; | 151 | }; |
151 | 152 | ||
152 | struct kvm_vcpu_init; | ||
153 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | 153 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, |
154 | const struct kvm_vcpu_init *init); | 154 | const struct kvm_vcpu_init *init); |
155 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); | 155 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); |
156 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); | 156 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); |
157 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); | 157 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); |
158 | struct kvm_one_reg; | ||
159 | int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); | 158 | int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); |
160 | int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); | 159 | int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); |
161 | u64 kvm_call_hyp(void *hypfn, ...); | 160 | u64 kvm_call_hyp(void *hypfn, ...); |
162 | void force_vm_exit(const cpumask_t *mask); | 161 | void force_vm_exit(const cpumask_t *mask); |
163 | 162 | ||
164 | #define KVM_ARCH_WANT_MMU_NOTIFIER | 163 | #define KVM_ARCH_WANT_MMU_NOTIFIER |
165 | struct kvm; | ||
166 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | 164 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); |
167 | int kvm_unmap_hva_range(struct kvm *kvm, | 165 | int kvm_unmap_hva_range(struct kvm *kvm, |
168 | unsigned long start, unsigned long end); | 166 | unsigned long start, unsigned long end); |
@@ -187,7 +185,6 @@ struct kvm_vcpu __percpu **kvm_get_running_vcpus(void); | |||
187 | 185 | ||
188 | int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices); | 186 | int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices); |
189 | unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu); | 187 | unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu); |
190 | struct kvm_one_reg; | ||
191 | int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *); | 188 | int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *); |
192 | int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *); | 189 | int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *); |
193 | 190 | ||
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index e10c45a578e3..766147baae0b 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #ifndef __ARM64_KVM_HOST_H__ | 22 | #ifndef __ARM64_KVM_HOST_H__ |
23 | #define __ARM64_KVM_HOST_H__ | 23 | #define __ARM64_KVM_HOST_H__ |
24 | 24 | ||
25 | #include <linux/types.h> | ||
26 | #include <linux/kvm_types.h> | ||
25 | #include <asm/kvm.h> | 27 | #include <asm/kvm.h> |
26 | #include <asm/kvm_asm.h> | 28 | #include <asm/kvm_asm.h> |
27 | #include <asm/kvm_mmio.h> | 29 | #include <asm/kvm_mmio.h> |
@@ -41,7 +43,6 @@ | |||
41 | 43 | ||
42 | #define KVM_VCPU_MAX_FEATURES 3 | 44 | #define KVM_VCPU_MAX_FEATURES 3 |
43 | 45 | ||
44 | struct kvm_vcpu; | ||
45 | int kvm_target_cpu(void); | 46 | int kvm_target_cpu(void); |
46 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); | 47 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); |
47 | int kvm_arch_dev_ioctl_check_extension(long ext); | 48 | int kvm_arch_dev_ioctl_check_extension(long ext); |
@@ -164,18 +165,15 @@ struct kvm_vcpu_stat { | |||
164 | u32 halt_wakeup; | 165 | u32 halt_wakeup; |
165 | }; | 166 | }; |
166 | 167 | ||
167 | struct kvm_vcpu_init; | ||
168 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | 168 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, |
169 | const struct kvm_vcpu_init *init); | 169 | const struct kvm_vcpu_init *init); |
170 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); | 170 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); |
171 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); | 171 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); |
172 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); | 172 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); |
173 | struct kvm_one_reg; | ||
174 | int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); | 173 | int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); |
175 | int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); | 174 | int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg); |
176 | 175 | ||
177 | #define KVM_ARCH_WANT_MMU_NOTIFIER | 176 | #define KVM_ARCH_WANT_MMU_NOTIFIER |
178 | struct kvm; | ||
179 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | 177 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); |
180 | int kvm_unmap_hva_range(struct kvm *kvm, | 178 | int kvm_unmap_hva_range(struct kvm *kvm, |
181 | unsigned long start, unsigned long end); | 179 | unsigned long start, unsigned long end); |
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h index db95f570705f..fccc09d04649 100644 --- a/arch/ia64/include/asm/kvm_host.h +++ b/arch/ia64/include/asm/kvm_host.h | |||
@@ -234,9 +234,6 @@ struct kvm_vm_data { | |||
234 | #define KVM_REQ_PTC_G 32 | 234 | #define KVM_REQ_PTC_G 32 |
235 | #define KVM_REQ_RESUME 33 | 235 | #define KVM_REQ_RESUME 33 |
236 | 236 | ||
237 | struct kvm; | ||
238 | struct kvm_vcpu; | ||
239 | |||
240 | struct kvm_mmio_req { | 237 | struct kvm_mmio_req { |
241 | uint64_t addr; /* physical address */ | 238 | uint64_t addr; /* physical address */ |
242 | uint64_t size; /* size in bytes */ | 239 | uint64_t size; /* size in bytes */ |
diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index 7a3fc67bd7f9..b93bc80ed7e7 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h | |||
@@ -96,11 +96,6 @@ | |||
96 | #define CAUSEB_DC 27 | 96 | #define CAUSEB_DC 27 |
97 | #define CAUSEF_DC (_ULCAST_(1) << 27) | 97 | #define CAUSEF_DC (_ULCAST_(1) << 27) |
98 | 98 | ||
99 | struct kvm; | ||
100 | struct kvm_run; | ||
101 | struct kvm_vcpu; | ||
102 | struct kvm_interrupt; | ||
103 | |||
104 | extern atomic_t kvm_mips_instance; | 99 | extern atomic_t kvm_mips_instance; |
105 | extern pfn_t(*kvm_mips_gfn_to_pfn) (struct kvm *kvm, gfn_t gfn); | 100 | extern pfn_t(*kvm_mips_gfn_to_pfn) (struct kvm *kvm, gfn_t gfn); |
106 | extern void (*kvm_mips_release_pfn_clean) (pfn_t pfn); | 101 | extern void (*kvm_mips_release_pfn_clean) (pfn_t pfn); |
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 98d9dd50d063..0e597283c5c6 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -53,7 +53,6 @@ | |||
53 | 53 | ||
54 | #define KVM_ARCH_WANT_MMU_NOTIFIER | 54 | #define KVM_ARCH_WANT_MMU_NOTIFIER |
55 | 55 | ||
56 | struct kvm; | ||
57 | extern int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | 56 | extern int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); |
58 | extern int kvm_unmap_hva_range(struct kvm *kvm, | 57 | extern int kvm_unmap_hva_range(struct kvm *kvm, |
59 | unsigned long start, unsigned long end); | 58 | unsigned long start, unsigned long end); |
@@ -76,10 +75,6 @@ extern void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); | |||
76 | /* Physical Address Mask - allowed range of real mode RAM access */ | 75 | /* Physical Address Mask - allowed range of real mode RAM access */ |
77 | #define KVM_PAM 0x0fffffffffffffffULL | 76 | #define KVM_PAM 0x0fffffffffffffffULL |
78 | 77 | ||
79 | struct kvm; | ||
80 | struct kvm_run; | ||
81 | struct kvm_vcpu; | ||
82 | |||
83 | struct lppaca; | 78 | struct lppaca; |
84 | struct slb_shadow; | 79 | struct slb_shadow; |
85 | struct dtl_entry; | 80 | struct dtl_entry; |
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 773bef7614d8..d71291d3fb6f 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -13,8 +13,11 @@ | |||
13 | 13 | ||
14 | #ifndef ASM_KVM_HOST_H | 14 | #ifndef ASM_KVM_HOST_H |
15 | #define ASM_KVM_HOST_H | 15 | #define ASM_KVM_HOST_H |
16 | |||
17 | #include <linux/types.h> | ||
16 | #include <linux/hrtimer.h> | 18 | #include <linux/hrtimer.h> |
17 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/kvm_types.h> | ||
18 | #include <linux/kvm_host.h> | 21 | #include <linux/kvm_host.h> |
19 | #include <linux/kvm.h> | 22 | #include <linux/kvm.h> |
20 | #include <asm/debug.h> | 23 | #include <asm/debug.h> |
@@ -431,8 +434,6 @@ static inline bool kvm_is_error_hva(unsigned long addr) | |||
431 | } | 434 | } |
432 | 435 | ||
433 | #define ASYNC_PF_PER_VCPU 64 | 436 | #define ASYNC_PF_PER_VCPU 64 |
434 | struct kvm_vcpu; | ||
435 | struct kvm_async_pf; | ||
436 | struct kvm_arch_async_pf { | 437 | struct kvm_arch_async_pf { |
437 | unsigned long pfault_token; | 438 | unsigned long pfault_token; |
438 | }; | 439 | }; |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index ac0f90e26a0b..567fface45f8 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -99,10 +99,6 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) | |||
99 | 99 | ||
100 | #define ASYNC_PF_PER_VCPU 64 | 100 | #define ASYNC_PF_PER_VCPU 64 |
101 | 101 | ||
102 | struct kvm_vcpu; | ||
103 | struct kvm; | ||
104 | struct kvm_async_pf; | ||
105 | |||
106 | enum kvm_reg { | 102 | enum kvm_reg { |
107 | VCPU_REGS_RAX = 0, | 103 | VCPU_REGS_RAX = 0, |
108 | VCPU_REGS_RCX = 1, | 104 | VCPU_REGS_RCX = 1, |