From 635ae7d4397ff84323a1a7f8ab7ec3a7915b91c2 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 21:18:36 -0700 Subject: [PATCH 12/75] x86/platform/uv: Remove the write-only GPA address format fields struct uv_hub_info_s carries a description of the socket physical address layout: m_val/n_val (the number of node offset and PNODE bits), the derived m_shift/n_lshift, gpa_shift/gpa_mask, and gnode_upper. All of it existed for the socket-physical-address to global-physical- address conversion helpers which were removed earlier in this series, and for the GRU TLB dropin path before that. What is left only ever assigns these fields and prints them; nothing consumes them. get_mn() still has to run because uv_cpuid.gnode_shift is derived from mn.n_val, so keep it and source the "UV: N:%d M:%d ..." boot message from the local struct mn instead of from the hub info. The output is unchanged. The gpa_mask/gpa_shift half of the next line goes away with the fields. That is no real loss: gpa_shift is already printed by decode_gam_params() as part of "UV: GAM Params...", gpa_mask is just (1 << gpa_shift) - 1, and on UV2/UV3 - where there is no GAM parameters table - gpa_shift was never assigned at all, so the message printed a bare 0 next to a gpa_mask computed from mn. Drop gnode_upper from the last line for the same reason and leave gnode_extra, which is still used by UV_PNODE_TO_GNODE(). No functional change intended. --- arch/x86/include/asm/uv/uv_hub.h | 7 ------- arch/x86/kernel/apic/x2apic_uv_x.c | 20 +++++--------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 71124a309ef37..4ee238040dd93 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -118,21 +118,14 @@ struct uv_hub_info_s { unsigned char hub_revision; unsigned long global_mmr_base; unsigned long global_mmr_shift; - unsigned long gpa_mask; unsigned short *socket_to_node; unsigned short *socket_to_pnode; unsigned short *pnode_to_socket; unsigned short min_socket; unsigned short min_pnode; - unsigned char m_val; - unsigned char n_val; unsigned char apic_pnode_shift; - unsigned char gpa_shift; unsigned char nasid_shift; - unsigned char m_shift; - unsigned char n_lshift; unsigned int gnode_extra; - unsigned long gnode_upper; unsigned long lowmem_remap_top; unsigned long lowmem_remap_base; unsigned short pnode; diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 42a27b2fa6420..5765844ef6c7f 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1028,14 +1028,7 @@ static void __init uv_init_hub_info(struct uv_hub_info_s *hi) struct mn mn; get_mn(&mn); - hi->gpa_mask = mn.m_val ? - (1UL << (mn.m_val + mn.n_val)) - 1 : - (1UL << uv_cpuid.gpa_shift) - 1; - - hi->m_val = mn.m_val; - hi->n_val = mn.n_val; - hi->m_shift = mn.m_shift; - hi->n_lshift = mn.n_lshift ? mn.n_lshift : 0; + hi->hub_revision = uv_hub_info->hub_revision; hi->hub_type = uv_hub_info->hub_type; hi->pnode_mask = uv_cpuid.pnode_mask; @@ -1049,14 +1042,10 @@ static void __init uv_init_hub_info(struct uv_hub_info_s *hi) uv_cpuid.gnode_shift = max_t(unsigned int, uv_cpuid.gnode_shift, mn.n_val); hi->gnode_extra = (uv_node_id & ~((1 << uv_cpuid.gnode_shift) - 1)) >> 1; - if (mn.m_val) - hi->gnode_upper = (u64)hi->gnode_extra << mn.m_val; if (uv_gp_table) { hi->global_mmr_base = uv_gp_table->mmr_base; hi->global_mmr_shift = uv_gp_table->mmr_shift; - hi->gpa_shift = uv_gp_table->gpa_shift; - hi->gpa_mask = (1UL << hi->gpa_shift) - 1; } else { hi->global_mmr_base = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG) & @@ -1069,10 +1058,11 @@ static void __init uv_init_hub_info(struct uv_hub_info_s *hi) hi->apic_pnode_shift = uv_cpuid.socketid_shift; /* Show system specific info: */ - pr_info("UV: N:%d M:%d m_shift:%d n_lshift:%d\n", hi->n_val, hi->m_val, hi->m_shift, hi->n_lshift); - pr_info("UV: gpa_mask/shift:0x%lx/%d pnode_mask:0x%x apic_pns:%d\n", hi->gpa_mask, hi->gpa_shift, hi->pnode_mask, hi->apic_pnode_shift); + pr_info("UV: N:%d M:%d m_shift:%d n_lshift:%d\n", + mn.n_val, mn.m_val, mn.m_shift, mn.n_lshift); + pr_info("UV: pnode_mask:0x%x apic_pns:%d\n", hi->pnode_mask, hi->apic_pnode_shift); pr_info("UV: mmr_base/shift:0x%lx/%ld\n", hi->global_mmr_base, hi->global_mmr_shift); - pr_info("UV: gnode_upper:0x%lx gnode_extra:0x%x\n", hi->gnode_upper, hi->gnode_extra); + pr_info("UV: gnode_extra:0x%x\n", hi->gnode_extra); } static void __init decode_gam_params(unsigned long ptr) -- 2.43.0