[PATCH 1/3] arm: kvm: clamp NR_VCPUS to MAX_VCPUS
Andrew Jones
drjones at redhat.com
Sat Sep 14 08:10:54 EDT 2013
Signed-off-by: Andrew Jones <drjones at redhat.com>
---
arch/arm/kvm/arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 741f66a2edbd7..9ebf8ac3a12ff 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -201,7 +201,7 @@ int kvm_dev_ioctl_check_extension(long ext)
r = 1;
break;
case KVM_CAP_NR_VCPUS:
- r = num_online_cpus();
+ r = min(num_online_cpus(), KVM_MAX_VCPUS);
break;
case KVM_CAP_MAX_VCPUS:
r = KVM_MAX_VCPUS;
--
1.8.1.4
More information about the linux-arm-kernel
mailing list