xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	sstabellini@kernel.org, wei.liu2@citrix.com,
	George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com
Subject: [PATCH v2 2/2] xen: fill topology info for all present cpus
Date: Fri, 31 Aug 2018 17:22:05 +0200	[thread overview]
Message-ID: <20180831152205.21872-3-jgross@suse.com> (raw)
In-Reply-To: <20180831152205.21872-1-jgross@suse.com>

The topology information obtainable via XEN_SYSCTL_cputopoinfo is
filled rather weird: the size of the array is derived from the highest
online cpu number, so in case there are trailing offline cpus they
will not be included.

On a dual core system with 4 threads booted with smt=0 without this
patch xl info -n will print:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  1:       0        0        0
  2:       1        0        0

while with this patch the output is:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  1:       0        0        0
  2:       1        0        0
  3:       1        0        0

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 8e83c33a16..c0aa6bde4e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -349,7 +349,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         unsigned int i, num_cpus;
         struct xen_sysctl_cputopoinfo *ti = &op->u.cputopoinfo;
 
-        num_cpus = cpumask_last(&cpu_online_map) + 1;
+        num_cpus = cpumask_last(&cpu_present_map) + 1;
         if ( !guest_handle_is_null(ti->cputopo) )
         {
             struct xen_sysctl_cputopo cputopo = { };
-- 
2.16.4


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

  parent reply	other threads:[~2018-08-31 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 15:22 [PATCH v2 0/2] fix smt=0 fallout Juergen Gross
2018-08-31 15:22 ` [PATCH v2 1/2] tools/libxl: correct vcpu affinity output with sparse physical cpu map Juergen Gross
2018-08-31 15:22 ` Juergen Gross [this message]
2018-08-31 16:37   ` [PATCH v2 2/2] xen: fill topology info for all present cpus Wei Liu
2018-09-03 13:41   ` Jan Beulich
2018-09-04  7:38     ` Juergen Gross
2018-09-04  8:49       ` Jan Beulich
2018-09-04  9:39         ` Julien Grall

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=20180831152205.21872-3-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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).