From 55bc0358cb25aaba1ba610fb88a134bfc5de2108 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 20:41:52 -0700 Subject: [PATCH 09/75] x86/platform/uv: Remove unused hub topology helpers More surface that lost its users along with the SGI XP and GRU drivers: - uv_numa_blade_id() - the blade the current cpu is on. Callers that still need this ask for a specific cpu with uv_cpu_to_blade_id(). - uv_node_to_pnode() - the PNODE behind a Linux node number. - uv_blade_to_memory_nid() - the node id of a blade's local memory, and with it uv_hub_info->memory_nid, which was only ever set so that this could report it. - UV_NASID_TO_PNODE() - the NASID-to-PNODE direction of the addressing macros. The other two, UV_PNODE_TO_GNODE() and UV_PNODE_TO_NASID(), are still used. - UV_APIC_PNODE_SHIFT - a hardcoded APICID pnode shift. The real shift comes from CPUID and lives in uv_hub_info->apic_pnode_shift. - UV_MAX_NUMALINK_BLADES, UV_MAX_SSI_BLADES and UV_MAX_NASID_VALUE - fabric sizing limits nothing checks against. uv_num_possible_blades() reports the actual count. No functional change intended. --- arch/x86/include/asm/uv/uv_hub.h | 45 ------------------------------ arch/x86/kernel/apic/x2apic_uv_x.c | 4 --- 2 files changed, 49 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index fd5e550402b09..977b1d7393b58 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -107,29 +107,6 @@ * processor APICID register. */ -/* - * Maximum number of bricks in all partitions and in all coherency domains. - * This is the total number of bricks accessible in the numalink fabric. It - * includes all C & M bricks. Routers are NOT included. - * - * This value is also the value of the maximum number of non-router NASIDs - * in the numalink fabric. - * - * NOTE: a brick may contain 1 or 2 OS nodes. Don't get these confused. - */ -#define UV_MAX_NUMALINK_BLADES 16384 - -/* - * Maximum number of C/Mbricks within a software SSI (hardware may support - * more). - */ -#define UV_MAX_SSI_BLADES 256 - -/* - * The largest possible NASID of a C or M brick (+ 2) - */ -#define UV_MAX_NASID_VALUE (UV_MAX_NUMALINK_BLADES * 2) - /* GAM (globally addressed memory) range table */ struct uv_gam_range_s { u32 limit; /* PA bits 56:26 (GAM_RANGE_SHFT) */ @@ -173,7 +150,6 @@ struct uv_hub_info_s { unsigned short coherency_domain_number; unsigned short numa_blade_id; unsigned short nr_possible_cpus; - short memory_nid; unsigned short *node_to_socket; }; @@ -272,8 +248,6 @@ union uvh_apicid { * g - GNODE (full 15-bit global nasid, right shifted 1) * p - PNODE (local part of nsids, right shifted 1) */ -#define UV_NASID_TO_PNODE(n) \ - (((n) >> uv_hub_info->nasid_shift) & uv_hub_info->pnode_mask) #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra) #define UV_PNODE_TO_NASID(p) \ (UV_PNODE_TO_GNODE(p) << uv_hub_info->nasid_shift) @@ -335,7 +309,6 @@ union uvh_apicid { (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) #define UVH_APICID 0x002D0E00L -#define UV_APIC_PNODE_SHIFT 6 /* Loop through all installed blades */ #define for_each_possible_blade(bid) \ @@ -425,12 +398,6 @@ static inline int uv_blade_to_node(int blade) return uv_socket_to_node(blade); } -/* Blade number of current cpu. Numbered 0 .. <#blades -1> */ -static inline int uv_numa_blade_id(void) -{ - return uv_hub_info->numa_blade_id; -} - /* * Convert linux node number to the UV blade number. * .. Currently for UV2 thru UV4 the node and the blade are identical. @@ -457,12 +424,6 @@ static inline int uv_blade_to_pnode(int bid) return s2p ? s2p[bid] : bid; } -/* Nid of memory node on blade. -1 if no blade-local memory */ -static inline int uv_blade_to_memory_nid(int bid) -{ - return uv_hub_info_list(uv_blade_to_node(bid))->memory_nid; -} - /* Determine the number of possible cpus on a blade */ static inline int uv_blade_nr_possible_cpus(int bid) { @@ -475,12 +436,6 @@ static inline int uv_cpu_to_pnode(int cpu) return uv_cpu_hub_info(cpu)->pnode; } -/* Convert a linux node number to the PNODE of the blade */ -static inline int uv_node_to_pnode(int nid) -{ - return uv_hub_info_list(nid)->pnode; -} - /* Maximum possible number of blades */ extern short uv_possible_blades; static inline int uv_num_possible_blades(void) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 2d7a05683ef7f..46a841471ba08 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1672,7 +1672,6 @@ static void __init uv_system_init_hub(void) new_hub->pnode = 0xffff; new_hub->numa_blade_id = bid; - new_hub->memory_nid = NUMA_NO_NODE; new_hub->nr_possible_cpus = 0; } @@ -1706,9 +1705,6 @@ static void __init uv_system_init_hub(void) uv_cpu_info_per(cpu)->p_uv_hub_info = uv_hub_info_list_blade[bid]; uv_cpu_info_per(cpu)->blade_cpu_id = uv_cpu_hub_info(cpu)->nr_possible_cpus++; - if (uv_cpu_hub_info(cpu)->memory_nid == NUMA_NO_NODE) - uv_cpu_hub_info(cpu)->memory_nid = cpu_to_node(cpu); - if (uv_cpu_hub_info(cpu)->pnode == 0xffff) uv_cpu_hub_info(cpu)->pnode = pnode; } -- 2.43.0