From 75d50930a340addf8e8594419d00ba2f127c9779 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 20:36:03 -0700 Subject: [PATCH 05/75] x86/platform/uv: Remove unused global MMR accessors UV hub MMRs can be reached two ways: through the 64-bit global MMR window at the top of physical memory, or - on UV2/UV3 only - through a 32MB low-memory MMR32 window which is faster but does not expose every register. The MMR32 accessors, uv_read_global_mmr32() and uv_write_global_mmr32(), were used by the GRU driver and have had no callers since commit 85de4712bccf ("misc: sgi-gru: Remove SGI GRU driver") so uv_global_mmr32_address() and the UV_GLOBAL_MMR32_PNODE_BITS()/_SHIFT address arithmetic that only it used go with them. uv_read_global_mmr8()/uv_write_global_mmr8() are byte-wide accessors for the 64-bit window and have no callers either. Remove the five accessors and the two address macros. UV_GLOBAL_MMR32_BASE and UV_GLOBAL_MMR32_SIZE stay: map_low_mmrs() still creates the uncached mapping of the window at boot. No functional change intended. --- arch/x86/include/asm/uv/uv_hub.h | 33 -------------------------------- 1 file changed, 33 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 831643a1caba6..be1b1dacb7449 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -333,12 +333,9 @@ union uvh_apicid { #define UV_GLOBAL_GRU_MMR_BASE 0x4000000 -#define UV_GLOBAL_MMR32_PNODE_SHIFT 15 #define _UV_GLOBAL_MMR64_PNODE_SHIFT 26 #define UV_GLOBAL_MMR64_PNODE_SHIFT (uv_hub_info->global_mmr_shift) -#define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT)) - #define UV_GLOBAL_MMR64_PNODE_BITS(p) \ (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) @@ -376,26 +373,6 @@ static inline int uv_apicid_to_pnode(int apicid) return s2pn ? s2pn[pnode - uv_hub_info->min_socket] : pnode; } -/* - * Access global MMRs using the low memory MMR32 space. This region supports - * faster MMR access but not all MMRs are accessible in this space. - */ -static inline unsigned long *uv_global_mmr32_address(int pnode, unsigned long offset) -{ - return __va(UV_GLOBAL_MMR32_BASE | - UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset); -} - -static inline void uv_write_global_mmr32(int pnode, unsigned long offset, unsigned long val) -{ - writeq(val, uv_global_mmr32_address(pnode, offset)); -} - -static inline unsigned long uv_read_global_mmr32(int pnode, unsigned long offset) -{ - return readq(uv_global_mmr32_address(pnode, offset)); -} - /* * Access Global MMR space using the MMR space located at the top of physical * memory. @@ -416,16 +393,6 @@ static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset return readq(uv_global_mmr64_address(pnode, offset)); } -static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val) -{ - writeb(val, uv_global_mmr64_address(pnode, offset)); -} - -static inline unsigned char uv_read_global_mmr8(int pnode, unsigned long offset) -{ - return readb(uv_global_mmr64_address(pnode, offset)); -} - /* * Access hub local MMRs. Faster than using global space but only local MMRs * are accessible. -- 2.43.0