[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy3VTfXmt4ub9SWwFQWwcqCS07WkwXdh6ObOcoZSp5oY=Q@mail.gmail.com>
Date: Wed, 17 Nov 2021 10:32:18 +0530
From: Anup Patel <anup@...infault.org>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: KVM General <kvm@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Eduardo Habkost <ehabkost@...hat.com>,
Marc Zyngier <maz@...nel.org>,
Andrew Jones <drjones@...hat.com>,
Huacai Chen <chenhuacai@...nel.org>,
Aleksandar Markovic <aleksandar.qemu.devel@...il.com>,
Anup Patel <anup.patel@....com>,
Paul Mackerras <paulus@...abs.org>,
Michael Ellerman <mpe@...erman.id.au>,
Christian Borntraeger <borntraeger@...ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>, kvm-ppc@...r.kernel.org,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-mips@...r.kernel.org, kvm-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 4/6] KVM: RISC-V: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS
On Tue, Nov 16, 2021 at 10:05 PM Vitaly Kuznetsov <vkuznets@...hat.com> wrote:
>
> It doesn't make sense to return the recommended maximum number of
> vCPUs which exceeds the maximum possible number of vCPUs.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
Looks good to me.
For KVM RISC-V:
Acked-by: Anup Patel <anup.patel@....com>
Reviewed-by: Anup Patel <anup.patel@....com>
Thanks,
Anup
> ---
> arch/riscv/kvm/vm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c
> index 26399df15b63..fb18af34a4b5 100644
> --- a/arch/riscv/kvm/vm.c
> +++ b/arch/riscv/kvm/vm.c
> @@ -74,7 +74,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> r = 1;
> break;
> case KVM_CAP_NR_VCPUS:
> - r = num_online_cpus();
> + r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
> break;
> case KVM_CAP_MAX_VCPUS:
> r = KVM_MAX_VCPUS;
> --
> 2.33.1
>
Powered by blists - more mailing lists