x86: implement cpu_possible_map
PATCH 1/1 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.
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
--- xen/arch/x86/setup.c | 4 ++++ 1 file changed, 4 insertions(+)
xen/arch/x86/setup.c +4 -0
@@ -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. */
Signature · 7 lines
2.15.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 30 lines · Roger Pau Monne
On x86
cpu_possible_mapis not defined, so trying to usenum_possible_cpuswill generate link time errors.This patch defines and fills
cpu_possible_mapwith the current CPUs plus the hotpluggable ones.Note that this is already implemented on ARM.
Signed-off-by Roger Pau Monné <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/setup.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/setup.c +1
-0@@ -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) {
xen/arch/x86/setup.c void __init noreturn __start_xen(unsigned long mbi_p) · line 1485
Quoted 10 lines
xen/arch/x86/setup.c +3
-0max_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);
There are no concurrency issues, so you can use __cpumask_set_cpu().
However, bitmap_fill(... , nr_cpu_ids) would be far more efficient.
Otherwise, Reviewed-by: Andrew Cooper <[email protected]>
xen/arch/x86/setup.c void __init noreturn __start_xen(unsigned long mbi_p) · line 1488
Quoted 3 lines
xen/arch/x86/setup.c +0
-0}/* Low mappings were only needed for some BIOS table parsing. */
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 44 lines · Andrew Cooper
Quoted 30 lines · Roger Pau Monne
On x86
cpu_possible_mapis not defined, so trying to usenum_possible_cpuswill generate link time errors.This patch defines and fills
cpu_possible_mapwith the current CPUs plus the hotpluggable ones.Note that this is already implemented on ARM.
Signed-off-by Roger Pau Monné <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/setup.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/setup.c +1
-0@@ -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) {xen/arch/x86/setup.c void __init noreturn __start_xen(unsigned long mbi_p) · line 1485
Quoted 10 lines
xen/arch/x86/setup.c +3
-0max_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);There are no concurrency issues, so you can use
__cpumask_set_cpu().
Quoted 1 line
However, bitmap_fill(... ,
nr_cpu_ids) would be far more efficient.
I would rather use the unlocked version of the cpumask operation, using bitmap directly seems like a layering violation.
Quoted 1 line
Otherwise, Reviewed-by: Andrew Cooper <[email protected]>
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel