From c73de301f73640c83b24b9b438fb050f21165445 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 22 Sep 2026 20:23:39 -0700 Subject: [PATCH 02/75] x86/platform/uv: Remove unused UV BIOS calls Four of the UV BIOS call wrappers exist solely for the SGI XP and GRU drivers: - uv_bios_mq_watchlist_alloc() and uv_bios_mq_watchlist_free() managed the hub watchlist entries that XPC used to get notified about message queue activity. - uv_bios_change_memprotect() opened up a memory range for remote AMO or read/write access, which is how XPC published its message queues to the other partitions. - uv_bios_reserved_page_pa() looked up the physical address of a partition's BIOS reserved page, which XPC used to find its peers. The drivers were removed by: commit dbf69afe320e ("misc: sgi-xp: Remove SGI XP drivers") commit 85de4712bccf ("misc: sgi-gru: Remove SGI GRU driver") and there are no other callers, so none of these four can be reached anymore. Delete them and their declarations, along with enum uv_memprotect which only existed to type uv_bios_change_memprotect()'s third argument. The now-unused enum uv_bios_cmd values are deliberately left alone: those numbers are the BIOS call ABI, so removing the middle of the enum would silently renumber UV_BIOS_SET_LEGACY_VGA_TARGET. No functional change intended. --- arch/x86/include/asm/uv/bios.h | 11 ---------- arch/x86/platform/uv/bios_uv.c | 40 ---------------------------------- 2 files changed, 51 deletions(-) diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h index d0b62e2552902..5a7ea1dd195ce 100644 --- a/arch/x86/include/asm/uv/bios.h +++ b/arch/x86/include/asm/uv/bios.h @@ -169,19 +169,8 @@ union partition_info_u { }; }; -enum uv_memprotect { - UV_MEMPROT_RESTRICT_ACCESS, - UV_MEMPROT_ALLOW_AMO, - UV_MEMPROT_ALLOW_RW -}; - extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *); extern s64 uv_bios_freq_base(u64, u64 *); -extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int, - unsigned long *); -extern int uv_bios_mq_watchlist_free(int, int); -extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); -extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); extern s64 uv_bios_get_master_nasid(u64 sz, u64 *nasid); diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c index ea157fc627551..f4ffeee0c2a8c 100644 --- a/arch/x86/platform/uv/bios_uv.c +++ b/arch/x86/platform/uv/bios_uv.c @@ -104,46 +104,6 @@ s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher, return ret; } -int -uv_bios_mq_watchlist_alloc(unsigned long addr, unsigned int mq_size, - unsigned long *intr_mmr_offset) -{ - u64 watchlist; - s64 ret; - - /* - * bios returns watchlist number or negative error number. - */ - ret = (int)uv_bios_call_irqsave(UV_BIOS_WATCHLIST_ALLOC, addr, - mq_size, (u64)intr_mmr_offset, - (u64)&watchlist, 0); - if (ret < BIOS_STATUS_SUCCESS) - return ret; - - return watchlist; -} - -int -uv_bios_mq_watchlist_free(int blade, int watchlist_num) -{ - return (int)uv_bios_call_irqsave(UV_BIOS_WATCHLIST_FREE, - blade, watchlist_num, 0, 0, 0); -} - -s64 -uv_bios_change_memprotect(u64 paddr, u64 len, enum uv_memprotect perms) -{ - return uv_bios_call_irqsave(UV_BIOS_MEMPROTECT, paddr, len, - perms, 0, 0); -} - -s64 -uv_bios_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len) -{ - return uv_bios_call_irqsave(UV_BIOS_GET_PARTITION_ADDR, (u64)cookie, - (u64)addr, buf, (u64)len, 0); -} - s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) { return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type, -- 2.43.0