From patchwork Thu Jan 19 17:29:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9526537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 660D06045A for ; Thu, 19 Jan 2017 17:32:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58CB02862A for ; Thu, 19 Jan 2017 17:32:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D65528639; Thu, 19 Jan 2017 17:32:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A60D2863A for ; Thu, 19 Jan 2017 17:32:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUGXG-00069d-7T; Thu, 19 Jan 2017 17:30:06 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUGXF-00065G-Dx for xen-devel@lists.xenproject.org; Thu, 19 Jan 2017 17:30:05 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 0A/EC-25657-C97F0885; Thu, 19 Jan 2017 17:30:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsXitHSDve6s7w0 RBrefC1l83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBn3FvxiLtjGWbG5v5GxgfE1excjB4eEgL/E oX8xXYycHGwCOhIX5+5kAwmLCKhI3N5r0MXIxcEssIFR4tyPvewgNcICURJbJ2xiArFZBFQlF h7dzQhi8wpYSrROmwYWlxDQk9h15DcriM0pYCVx8fMGNhBbCKhmxpsOZoh6QYmTM5+wgNjMAp oSrdt/s0PY8hLNW2czQ9QrSvTPe8A2gZFvFpKWWUhaZiFpWcDIvIpRozi1qCy1SNfIWC+pKDM 9oyQ3MTNH19DAWC83tbg4MT01JzGpWC85P3cTIzDU6hkYGHcw9u31O8QoycGkJMq7+2NDhBBf Un5KZUZicUZ8UWlOavEhRg0ODoHNa1dfYJRiycvPS1WS4F38DahOsCg1PbUiLTMHGA0wpRIcP EoivBNA0rzFBYm5xZnpEKlTjIpS4rw5IAkBkERGaR5cGywCLzHKSgnzMjIwMAjxFKQW5WaWoM q/YhTnYFQS5p0HMoUnM68EbvoroMVMQIutlOtBFpckIqSkGhitmf/dyRQIf6SXtVS1N/+9fuw t2ezVtyx6pJ7XV99kDfpa+NftqILOLINOGz1BJ4Z9x/LnNEsvWLjz8/FD08sz1kyNjO/m2eLK elrdT1p6B9fOpZeXnlx65n26xtTdF6SK3qxezbg9zv1+690+m+85tTYrvwQVGVXWKO85E5V9o YdLMS1RY78SS3FGoqEWc1FxIgBALCSCuwIAAA== X-Env-Sender: prvs=1851ba1ec=roger.pau@citrix.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1484846995!50557998!4 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7998 invoked from network); 19 Jan 2017 17:30:01 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 19 Jan 2017 17:30:01 -0000 X-IronPort-AV: E=Sophos;i="5.33,254,1477958400"; d="scan'208";a="409659447" From: Roger Pau Monne To: Date: Thu, 19 Jan 2017 17:29:39 +0000 Message-ID: <20170119172941.65642-8-roger.pau@citrix.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170119172941.65642-1-roger.pau@citrix.com> References: <20170119172941.65642-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , boris.ostrovsky@oracle.com, Roger Pau Monne , Jan Beulich , konrad.wilk@oracle.com Subject: [Xen-devel] [PATCH v5 7/9] x86/PVHv2: fix dom0_max_vcpus so it's capped to 128 for PVHv2 Dom0 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP PVHv2 Dom0 is limited to 128 vCPUs, as are all HVM guests at the moment. Fix dom0_max_vcpus so it takes this limitation into account by poking at the dom0_hvm variable. Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper --- Cc: Jan Beulich Cc: Andrew Cooper --- Change since v4: - Fix codding style to match rest of the function. Changes since v3: - New in the series. --- xen/arch/x86/domain_build.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 4f5f712..55caa30 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -40,6 +40,7 @@ #include #include +#include static long __initdata dom0_nrpages; static long __initdata dom0_min_nrpages; @@ -176,6 +177,8 @@ unsigned int __init dom0_max_vcpus(void) max_vcpus = opt_dom0_max_vcpus_max; if ( max_vcpus > MAX_VIRT_CPUS ) max_vcpus = MAX_VIRT_CPUS; + if ( dom0_pvh && max_vcpus > HVM_MAX_VCPUS ) + max_vcpus = HVM_MAX_VCPUS; return max_vcpus; }