From cbc989940ed5d9ab5885ee8f5f895729142578dc Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 20:41:15 -0700 Subject: [PATCH 08/75] x86/platform/uv: Remove the unused online-cpu count and uv_cpu_init() uv_hub_info->nr_online_cpus was there so that a driver could ask how many cpus on a blade were up, via uv_blade_nr_online_cpus(). Nothing has called that since the SGI XP and GRU drivers were removed: commit dbf69afe320e ("misc: sgi-xp: Remove SGI XP drivers") commit 85de4712bccf ("misc: sgi-gru: Remove SGI GRU driver") Maintaining the counter was the only thing uv_cpu_init() did, so it becomes an empty function. Drop it too, which removes the last UV-specific hook from cpu_init() and the include from arch/x86/kernel/cpu/common.c. Note that the counter was never accurate anyway: it was only bumped on the way up and never decremented on cpu offline, as the "hotplug not supported yet" comment on uv_cpu_init() admitted. The number of *possible* cpus per blade, nr_possible_cpus, is still computed and used and is unaffected. No functional change intended. --- arch/x86/include/asm/uv/uv.h | 2 -- arch/x86/include/asm/uv/uv_hub.h | 7 ------- arch/x86/kernel/apic/x2apic_uv_x.c | 15 --------------- arch/x86/kernel/cpu/common.c | 4 ---- 4 files changed, 28 deletions(-) diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h index 648eb23fe7f0b..b53c779d1cb00 100644 --- a/arch/x86/include/asm/uv/uv.h +++ b/arch/x86/include/asm/uv/uv.h @@ -26,7 +26,6 @@ static inline bool is_early_uv_system(void) } extern int is_uv_system(void); extern int is_uv_hubbed(int uvtype); -extern void uv_cpu_init(void); extern void uv_nmi_init(void); extern void uv_system_init(void); @@ -36,7 +35,6 @@ static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; } static inline bool is_early_uv_system(void) { return 0; } static inline int is_uv_system(void) { return 0; } static inline int is_uv_hubbed(int uv) { return 0; } -static inline void uv_cpu_init(void) { } static inline void uv_system_init(void) { } #endif /* X86_UV */ diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 77c19382e25dc..fd5e550402b09 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -173,7 +173,6 @@ struct uv_hub_info_s { unsigned short coherency_domain_number; unsigned short numa_blade_id; unsigned short nr_possible_cpus; - unsigned short nr_online_cpus; short memory_nid; unsigned short *node_to_socket; }; @@ -470,12 +469,6 @@ static inline int uv_blade_nr_possible_cpus(int bid) return uv_hub_info_list(uv_blade_to_node(bid))->nr_possible_cpus; } -/* Determine the number of online cpus on a blade */ -static inline int uv_blade_nr_online_cpus(int bid) -{ - return uv_hub_info_list(uv_blade_to_node(bid))->nr_online_cpus; -} - /* Convert a cpu id to the PNODE of the blade containing the cpu */ static inline int uv_cpu_to_pnode(int cpu) { diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 22dc31b29dc6b..2d7a05683ef7f 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1093,19 +1093,6 @@ static int uv_set_vga_state(struct pci_dev *pdev, bool decode, unsigned int comm return rc; } -/* - * Called on each CPU to initialize the per_cpu UV data area. - * FIXME: hotplug not supported yet - */ -void uv_cpu_init(void) -{ - /* CPU 0 initialization will be done via uv_system_init. */ - if (smp_processor_id() == 0) - return; - - uv_hub_info->nr_online_cpus++; -} - struct mn { unsigned char m_val; unsigned char n_val; @@ -1687,7 +1674,6 @@ static void __init uv_system_init_hub(void) new_hub->numa_blade_id = bid; new_hub->memory_nid = NUMA_NO_NODE; new_hub->nr_possible_cpus = 0; - new_hub->nr_online_cpus = 0; } /* @@ -1749,7 +1735,6 @@ static void __init uv_system_init_hub(void) uv_hub_info_list_blade = NULL; uv_nmi_setup(); - uv_cpu_init(); uv_setup_proc_files(0); /* Register Legacy VGA I/O redirection handler: */ diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c7352827f491d..4d0495677f149 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -2520,9 +2519,6 @@ void cpu_init(void) doublefault_init_cpu_tss(); - if (is_uv_system()) - uv_cpu_init(); - load_fixmap_gdt(cpu); } -- 2.43.0