lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC] KVM: x86: Drop arbitraty KVM_SOFT_MAX_VCPUS
Date
Sean Christopherson <seanjc@google.com> writes:

> On Thu, Nov 11, 2021, Paolo Bonzini wrote:
>> On 11/11/21 14:47, Vitaly Kuznetsov wrote:
>> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> > index ac83d873d65b..91ef1b872b90 100644
>> > --- a/arch/x86/kvm/x86.c
>> > +++ b/arch/x86/kvm/x86.c
>> > @@ -4137,7 +4137,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>> > r = !static_call(kvm_x86_cpu_has_accelerated_tpr)();
>> > break;
>> > case KVM_CAP_NR_VCPUS:
>> > - r = KVM_SOFT_MAX_VCPUS;
>> > + r = num_online_cpus();
>
> I doubt it matters much in practice, but this really should be
>
> r = min(num_online_cpus(), KVM_MAX_VCPUS);
>

Nice catch, actually! It makes no sense to recommend > KVM_MAX_VCPUS. We
should fix this across all arches though, I'll take that as an action
item.

--
Vitaly

\
 
 \ /
  Last update: 2021-11-11 15:45    [W:0.036 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site