[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] x86: implement cpu_possible_map



On x86 cpu_possible_map is not defined, so trying to use
num_possible_cpus will generate link time errors.

This patch defines and fills cpu_possible_map with the current CPUs
plus the hotpluggable ones.

Note that this is already implemented on ARM.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
Changes since v1:
 - Use unlocked cpumask operations.
---
 xen/arch/x86/setup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 99f5d61eb8..bd6d8d0da6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -86,6 +86,7 @@ size_param("highmem-start", highmem_start);
 #endif
 
 cpumask_t __read_mostly cpu_present_map;
+cpumask_t __read_mostly cpu_possible_map;
 
 unsigned long __read_mostly xen_phys_start;
 
@@ -1474,11 +1475,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     {
         max_cpus = 0;
         set_nr_cpu_ids(1);
+        __cpumask_set_cpu(0, &cpu_possible_map);
     }
     else
     {
         set_nr_cpu_ids(max_cpus);
         max_cpus = nr_cpu_ids;
+        for ( i = 0; i < nr_cpu_ids; i++ )
+            __cpumask_set_cpu(i, &cpu_possible_map);
     }
 
     /* Low mappings were only needed for some BIOS table parsing. */
-- 
2.15.1


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.