aboutsummaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2015-03-11 09:21:31 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2015-03-12 10:15:27 -0400
commit662d9715840aef44dcb573b0f9fab9e8319c868a (patch)
tree8c2800bd7b58972618fa820a57b03cdfca01d1c9 /include/kvm
parent69ff5c619cb350f43fbab2a491b4b66de7e96959 (diff)
arm/arm64: KVM: Kill CONFIG_KVM_ARM_{VGIC,TIMER}
We can definitely decide at run-time whether to use the GIC and timers or not, and the extra code and data structures that we allocate space for is really negligable with this config option, so I don't think it's worth the extra complexity of always having to define stub static inlines. The !CONFIG_KVM_ARM_VGIC/TIMER case is pretty much an untested code path anyway, so we're better off just getting rid of it. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_arch_timer.h31
-rw-r--r--include/kvm/arm_vgic.h85
2 files changed, 0 insertions, 116 deletions
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index b3f45a578344..a74e4c2bf188 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -24,17 +24,14 @@
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25 25
26struct arch_timer_kvm { 26struct arch_timer_kvm {
27#ifdef CONFIG_KVM_ARM_TIMER
28 /* Is the timer enabled */ 27 /* Is the timer enabled */
29 bool enabled; 28 bool enabled;
30 29
31 /* Virtual offset */ 30 /* Virtual offset */
32 cycle_t cntvoff; 31 cycle_t cntvoff;
33#endif
34}; 32};
35 33
36struct arch_timer_cpu { 34struct arch_timer_cpu {
37#ifdef CONFIG_KVM_ARM_TIMER
38 /* Registers: control register, timer value */ 35 /* Registers: control register, timer value */
39 u32 cntv_ctl; /* Saved/restored */ 36 u32 cntv_ctl; /* Saved/restored */
40 cycle_t cntv_cval; /* Saved/restored */ 37 cycle_t cntv_cval; /* Saved/restored */
@@ -55,10 +52,8 @@ struct arch_timer_cpu {
55 52
56 /* Timer IRQ */ 53 /* Timer IRQ */
57 const struct kvm_irq_level *irq; 54 const struct kvm_irq_level *irq;
58#endif
59}; 55};
60 56
61#ifdef CONFIG_KVM_ARM_TIMER
62int kvm_timer_hyp_init(void); 57int kvm_timer_hyp_init(void);
63void kvm_timer_enable(struct kvm *kvm); 58void kvm_timer_enable(struct kvm *kvm);
64void kvm_timer_init(struct kvm *kvm); 59void kvm_timer_init(struct kvm *kvm);
@@ -72,30 +67,4 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu);
72u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid); 67u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid);
73int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value); 68int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value);
74 69
75#else
76static inline int kvm_timer_hyp_init(void)
77{
78 return 0;
79};
80
81static inline void kvm_timer_enable(struct kvm *kvm) {}
82static inline void kvm_timer_init(struct kvm *kvm) {}
83static inline void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
84 const struct kvm_irq_level *irq) {}
85static inline void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) {}
86static inline void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) {}
87static inline void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) {}
88static inline void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) {}
89
90static inline int kvm_arm_timer_set_reg(struct kvm_vcpu *vcpu, u64 regid, u64 value)
91{
92 return 0;
93}
94
95static inline u64 kvm_arm_timer_get_reg(struct kvm_vcpu *vcpu, u64 regid)
96{
97 return 0;
98}
99#endif
100
101#endif 70#endif
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 7c55dd5dd2c9..b81630b1da85 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -148,7 +148,6 @@ struct vgic_vm_ops {
148}; 148};
149 149
150struct vgic_dist { 150struct vgic_dist {
151#ifdef CONFIG_KVM_ARM_VGIC
152 spinlock_t lock; 151 spinlock_t lock;
153 bool in_kernel; 152 bool in_kernel;
154 bool ready; 153 bool ready;
@@ -237,7 +236,6 @@ struct vgic_dist {
237 unsigned long *irq_pending_on_cpu; 236 unsigned long *irq_pending_on_cpu;
238 237
239 struct vgic_vm_ops vm_ops; 238 struct vgic_vm_ops vm_ops;
240#endif
241}; 239};
242 240
243struct vgic_v2_cpu_if { 241struct vgic_v2_cpu_if {
@@ -265,7 +263,6 @@ struct vgic_v3_cpu_if {
265}; 263};
266 264
267struct vgic_cpu { 265struct vgic_cpu {
268#ifdef CONFIG_KVM_ARM_VGIC
269 /* per IRQ to LR mapping */ 266 /* per IRQ to LR mapping */
270 u8 *vgic_irq_lr_map; 267 u8 *vgic_irq_lr_map;
271 268
@@ -284,7 +281,6 @@ struct vgic_cpu {
284 struct vgic_v2_cpu_if vgic_v2; 281 struct vgic_v2_cpu_if vgic_v2;
285 struct vgic_v3_cpu_if vgic_v3; 282 struct vgic_v3_cpu_if vgic_v3;
286 }; 283 };
287#endif
288}; 284};
289 285
290#define LR_EMPTY 0xff 286#define LR_EMPTY 0xff
@@ -297,7 +293,6 @@ struct kvm_vcpu;
297struct kvm_run; 293struct kvm_run;
298struct kvm_exit_mmio; 294struct kvm_exit_mmio;
299 295
300#ifdef CONFIG_KVM_ARM_VGIC
301int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); 296int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write);
302int kvm_vgic_hyp_init(void); 297int kvm_vgic_hyp_init(void);
303int kvm_vgic_map_resources(struct kvm *kvm); 298int kvm_vgic_map_resources(struct kvm *kvm);
@@ -334,84 +329,4 @@ static inline int vgic_v3_probe(struct device_node *vgic_node,
334} 329}
335#endif 330#endif
336 331
337#else
338static inline int kvm_vgic_hyp_init(void)
339{
340 return 0;
341}
342
343static inline int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr)
344{
345 return 0;
346}
347
348static inline int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write)
349{
350 return -ENXIO;
351}
352
353static inline int kvm_vgic_map_resources(struct kvm *kvm)
354{
355 return 0;
356}
357
358static inline int kvm_vgic_create(struct kvm *kvm, u32 type)
359{
360 return 0;
361}
362
363static inline void kvm_vgic_destroy(struct kvm *kvm)
364{
365}
366
367static inline void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
368{
369}
370
371static inline int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
372{
373 return 0;
374}
375
376static inline void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) {}
377static inline void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) {}
378
379static inline int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid,
380 unsigned int irq_num, bool level)
381{
382 return 0;
383}
384
385static inline int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
386{
387 return 0;
388}
389
390static inline bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
391 struct kvm_exit_mmio *mmio)
392{
393 return false;
394}
395
396static inline int irqchip_in_kernel(struct kvm *kvm)
397{
398 return 0;
399}
400
401static inline bool vgic_initialized(struct kvm *kvm)
402{
403 return true;
404}
405
406static inline bool vgic_ready(struct kvm *kvm)
407{
408 return true;
409}
410
411static inline int kvm_vgic_get_max_vcpus(void)
412{
413 return KVM_MAX_VCPUS;
414}
415#endif
416
417#endif 332#endif