[xen master] xen: fill topology info for all present cpus

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] xen: fill topology info for all present cpus

patchbot
commit 780e2d309812e54353259bb9e6c28886e994b065
Author:     Juergen Gross <[hidden email]>
AuthorDate: Fri Aug 31 17:22:05 2018 +0200
Commit:     Wei Liu <[hidden email]>
CommitDate: Wed Sep 5 11:21:26 2018 +0100

    xen: fill topology info for all present cpus
   
    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 <[hidden email]>
    Reviewed-by: Wei Liu <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
    Acked-by: Julien Grall <[hidden email]>
---
 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 = { };
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog