From patchwork Sat Sep 14 10:54:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 20311 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C4A0248D3 for ; Sat, 14 Sep 2013 10:55:20 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf2524084yhz.7 for ; Sat, 14 Sep 2013 03:55:20 -0700 (PDT) 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=OSM8MuHgZ1D4G7d71+a4DgW4LRzJoVvgSkIwG6/yGWg=; b=QCo15/UfHslJVNbD3OJikqBgo0ao0hqqdglbarHhvF7UlRX47vGM+H8OyNpNKcUD/F STOqYrY8SViRqpRfOx7Xm6aq2wb2Dtthow7BkMERK+Gbs0tLZVwlCtvX4gOsq+GwOKiA 4D435Wkc23mUQVN09lWCPL88qBCDzeGUaqQlQ90MLiobphMYv17hCpq3PppMFSG+8Qya x7mt8XMnHf6+Zn9wS69Vt9u4L9sT+JN44rDmhqAyNRhB2li1JF68uuUpVzQomItB0UaM 4irza0uCNfx60DGHfcUfF/9HNnVf40tt0trZxJele5nLXA4nJUf5Pyaf31/NVzHh0WEa FvPA== X-Gm-Message-State: ALoCoQlJ8SG5kNqBVobHx8bHL9E35MXY3cXOk4a82ywyvoHWhvGxYZftLbgXOTEB3NIiL8NHiFT3 X-Received: by 10.236.0.232 with SMTP id 68mr6861449yhb.16.1379156119873; Sat, 14 Sep 2013 03:55:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.198 with SMTP id w6ls1531157qev.9.gmail; Sat, 14 Sep 2013 03:55:19 -0700 (PDT) X-Received: by 10.220.10.194 with SMTP id q2mr16415555vcq.2.1379156119714; Sat, 14 Sep 2013 03:55:19 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id un5si4520455vcb.97.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 03:55:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so1713151vbf.10 for ; Sat, 14 Sep 2013 03:55:19 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr16523942ved.8.1379156119285; Sat, 14 Sep 2013 03:55:19 -0700 (PDT) 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 u4csp6751vcz; Sat, 14 Sep 2013 03:55:18 -0700 (PDT) X-Received: by 10.66.136.227 with SMTP id qd3mr19908224pab.113.1379156118136; Sat, 14 Sep 2013 03:55:18 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id gb4si10951293pbb.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 03:55:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of anup.patel@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id g10so2275670pdj.12 for ; Sat, 14 Sep 2013 03:55:17 -0700 (PDT) X-Received: by 10.66.254.170 with SMTP id aj10mr20028970pad.142.1379156117544; Sat, 14 Sep 2013 03:55:17 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id oj6sm24335861pab.9.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 03:55:16 -0700 (PDT) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, marc.zyngier@arm.com, Anup Patel , Pranavkumar Sawargaonkar Subject: [PATCH] arm64: KVM: Add Kconfig option for max VCPUs per-Guest Date: Sat, 14 Sep 2013 16:24:41 +0530 Message-Id: <1379156081-16508-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.212.51 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 --- 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 0859a4d..f318c43 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 21e9082..0c99deb 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -35,6 +35,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