From patchwork Thu Nov 11 16:27:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 12692302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56F7EC433EF for ; Thu, 11 Nov 2021 16:29:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2664F6124D for ; Thu, 11 Nov 2021 16:29:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2664F6124D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KIBaKskk2p0/jfJ4uHnEWzgtFnpEubseZmo9kVbDC3c=; b=inhf2hyn3L535t +qfpeeb4kBYavjP45x3a6Mi3AWs8eJEwfVpi58t352S7Ejap2QZgIDjht8khnBogD2tEYCA67V+n8 1+VlBgFJzJwnF6fTQY5SxwgZjN7x8solEP59wbwPPelRuMxfU9+ST9vTtw+hL8wSPMzXADXmGeHi2 46F9FsGoWG4Ydsr02Mt/IVN7LedLV/IIKzhmw7EkCzma0HQskrMQSp7tMqbhEfMdU0VLA9ELdKhgv zKoHgcci/P+FCTzqdt2xuISkZhudrdrPQKhMQyystOpI4vDG3JxXrlowIjGbu/YDXnsr/xZsvoqXN AAyKUS5h/v5Dz7rW+Xuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlCvo-008MVa-FK; Thu, 11 Nov 2021 16:28:08 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlCvj-008MTx-Uh for linux-arm-kernel@lists.infradead.org; Thu, 11 Nov 2021 16:28:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636648081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CF3Hv1Bl+ogsp2j/RVKC+aJzOVJPQU9lGZ+gEbRRDTY=; b=anSynQYbf+WCSdgpcY3RpdZ/vkV45I1a8YUVxMoQ4Pr1+mYQ2ZFQw1v2/CmvH/xsxmIvoJ hoNUC1JBh9fPIy6RvkPaMXEqCX1sGKavPpsJAxMjx8iW6S7ujrdqwl6AC1T3D4h9dC9fni fn6Vc9P98fdMES0NLjKVk6F1H7QMAis= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-9nC3unzeMd2Fx6h_nH8MfQ-1; Thu, 11 Nov 2021 11:27:57 -0500 X-MC-Unique: 9nC3unzeMd2Fx6h_nH8MfQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E4291006ABF; Thu, 11 Nov 2021 16:27:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 981871017CE3; Thu, 11 Nov 2021 16:27:47 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Eduardo Habkost , Marc Zyngier , Andrew Jones , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Mackerras , Michael Ellerman , kvm-ppc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] KVM: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS and re-purpose it on x86 Date: Thu, 11 Nov 2021 17:27:41 +0100 Message-Id: <20211111162746.100598-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211111_082804_089961_8B343829 X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a comtinuation of "KVM: x86: Drop arbitraty KVM_SOFT_MAX_VCPUS" (https://lore.kernel.org/kvm/20211111134733.86601-1-vkuznets@redhat.com/) work. 1) Enforce KVM_CAP_NR_VCPUS <= KVM_CAP_MAX_VCPUS rule on all architectures. [Sean Christopherson] 2) Make KVM_CAP_NR_VCPUS return num_online_cpus() and not an arbitrary value of '710' on x86. Everything but x86 was only 'eyeball tested', the change is trivial but sorry in advance if I screwed up) Vitaly Kuznetsov (5): KVM: arm64: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS KVM: MIPS: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS KVM: PPC: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS KVM: RISC-V: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS KVM: x86: Drop arbitraty KVM_SOFT_MAX_VCPUS arch/arm64/kvm/arm.c | 7 ++++++- arch/mips/kvm/mips.c | 2 +- arch/powerpc/kvm/powerpc.c | 4 ++-- arch/riscv/kvm/vm.c | 2 +- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/x86.c | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) Acked-by: Christian Borntraeger