|
@@ -249,6 +249,22 @@ int kvm_dev_ioctl_check_extension(long ext)
|
|
|
r = cpu_has_feature(CPU_FTR_ARCH_206) ? 1 : 0;
|
|
|
break;
|
|
|
#endif
|
|
|
+ case KVM_CAP_NR_VCPUS:
|
|
|
+ /*
|
|
|
+ * Recommending a number of CPUs is somewhat arbitrary; we
|
|
|
+ * return the number of present CPUs for -HV (since a host
|
|
|
+ * will have secondary threads "offline"), and for other KVM
|
|
|
+ * implementations just count online CPUs.
|
|
|
+ */
|
|
|
+#ifdef CONFIG_KVM_BOOK3S_64_HV
|
|
|
+ r = num_present_cpus();
|
|
|
+#else
|
|
|
+ r = num_online_cpus();
|
|
|
+#endif
|
|
|
+ break;
|
|
|
+ case KVM_CAP_MAX_VCPUS:
|
|
|
+ r = KVM_MAX_VCPUS;
|
|
|
+ break;
|
|
|
default:
|
|
|
r = 0;
|
|
|
break;
|