From patchwork Thu Dec 12 16:12:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 22296 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7DB5423FC7 for ; Thu, 12 Dec 2013 16:12:50 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id gq1sf2259358obb.10 for ; Thu, 12 Dec 2013 08:12:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=RQVgmtYUFofy2lr6GGWCB0d5UrW5FvEVNetwX1oZwko=; b=eT5sW5hqYzdkvPr1NBKwPD15jcosbGqNhbOh84Gbxfitvg4Acx9a1gvQhqExI3fAHF iBjz7C9DJaGmwppyXvrtrvW7g8xT/yZRB3zogrYxkGc2Vz8AibNrMXhEHY6zfa0pu2BY qkEevAXcBr0gqw+Y26pPmx+SLxmSSR+G9AM4ArJOyastPjHcvS8yar9EXLqx2dyaUkG0 kZmwrEzJ8hPzLpLbtFhFT+P8iEOJmx67TSYegElRaI7H03pbCZZ+TbEqfMCMwmT6eD5A 8kaJr/pgHCrasWtpSBDJjejCLV//l5/H50c8FZt82Vw2D6kQIxBtcNWcnSr7SJVtKFNi OuFA== X-Gm-Message-State: ALoCoQn7sKlzLkwNjggIM6BOyzs0Y7urHifodWn++Ieaj3iXnHBAkP2454lj9Snb2lAsbQkv4v2G X-Received: by 10.50.114.66 with SMTP id je2mr3929881igb.5.1386864769358; Thu, 12 Dec 2013 08:12:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.81 with SMTP id da17ls597359qeb.22.gmail; Thu, 12 Dec 2013 08:12:48 -0800 (PST) X-Received: by 10.58.217.169 with SMTP id oz9mr97139vec.42.1386864768743; Thu, 12 Dec 2013 08:12:48 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id sm7si7064221vdc.58.2013.12.12.08.12.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Dec 2013 08:12:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so460363veb.17 for ; Thu, 12 Dec 2013 08:12:48 -0800 (PST) X-Received: by 10.53.13.199 with SMTP id fa7mr918245vdd.31.1386864768630; Thu, 12 Dec 2013 08:12:48 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp366919vcz; Thu, 12 Dec 2013 08:12:48 -0800 (PST) X-Received: by 10.68.212.37 with SMTP id nh5mr13854568pbc.16.1386864767150; Thu, 12 Dec 2013 08:12:47 -0800 (PST) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id w3si16952150pbh.89.2013.12.12.08.12.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Dec 2013 08:12:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of anup.patel@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id rq2so761715pbb.30 for ; Thu, 12 Dec 2013 08:12:46 -0800 (PST) X-Received: by 10.68.209.133 with SMTP id mm5mr13447253pbc.157.1386864766547; Thu, 12 Dec 2013 08:12:46 -0800 (PST) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id jk16sm41193694pbb.34.2013.12.12.08.12.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Dec 2013 08:12:45 -0800 (PST) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, patches@apm.com, linaro-kernel@lists.linaro.org, Christoffer Dall , Marc Zyngier , Pranavkumar Sawargaonkar , Anup Patel Subject: [PATCH RESEND] arm64: KVM: Add Kconfig option for max VCPUs per-Guest Date: Thu, 12 Dec 2013 21:42:22 +0530 Message-Id: <1386864747-29006-1-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anup.patel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Current max VCPUs per-Guest is set to 4 which is preventing us from creating a Guest (or VM) with 8 VCPUs on Host (e.g. X-Gene Storm SOC) with 8 Host CPUs. The correct value of max VCPUs per-Guest should be same as the max CPUs supported by GICv2 which is 8 but, increasing value of max VCPUs per-Guest can make things slower hence we add Kconfig option to let KVM users select appropriate max VCPUs per-Guest. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar Acked-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm64/include/asm/kvm_host.h | 7 ++++++- arch/arm64/kvm/Kconfig | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 5d85a02..0a1d697 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -26,7 +26,12 @@ #include #include -#define KVM_MAX_VCPUS 4 +#if defined(CONFIG_KVM_ARM_MAX_VCPUS) +#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS +#else +#define KVM_MAX_VCPUS 0 +#endif + #define KVM_USER_MEM_SLOTS 32 #define KVM_PRIVATE_MEM_SLOTS 4 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1 diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 4480ab3..8ba85e9 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -36,6 +36,17 @@ config KVM_ARM_HOST ---help--- Provides host support for ARM processors. +config KVM_ARM_MAX_VCPUS + int "Number maximum supported virtual CPUs per VM" + depends on KVM_ARM_HOST + default 4 + help + Static number of max supported virtual CPUs per VM. + + If you choose a high number, the vcpu structures will be quite + large, so only choose a reasonable number that you expect to + actually use. + config KVM_ARM_VGIC bool depends on KVM_ARM_HOST && OF