On 09/26/2015 08:08 AM, Ingo Molnar wrote: >> # define MAX_IO_APICS 128 >> # define MAX_LOCAL_APIC 32768 >> #endif >> >> (It seems to be a bit of a misnomer, it's not a maximum >> number of APICs we support, it's the highest APIC _id_ >> we support.) > > Gah, that's a pretty serious misnomer - so it should be fixed regardless of > the outcome of the sizing discussion.
So renamed. No code changes. Signed-off-by: Denys Vlasenko <dvlas...@redhat.com> CC: Ingo Molnar <mi...@kernel.org> CC: Daniel J Blueman <dan...@numascale.com> CC: Jiang Liu <jiang....@linux.intel.com> CC: Thomas Gleixner <t...@linutronix.de> CC: Len Brown <len.br...@intel.com> CC: x...@kernel.org CC: linux-kernel@vger.kernel.org --- arch/x86/include/asm/apicdef.h | 4 ++-- arch/x86/include/asm/mpspec.h | 20 ++++++++++---------- arch/x86/include/asm/numa.h | 2 +- arch/x86/kernel/acpi/boot.c | 8 ++++---- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/mm/numa.c | 6 +++--- arch/x86/mm/srat.c | 4 ++-- arch/x86/platform/sfi/sfi.c | 4 ++-- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index c46bb99..ccb3a04 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h @@ -149,10 +149,10 @@ #ifdef CONFIG_X86_32 # define MAX_IO_APICS 64 -# define MAX_LOCAL_APIC 256 +# define MAX_LOCAL_APICID 256 #else # define MAX_IO_APICS 128 -# define MAX_LOCAL_APIC 32768 +# define MAX_LOCAL_APICID 32768 #endif /* diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index b07233b..e84e542 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -87,7 +87,7 @@ static inline void early_reserve_e820_mpc_new(void) { } int generic_processor_info(int apicid, int version); -#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) +#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APICID) struct physid_mask { unsigned long mask[PHYSID_ARRAY_SIZE]; @@ -102,31 +102,31 @@ typedef struct physid_mask physid_mask_t; test_and_set_bit(physid, (map).mask) #define physids_and(dst, src1, src2) \ - bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_LOCAL_APIC) + bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_LOCAL_APICID) #define physids_or(dst, src1, src2) \ - bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_LOCAL_APIC) + bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_LOCAL_APICID) #define physids_clear(map) \ - bitmap_zero((map).mask, MAX_LOCAL_APIC) + bitmap_zero((map).mask, MAX_LOCAL_APICID) #define physids_complement(dst, src) \ - bitmap_complement((dst).mask, (src).mask, MAX_LOCAL_APIC) + bitmap_complement((dst).mask, (src).mask, MAX_LOCAL_APICID) #define physids_empty(map) \ - bitmap_empty((map).mask, MAX_LOCAL_APIC) + bitmap_empty((map).mask, MAX_LOCAL_APICID) #define physids_equal(map1, map2) \ - bitmap_equal((map1).mask, (map2).mask, MAX_LOCAL_APIC) + bitmap_equal((map1).mask, (map2).mask, MAX_LOCAL_APICID) #define physids_weight(map) \ - bitmap_weight((map).mask, MAX_LOCAL_APIC) + bitmap_weight((map).mask, MAX_LOCAL_APICID) #define physids_shift_right(d, s, n) \ - bitmap_shift_right((d).mask, (s).mask, n, MAX_LOCAL_APIC) + bitmap_shift_right((d).mask, (s).mask, n, MAX_LOCAL_APICID) #define physids_shift_left(d, s, n) \ - bitmap_shift_left((d).mask, (s).mask, n, MAX_LOCAL_APIC) + bitmap_shift_left((d).mask, (s).mask, n, MAX_LOCAL_APICID) static inline unsigned long physids_coerce(physid_mask_t *map) { diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 01b493e..c2ecfd0 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -27,7 +27,7 @@ extern int numa_off; * should be accessed by the accessors - set_apicid_to_node() and * numa_cpu_node(). */ -extern s16 __apicid_to_node[MAX_LOCAL_APIC]; +extern s16 __apicid_to_node[MAX_LOCAL_APICID]; extern nodemask_t numa_nodes_parsed __initdata; extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index ded848c..2a0397b 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -169,7 +169,7 @@ static int acpi_register_lapic(int id, u8 enabled) { unsigned int ver = 0; - if (id >= MAX_LOCAL_APIC) { + if (id >= MAX_LOCAL_APICID) { printk(KERN_INFO PREFIX "skipped apicid that is too big\n"); return -EINVAL; } @@ -996,13 +996,13 @@ static int __init acpi_parse_madt_lapic_entries(void) register_lapic_address(acpi_lapic_addr); count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, - acpi_parse_sapic, MAX_LOCAL_APIC); + acpi_parse_sapic, MAX_LOCAL_APICID); if (!count) { x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC, - acpi_parse_x2apic, MAX_LOCAL_APIC); + acpi_parse_x2apic, MAX_LOCAL_APICID); count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, - acpi_parse_lapic, MAX_LOCAL_APIC); + acpi_parse_lapic, MAX_LOCAL_APICID); } if (!count && !x2count) { printk(KERN_ERR PREFIX "No LAPIC entries present\n"); diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 24e94ce..b08b447 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1798,7 +1798,7 @@ void __init register_lapic_address(unsigned long address) } } -int apic_version[MAX_LOCAL_APIC]; +int apic_version[MAX_LOCAL_APICID]; /* * Local APIC interrupts diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 4a70fc6..57bc7dd 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -281,7 +281,7 @@ static int nearby_node(int apicid) if (node != NUMA_NO_NODE && node_online(node)) return node; } - for (i = apicid + 1; i < MAX_LOCAL_APIC; i++) { + for (i = apicid + 1; i < MAX_LOCAL_APICID; i++) { node = __apicid_to_node[i]; if (node != NUMA_NO_NODE && node_online(node)) return node; diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index c3b3f65..c80d43b 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -56,8 +56,8 @@ early_param("numa", numa_setup); /* * apicid, cpu, node mappings */ -s16 __apicid_to_node[MAX_LOCAL_APIC] = { - [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE +s16 __apicid_to_node[MAX_LOCAL_APICID] = { + [0 ... MAX_LOCAL_APICID-1] = NUMA_NO_NODE }; int numa_cpu_node(int cpu) @@ -607,7 +607,7 @@ static int __init numa_init(int (*init_func)(void)) int i; int ret; - for (i = 0; i < MAX_LOCAL_APIC; i++) + for (i = 0; i < MAX_LOCAL_APICID; i++) set_apicid_to_node(i, NUMA_NO_NODE); nodes_clear(numa_nodes_parsed); diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index c2aea63..02896fc 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -98,7 +98,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) return; } - if (apic_id >= MAX_LOCAL_APIC) { + if (apic_id >= MAX_LOCAL_APICID) { printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); return; } @@ -139,7 +139,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) else apic_id = pa->apic_id; - if (apic_id >= MAX_LOCAL_APIC) { + if (apic_id >= MAX_LOCAL_APICID) { printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); return; } diff --git a/arch/x86/platform/sfi/sfi.c b/arch/x86/platform/sfi/sfi.c index 6c7111b..4c541ac 100644 --- a/arch/x86/platform/sfi/sfi.c +++ b/arch/x86/platform/sfi/sfi.c @@ -38,9 +38,9 @@ static unsigned long sfi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; /* All CPUs enumerated by SFI must be present and enabled */ static void __init mp_sfi_register_lapic(u8 id) { - if (MAX_LOCAL_APIC - id <= 0) { + if (MAX_LOCAL_APICID - id <= 0) { pr_warning("Processor #%d invalid (max %d)\n", - id, MAX_LOCAL_APIC); + id, MAX_LOCAL_APICID); return; } -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/