xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
	konrad.wilk@oracle.com
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v6 5/7] x86/PVHv2: fix dom0_max_vcpus so it's capped to HVM_MAX_VCPUS for PVHv2 Dom0
Date: Fri, 10 Feb 2017 12:33:49 +0000	[thread overview]
Message-ID: <20170210123351.73526-6-roger.pau@citrix.com> (raw)
In-Reply-To: <20170210123351.73526-1-roger.pau@citrix.com>

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.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v5:
 - Introduce a new limit local variable and use that to store the guest max
   number of vCPUs, this allows having a single check suitable for both PVH and
   PV.

Changes since v4:
 - Fix codding style to match rest of the function.

Changes since v3:
 - New in the series.
---
 xen/arch/x86/domain_build.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 01c9348..407e479 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -40,6 +40,7 @@
 
 #include <public/version.h>
 #include <public/arch-x86/hvm/start_info.h>
+#include <public/hvm/hvm_info_table.h>
 
 static long __initdata dom0_nrpages;
 static long __initdata dom0_min_nrpages;
@@ -157,7 +158,7 @@ static nodemask_t __initdata dom0_nodes;
 
 unsigned int __init dom0_max_vcpus(void)
 {
-    unsigned int i, max_vcpus;
+    unsigned int i, max_vcpus, limit;
     nodeid_t node;
 
     for ( i = 0; i < dom0_nr_pxms; ++i )
@@ -177,8 +178,9 @@ unsigned int __init dom0_max_vcpus(void)
         max_vcpus = opt_dom0_max_vcpus_min;
     if ( opt_dom0_max_vcpus_max < max_vcpus )
         max_vcpus = opt_dom0_max_vcpus_max;
-    if ( max_vcpus > MAX_VIRT_CPUS )
-        max_vcpus = MAX_VIRT_CPUS;
+    limit = dom0_pvh ? HVM_MAX_VCPUS : MAX_VIRT_CPUS;
+    if ( max_vcpus > limit )
+        max_vcpus = limit;
 
     return max_vcpus;
 }
-- 
2.10.1 (Apple Git-78)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-02-10 12:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 12:33 [PATCH v6 0/7] Initial PVHv2 Dom0 support Roger Pau Monne
2017-02-10 12:33 ` [PATCH v6 1/7] xen/x86: remove XENFEAT_hvm_pirqs for PVHv2 guests Roger Pau Monne
2017-02-13 13:09   ` Jan Beulich
2017-02-13 14:22     ` Roger Pau Monne
2017-02-13 14:33       ` Jan Beulich
2017-02-13 14:48         ` Roger Pau Monne
2017-02-10 12:33 ` [PATCH v6 2/7] xen/x86: split Dom0 build into PV and PVHv2 Roger Pau Monne
2017-02-10 13:32   ` Andrew Cooper
2017-02-13 13:12   ` Jan Beulich
2017-02-10 12:33 ` [PATCH v6 3/7] xen/x86: populate PVHv2 Dom0 physical memory map Roger Pau Monne
2017-02-13 13:53   ` Jan Beulich
2017-02-14 10:10     ` Roger Pau Monne
2017-02-14 10:19       ` Roger Pau Monne
2017-02-14 10:22         ` Jan Beulich
2017-02-14 10:20       ` Jan Beulich
2017-02-10 12:33 ` [PATCH v6 4/7] xen/x86: parse Dom0 kernel for PVHv2 Roger Pau Monne
2017-02-10 14:34   ` Ian Jackson
2017-02-13 12:07     ` Roger Pau Monne
2017-02-10 12:33 ` Roger Pau Monne [this message]
2017-02-13 13:57   ` [PATCH v6 5/7] x86/PVHv2: fix dom0_max_vcpus so it's capped to HVM_MAX_VCPUS for PVHv2 Dom0 Jan Beulich
2017-02-10 12:33 ` [PATCH v6 6/7] xen/x86: Setup PVHv2 Dom0 CPUs Roger Pau Monne
2017-02-13 13:59   ` Jan Beulich
2017-02-10 12:33 ` [PATCH v6 7/7] xen/x86: setup PVHv2 Dom0 ACPI tables Roger Pau Monne
2017-02-22 10:08   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170210123351.73526-6-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).