- r = num_online_cpus();^^^^^^^^^^^^^^^^^^
+ /*
+ * ARM64 treats KVM_CAP_NR_CPUS differently from all other
+ * architectures, as it does not always bound it to
+ * num_online_cpus(). It should not matter much because this
+ * is just an advisory value.
+ */
+ r = min_t(unsigned int, num_online_cpus(),
+ kvm_arm_default_max_vcpus());