From a0ec8060549a8050300151d947be64c437780de6 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 21:19:17 -0700 Subject: [PATCH 13/75] x86/platform/uv: Remove the unused low memory redirect lookup get_lowmem_redirect() walks the three GAM alias overlay/redirect MMR pairs looking for the one that redirects low memory, and stashes the result in uv_hub_info_s::lowmem_remap_base/lowmem_remap_top. Those two fields were read by uv_gpa_to_soc_phys_ram(), which undid the low memory aliasing when translating a GRU global physical address back to a socket physical address. That helper is gone, and nothing else ever looked at the fields, so the MMRs are read at boot and the answer is thrown away. Remove get_lowmem_redirect(), its two local MMR helper defines and the two hub info fields. No functional change intended. --- arch/x86/include/asm/uv/uv_hub.h | 2 -- arch/x86/kernel/apic/x2apic_uv_x.c | 39 ------------------------------ 2 files changed, 41 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 4ee238040dd93..cdd7c324e27de 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -126,8 +126,6 @@ struct uv_hub_info_s { unsigned char apic_pnode_shift; unsigned char nasid_shift; unsigned int gnode_extra; - unsigned long lowmem_remap_top; - unsigned long lowmem_remap_base; unsigned short pnode; unsigned short pnode_mask; unsigned short coherency_domain_number; diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 5765844ef6c7f..c27ab0ae7173e 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -670,43 +670,6 @@ static struct apic apic_x2apic_uv_x __ro_after_init = { .icr_write = native_x2apic_icr_write, }; -#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_LENGTH 3 -#define DEST_SHIFT UVXH_RH_GAM_ALIAS_0_REDIRECT_CONFIG_DEST_BASE_SHFT - -static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) -{ - union uvh_rh_gam_alias_2_overlay_config_u alias; - union uvh_rh_gam_alias_2_redirect_config_u redirect; - unsigned long m_redirect; - unsigned long m_overlay; - int i; - - for (i = 0; i < UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_LENGTH; i++) { - switch (i) { - case 0: - m_redirect = UVH_RH_GAM_ALIAS_0_REDIRECT_CONFIG; - m_overlay = UVH_RH_GAM_ALIAS_0_OVERLAY_CONFIG; - break; - case 1: - m_redirect = UVH_RH_GAM_ALIAS_1_REDIRECT_CONFIG; - m_overlay = UVH_RH_GAM_ALIAS_1_OVERLAY_CONFIG; - break; - case 2: - m_redirect = UVH_RH_GAM_ALIAS_2_REDIRECT_CONFIG; - m_overlay = UVH_RH_GAM_ALIAS_2_OVERLAY_CONFIG; - break; - } - alias.v = uv_read_local_mmr(m_overlay); - if (alias.s.enable && alias.s.base == 0) { - *size = (1UL << alias.s.m_alias); - redirect.v = uv_read_local_mmr(m_redirect); - *base = (unsigned long)redirect.s.dest_base << DEST_SHIFT; - return; - } - } - *base = *size = 0; -} - static __init void map_high(char *id, unsigned long base, int pshift, int bshift, int max_pnode) { unsigned long bytes, paddr; @@ -1053,8 +1016,6 @@ static void __init uv_init_hub_info(struct uv_hub_info_s *hi) hi->global_mmr_shift = _UV_GLOBAL_MMR64_PNODE_SHIFT; } - get_lowmem_redirect(&hi->lowmem_remap_base, &hi->lowmem_remap_top); - hi->apic_pnode_shift = uv_cpuid.socketid_shift; /* Show system specific info: */ -- 2.43.0