From patchwork Sat Sep 14 12:18:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 2893261 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4829BFF05 for ; Sat, 14 Sep 2013 12:19:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A19A2026D for ; Sat, 14 Sep 2013 12:19:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C66E20258 for ; Sat, 14 Sep 2013 12:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932128Ab3INMSy (ORCPT ); Sat, 14 Sep 2013 08:18:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32684 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416Ab3INMSy (ORCPT ); Sat, 14 Sep 2013 08:18:54 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8ECIscg024671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 14 Sep 2013 08:18:54 -0400 Received: from hawk.usersys.redhat.com.com (dhcp-1-148.brq.redhat.com [10.34.1.148]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8ECIqLi027525; Sat, 14 Sep 2013 08:18:52 -0400 From: Andrew Jones To: kvm@vger.kernel.org Cc: gleb@redhat.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS Date: Sat, 14 Sep 2013 14:18:49 +0200 Message-Id: <1379161129-28393-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. Signed-off-by: Andrew Jones --- arch/x86/include/asm/kvm_host.h | 5 +++-- arch/x86/kvm/Kconfig | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index c76ff74a98f2e..e7e9b523a8f7e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -31,8 +31,9 @@ #include #include -#define KVM_MAX_VCPUS 255 -#define KVM_SOFT_MAX_VCPUS 160 +#define KVM_MAX_VCPUS CONFIG_KVM_MAX_VCPUS +#define KVM_SOFT_MAX_VCPUS min(160, KVM_MAX_VCPUS) + #define KVM_USER_MEM_SLOTS 125 /* memory slots that are not exposed to userspace */ #define KVM_PRIVATE_MEM_SLOTS 3 diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index a47a3e54b964b..e9532c33527ee 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -52,6 +52,16 @@ config KVM If unsure, say N. +config KVM_MAX_VCPUS + int "Number maximum supported virtual CPUs per VM" + depends on KVM + default 255 + help + Static number of max supported virtual CPUs per VM. + + Set to a lower number to save some resources. Set to a higher + number to test scalability. + config KVM_INTEL tristate "KVM for Intel processors support" depends on KVM