Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/platform/uv: Return UV Hubless System Type

Return the type of UV hubless system for UV specific code that depends
on that. Add a function to convert UV system type to bit pattern needed
for is_uv_hubless().

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Hedi Berriche <hedi.berriche@hpe.com>
Cc: Justin Ernst <justin.ernst@hpe.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <russ.anderson@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190910145839.814880843@stormcage.eag.rdlabs.hpecorp.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Mike Travis and committed by
Ingo Molnar
0959f825 61e5ddca

+28 -11
+10 -2
arch/x86/include/asm/uv/uv.h
··· 12 12 #ifdef CONFIG_X86_UV 13 13 #include <linux/efi.h> 14 14 15 + static inline int uv(int uvtype) 16 + { 17 + /* uv(0) is "any" */ 18 + if (uvtype >= 0 && uvtype <= 30) 19 + return 1 << uvtype; 20 + return 1; 21 + } 22 + 15 23 extern unsigned long uv_systab_phys; 16 24 17 25 extern enum uv_system_type get_uv_system_type(void); ··· 28 20 return uv_systab_phys && uv_systab_phys != EFI_INVALID_TABLE_ADDR; 29 21 } 30 22 extern int is_uv_system(void); 31 - extern int is_uv_hubless(void); 23 + extern int is_uv_hubless(int uvtype); 32 24 extern void uv_cpu_init(void); 33 25 extern void uv_nmi_init(void); 34 26 extern void uv_system_init(void); ··· 40 32 static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; } 41 33 static inline bool is_early_uv_system(void) { return 0; } 42 34 static inline int is_uv_system(void) { return 0; } 43 - static inline int is_uv_hubless(void) { return 0; } 35 + static inline int is_uv_hubless(int uv) { return 0; } 44 36 static inline void uv_cpu_init(void) { } 45 37 static inline void uv_system_init(void) { } 46 38 static inline const struct cpumask *
+18 -9
arch/x86/kernel/apic/x2apic_uv_x.c
··· 26 26 static DEFINE_PER_CPU(int, x2apic_extra_bits); 27 27 28 28 static enum uv_system_type uv_system_type; 29 - static bool uv_hubless_system; 29 + static int uv_hubless_system; 30 30 static u64 gru_start_paddr, gru_end_paddr; 31 31 static u64 gru_dist_base, gru_first_node_paddr = -1LL, gru_last_node_paddr; 32 32 static u64 gru_dist_lmask, gru_dist_umask; ··· 268 268 uv_stringify(sizeof(oem_table_id), oem_table_id, _oem_table_id); 269 269 270 270 if (strncmp(oem_id, "SGI", 3) != 0) { 271 - if (strncmp(oem_id, "NSGI", 4) == 0) { 272 - uv_hubless_system = true; 273 - pr_info("UV: OEM IDs %s/%s, HUBLESS\n", 274 - oem_id, oem_table_id); 275 - } 271 + if (strncmp(oem_id, "NSGI", 4) != 0) 272 + return 0; 273 + 274 + /* UV4 Hubless, CH, (0x11:UV4+Any) */ 275 + if (strncmp(oem_id, "NSGI4", 5) == 0) 276 + uv_hubless_system = 0x11; 277 + 278 + /* UV3 Hubless, UV300/MC990X w/o hub (0x9:UV3+Any) */ 279 + else 280 + uv_hubless_system = 0x9; 281 + 282 + pr_info("UV: OEM IDs %s/%s, HUBLESS(0x%x)\n", 283 + oem_id, oem_table_id, uv_hubless_system); 284 + 276 285 return 0; 277 286 } 278 287 ··· 359 350 } 360 351 EXPORT_SYMBOL_GPL(is_uv_system); 361 352 362 - int is_uv_hubless(void) 353 + int is_uv_hubless(int uvtype) 363 354 { 364 - return uv_hubless_system; 355 + return (uv_hubless_system & uvtype); 365 356 } 366 357 EXPORT_SYMBOL_GPL(is_uv_hubless); 367 358 ··· 1601 1592 */ 1602 1593 void __init uv_system_init(void) 1603 1594 { 1604 - if (likely(!is_uv_system() && !is_uv_hubless())) 1595 + if (likely(!is_uv_system() && !is_uv_hubless(1))) 1605 1596 return; 1606 1597 1607 1598 if (is_uv_system())