diff options
author | Andre Przywara <andre.przywara@arm.com> | 2014-06-02 10:26:01 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-01-20 12:25:28 -0500 |
commit | 3caa2d8c3b2d80f5e342fe8cec07c03c8147dcab (patch) | |
tree | a07f89b6bcbd96fa45a65b52591d5fda2490a2f4 /include/kvm | |
parent | 4ce7ebdfc69d1d5d166eec103ed2976eb45a6173 (diff) |
arm/arm64: KVM: make the maximum number of vCPUs a per-VM value
Currently the maximum number of vCPUs supported is a global value
limited by the used GIC model. GICv3 will lift this limit, but we
still need to observe it for guests using GICv2.
So the maximum number of vCPUs is per-VM value, depending on the
GIC model the guest uses.
Store and check the value in struct kvm_arch, but keep it down to
8 for now.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'include/kvm')
-rw-r--r-- | include/kvm/arm_vgic.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index dd243969bfc3..1c0e9dbabe6d 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define VGIC_V2_MAX_LRS (1 << 6) | 33 | #define VGIC_V2_MAX_LRS (1 << 6) |
34 | #define VGIC_V3_MAX_LRS 16 | 34 | #define VGIC_V3_MAX_LRS 16 |
35 | #define VGIC_MAX_IRQS 1024 | 35 | #define VGIC_MAX_IRQS 1024 |
36 | #define VGIC_V2_MAX_CPUS 8 | ||
36 | 37 | ||
37 | /* Sanity checks... */ | 38 | /* Sanity checks... */ |
38 | #if (KVM_MAX_VCPUS > 8) | 39 | #if (KVM_MAX_VCPUS > 8) |
@@ -132,6 +133,7 @@ struct vgic_params { | |||
132 | unsigned int maint_irq; | 133 | unsigned int maint_irq; |
133 | /* Virtual control interface base address */ | 134 | /* Virtual control interface base address */ |
134 | void __iomem *vctrl_base; | 135 | void __iomem *vctrl_base; |
136 | int max_gic_vcpus; | ||
135 | }; | 137 | }; |
136 | 138 | ||
137 | struct vgic_vm_ops { | 139 | struct vgic_vm_ops { |
@@ -289,6 +291,7 @@ struct kvm_exit_mmio; | |||
289 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); | 291 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); |
290 | int kvm_vgic_hyp_init(void); | 292 | int kvm_vgic_hyp_init(void); |
291 | int kvm_vgic_map_resources(struct kvm *kvm); | 293 | int kvm_vgic_map_resources(struct kvm *kvm); |
294 | int kvm_vgic_get_max_vcpus(void); | ||
292 | int kvm_vgic_create(struct kvm *kvm, u32 type); | 295 | int kvm_vgic_create(struct kvm *kvm, u32 type); |
293 | void kvm_vgic_destroy(struct kvm *kvm); | 296 | void kvm_vgic_destroy(struct kvm *kvm); |
294 | void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu); | 297 | void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu); |
@@ -393,6 +396,11 @@ static inline bool vgic_ready(struct kvm *kvm) | |||
393 | { | 396 | { |
394 | return true; | 397 | return true; |
395 | } | 398 | } |
399 | |||
400 | static inline int kvm_vgic_get_max_vcpus(void) | ||
401 | { | ||
402 | return KVM_MAX_VCPUS; | ||
403 | } | ||
396 | #endif | 404 | #endif |
397 | 405 | ||
398 | #endif | 406 | #endif |