diff options
-rw-r--r-- | arch/x86/kernel/apic_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 5 | ||||
-rw-r--r-- | include/asm-x86/mpspec.h | 7 |
4 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index d5767cb19d56..3f13a1aa07cd 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1269,7 +1269,7 @@ int __init APIC_init_uniprocessor(void) | |||
1269 | #ifdef CONFIG_CRASH_DUMP | 1269 | #ifdef CONFIG_CRASH_DUMP |
1270 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1270 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); |
1271 | #endif | 1271 | #endif |
1272 | phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); | 1272 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); |
1273 | 1273 | ||
1274 | setup_local_APIC(); | 1274 | setup_local_APIC(); |
1275 | 1275 | ||
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 0633cfd0dc29..5e22f8d2d507 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -942,7 +942,7 @@ int __init APIC_init_uniprocessor(void) | |||
942 | 942 | ||
943 | verify_local_APIC(); | 943 | verify_local_APIC(); |
944 | 944 | ||
945 | phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); | 945 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); |
946 | apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid)); | 946 | apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid)); |
947 | 947 | ||
948 | setup_local_APIC(); | 948 | setup_local_APIC(); |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 3e1cecedde42..664a5db36d40 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1091,10 +1091,9 @@ static __init void disable_smp(void) | |||
1091 | smpboot_clear_io_apic_irqs(); | 1091 | smpboot_clear_io_apic_irqs(); |
1092 | #endif | 1092 | #endif |
1093 | if (smp_found_config) | 1093 | if (smp_found_config) |
1094 | phys_cpu_present_map = | 1094 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); |
1095 | physid_mask_of_physid(boot_cpu_physical_apicid); | ||
1096 | else | 1095 | else |
1097 | phys_cpu_present_map = physid_mask_of_physid(0); | 1096 | physid_set_mask_of_physid(0, &phys_cpu_present_map); |
1098 | map_cpu_to_logical_apicid(); | 1097 | map_cpu_to_logical_apicid(); |
1099 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 1098 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
1100 | cpu_set(0, per_cpu(cpu_core_map, 0)); | 1099 | cpu_set(0, per_cpu(cpu_core_map, 0)); |
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h index 57a991b9c053..b69e7ba7bf1d 100644 --- a/include/asm-x86/mpspec.h +++ b/include/asm-x86/mpspec.h | |||
@@ -101,6 +101,7 @@ typedef struct physid_mask physid_mask_t; | |||
101 | __physid_mask; \ | 101 | __physid_mask; \ |
102 | }) | 102 | }) |
103 | 103 | ||
104 | /* Note: will create very large stack frames if physid_mask_t is big */ | ||
104 | #define physid_mask_of_physid(physid) \ | 105 | #define physid_mask_of_physid(physid) \ |
105 | ({ \ | 106 | ({ \ |
106 | physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ | 107 | physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ |
@@ -108,6 +109,12 @@ typedef struct physid_mask physid_mask_t; | |||
108 | __physid_mask; \ | 109 | __physid_mask; \ |
109 | }) | 110 | }) |
110 | 111 | ||
112 | static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map) | ||
113 | { | ||
114 | physids_clear(*map); | ||
115 | physid_set(physid, *map); | ||
116 | } | ||
117 | |||
111 | #define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } | 118 | #define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } |
112 | #define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } | 119 | #define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } |
113 | 120 | ||