From patchwork Mon Sep 19 02:08:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 9338439 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 3C640601C2 for ; Mon, 19 Sep 2016 02:11:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2642728EAB for ; Mon, 19 Sep 2016 02:11:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19F2D28EAE; Mon, 19 Sep 2016 02:11:52 +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=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 BF71B28EAB for ; Mon, 19 Sep 2016 02:11: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 1blo1I-0004Ax-QC; Mon, 19 Sep 2016 02:09:20 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blo1G-0004Am-Tw for xen-devel@lists.xen.org; Mon, 19 Sep 2016 02:09:19 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 29/BC-15404-EC84FD75; Mon, 19 Sep 2016 02:09:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRWlGSWpSXmKPExsVyMfTAId2zHvf DDaavkrJY8nExiwOjx9Hdv5kCGKNYM/OS8isSWDOOHO9hK5jPUdF/tIW5gbGdvYuRi0NIYCKj xMqPK1lAHBaBlywSU//MY+1i5OSQEOhnlbg2LxTCjpHYsucWE4RdKbHyzAawGiEBFYm5m3oYI SZNZ5I4v2AtI0iCTUBaYs+FpYwQDRoSS4/eZwUpEhHoZ5R4c3guWDezgKXE+Q0f2UFsYYF4iV Wb2llAbBYBVYmV26aydTFycPAKOEgsvm8AMUdO4vrM6WBHcAo4SkxoeMkOcYSDxIEjv9knMAo uYGRYxahRnFpUllqka2Skl1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGHIMQLCD cc38wEOMkhxMSqK8O0ruhQvxJeWnVGYkFmfEF5XmpBYfYtTg4BDYvHb1BUYplrz8vFQlCd6D7 vfDhQSLUtNTK9Iyc4BRAVMqwcGjJMIrAIwMId7igsTc4sx0iNQpRmOOLb+vrWXi2Db13lomIb BJUuK830EmCYCUZpTmwQ2CReslRlkpYV5GoDOFeApSi3IzS1DlXzGKczAqCfOygyzkycwrgdv 3CugUJqBTVs+6DXJKSSJCSqqBUazv4Gflqqu+30peyir36nlz+/nW/j+tsMtnhkvKY/7Nj3UU Nlgr+PR6GS3LPHab9VTpShbflJKF/1TfzFz0dn71My6Xe6dnGdVdzDTdNstW7mFNWuv18Fnrl 6as8Fq882eaiWLw8n3q9001OdjmsO0NT/332oXD93aczeVHLvI7P09593fbZSWW4oxEQy3mou JEAKH7SL/RAgAA X-Env-Sender: van.freenix@gmail.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1474250956!19936955!1 X-Originating-IP: [209.85.192.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45825 invoked from network); 19 Sep 2016 02:09:17 -0000 Received: from mail-pf0-f194.google.com (HELO mail-pf0-f194.google.com) (209.85.192.194) by server-2.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 19 Sep 2016 02:09:17 -0000 Received: by mail-pf0-f194.google.com with SMTP id n24so6466622pfb.3 for ; Sun, 18 Sep 2016 19:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rPYbymtoHKh9e9lVKIEpSjqF/feMs3f5jyWwjyU8GaE=; b=e8vVtUkkmDOYnAlq+unXtTZva0QtgB8/n9e2wGzUoTtrXFEQBMzFQj9SvJ98mqfmHU IncCnfVT1VIM0HzIIVyn80SwWImTCZus3aBKD2jRQEBOd3DnENd5Ql+Sci9a6Or/s9cz yKzD4LQXIe96MiDdmdimNcxrfLd8QJGCa9Vy/bPFedRHIn3nQ7CW3FZCUAbZOyDtSQcA avqb5xSjLh28svQ2+hLk5FPYqtmP7PHy6nKPXEvCT3ww6JaAIMorx1jHhebqE+Jywgun /XOHYfszFpNHzFQzPZMy8p4bXjyo98atMB8AZ1Pa3YclISZvjhI1vauVE+9NLUd/vAqb Rlkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rPYbymtoHKh9e9lVKIEpSjqF/feMs3f5jyWwjyU8GaE=; b=OJC6GwU6xhMqIdDDe6LOWYpm/tVUWNn7Y1R/PZ3Za8bxG0MdN5UDwObiZ80MJhnWun yo3aVKbCndTMhGw99hb5hOA4KSeAnycpp+iQ18gIE6snfMs9nhapqRYtmXprkqiYMMGf LNk9e+7FsNXwvuLUdb1WWTL5Uhs5Rk5nM2f98ChjXCl9lbzA0DVdhTLLgEEqX6k/1ql/ 4A2EDCDULjRGqDBtQ9NKOVsdVPeXJOrCUA5qyZvMItOkcKK+kOC1TdgGCAcyxTtjiIMz JdW4glZZaRlF3vdLGuw+owt3m0B7qRwXfKZ2uTxwp35pOaALFFrhuqt8qrmR6SRncQ+1 EB8A== X-Gm-Message-State: AE9vXwPp5VQJkvK2ZBYZsmYGi96uo1IUcpD9zmDuFBp0PIiHp+/Y3GyGlJNnbWeZPrzjuA== X-Received: by 10.98.192.130 with SMTP id g2mr42747866pfk.54.1474250955874; Sun, 18 Sep 2016 19:09:15 -0700 (PDT) Received: from linux-u7w5.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id i68sm66777180pfc.25.2016.09.18.19.09.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 19:09:15 -0700 (PDT) From: van.freenix@gmail.com X-Google-Original-From: peng.fan@nxp.com To: julien.grall@arm.com, sstabellini@kernel.org, jbeulich@suse.com, andrew.cooper3@citrix.com, jgross@suse.com, dario.faggioli@citrix.com Date: Mon, 19 Sep 2016 10:08:52 +0800 Message-Id: <1474250936-27962-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1474250936-27962-1-git-send-email-peng.fan@nxp.com> References: <1474250936-27962-1-git-send-email-peng.fan@nxp.com> Cc: Peng Fan , xen-devel@lists.xen.org Subject: [Xen-devel] [RFC 1/5] xen/arm: domain_build: setting opt_dom0_max_vcpus according to cpupool0 info 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peng Fan Setting opt_dom0_max_vcpus according to cpu_valid in cpupool0. Signed-off-by: Peng Fan Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/domain_build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 35ab08d..d171c39 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ custom_param("dom0_mem", parse_dom0_mem); struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) { if ( opt_dom0_max_vcpus == 0 ) - opt_dom0_max_vcpus = num_online_cpus(); + opt_dom0_max_vcpus = cpumask_weight(cpupool0->cpu_valid); if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS ) opt_dom0_max_vcpus = MAX_VIRT_CPUS;