diff options
| author | Christoffer Dall <christoffer.dall@linaro.org> | 2015-03-11 09:21:31 -0400 |
|---|---|---|
| committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-03-12 10:15:27 -0400 |
| commit | 662d9715840aef44dcb573b0f9fab9e8319c868a (patch) | |
| tree | 8c2800bd7b58972618fa820a57b03cdfca01d1c9 /include/kvm | |
| parent | 69ff5c619cb350f43fbab2a491b4b66de7e96959 (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.h | 31 | ||||
| -rw-r--r-- | include/kvm/arm_vgic.h | 85 |
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 | ||
| 26 | struct arch_timer_kvm { | 26 | struct 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 | ||
| 36 | struct arch_timer_cpu { | 34 | struct 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 | ||
| 62 | int kvm_timer_hyp_init(void); | 57 | int kvm_timer_hyp_init(void); |
| 63 | void kvm_timer_enable(struct kvm *kvm); | 58 | void kvm_timer_enable(struct kvm *kvm); |
| 64 | void kvm_timer_init(struct kvm *kvm); | 59 | void kvm_timer_init(struct kvm *kvm); |
| @@ -72,30 +67,4 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu); | |||
| 72 | u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid); | 67 | u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid); |
| 73 | int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value); | 68 | int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value); |
| 74 | 69 | ||
| 75 | #else | ||
| 76 | static inline int kvm_timer_hyp_init(void) | ||
| 77 | { | ||
| 78 | return 0; | ||
| 79 | }; | ||
| 80 | |||
| 81 | static inline void kvm_timer_enable(struct kvm *kvm) {} | ||
| 82 | static inline void kvm_timer_init(struct kvm *kvm) {} | ||
| 83 | static inline void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu, | ||
| 84 | const struct kvm_irq_level *irq) {} | ||
| 85 | static inline void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) {} | ||
| 86 | static inline void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) {} | ||
| 87 | static inline void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) {} | ||
| 88 | static inline void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) {} | ||
| 89 | |||
| 90 | static inline int kvm_arm_timer_set_reg(struct kvm_vcpu *vcpu, u64 regid, u64 value) | ||
| 91 | { | ||
| 92 | return 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | static 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 | ||
| 150 | struct vgic_dist { | 150 | struct 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 | ||
| 243 | struct vgic_v2_cpu_if { | 241 | struct vgic_v2_cpu_if { |
| @@ -265,7 +263,6 @@ struct vgic_v3_cpu_if { | |||
| 265 | }; | 263 | }; |
| 266 | 264 | ||
| 267 | struct vgic_cpu { | 265 | struct 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; | |||
| 297 | struct kvm_run; | 293 | struct kvm_run; |
| 298 | struct kvm_exit_mmio; | 294 | struct kvm_exit_mmio; |
| 299 | 295 | ||
| 300 | #ifdef CONFIG_KVM_ARM_VGIC | ||
| 301 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); | 296 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); |
| 302 | int kvm_vgic_hyp_init(void); | 297 | int kvm_vgic_hyp_init(void); |
| 303 | int kvm_vgic_map_resources(struct kvm *kvm); | 298 | int 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 | ||
| 338 | static inline int kvm_vgic_hyp_init(void) | ||
| 339 | { | ||
| 340 | return 0; | ||
| 341 | } | ||
| 342 | |||
| 343 | static inline int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr) | ||
| 344 | { | ||
| 345 | return 0; | ||
| 346 | } | ||
| 347 | |||
| 348 | static inline int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write) | ||
| 349 | { | ||
| 350 | return -ENXIO; | ||
| 351 | } | ||
| 352 | |||
| 353 | static inline int kvm_vgic_map_resources(struct kvm *kvm) | ||
| 354 | { | ||
| 355 | return 0; | ||
| 356 | } | ||
| 357 | |||
| 358 | static inline int kvm_vgic_create(struct kvm *kvm, u32 type) | ||
| 359 | { | ||
| 360 | return 0; | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline void kvm_vgic_destroy(struct kvm *kvm) | ||
| 364 | { | ||
| 365 | } | ||
| 366 | |||
| 367 | static inline void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu) | ||
| 368 | { | ||
| 369 | } | ||
| 370 | |||
| 371 | static inline int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu) | ||
| 372 | { | ||
| 373 | return 0; | ||
| 374 | } | ||
| 375 | |||
| 376 | static inline void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) {} | ||
| 377 | static inline void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) {} | ||
| 378 | |||
| 379 | static inline int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, | ||
| 380 | unsigned int irq_num, bool level) | ||
| 381 | { | ||
| 382 | return 0; | ||
| 383 | } | ||
| 384 | |||
| 385 | static inline int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu) | ||
| 386 | { | ||
| 387 | return 0; | ||
| 388 | } | ||
| 389 | |||
| 390 | static 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 | |||
| 396 | static inline int irqchip_in_kernel(struct kvm *kvm) | ||
| 397 | { | ||
| 398 | return 0; | ||
| 399 | } | ||
| 400 | |||
| 401 | static inline bool vgic_initialized(struct kvm *kvm) | ||
| 402 | { | ||
| 403 | return true; | ||
| 404 | } | ||
| 405 | |||
| 406 | static inline bool vgic_ready(struct kvm *kvm) | ||
| 407 | { | ||
| 408 | return true; | ||
| 409 | } | ||
| 410 | |||
| 411 | static inline int kvm_vgic_get_max_vcpus(void) | ||
| 412 | { | ||
| 413 | return KVM_MAX_VCPUS; | ||
| 414 | } | ||
| 415 | #endif | ||
| 416 | |||
| 417 | #endif | 332 | #endif |
