Skip to content

Commit 0959f82

Browse files
mike-travisIngo Molnar
authored andcommitted
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 <[email protected]> Reviewed-by: Steve Wahl <[email protected]> Reviewed-by: Dimitri Sivanich <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Hedi Berriche <[email protected]> Cc: Justin Ernst <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 61e5ddc commit 0959f82

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

arch/x86/include/asm/uv/uv.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ struct mm_struct;
1212
#ifdef CONFIG_X86_UV
1313
#include <linux/efi.h>
1414

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+
1523
extern unsigned long uv_systab_phys;
1624

1725
extern enum uv_system_type get_uv_system_type(void);
@@ -20,7 +28,7 @@ static inline bool is_early_uv_system(void)
2028
return uv_systab_phys && uv_systab_phys != EFI_INVALID_TABLE_ADDR;
2129
}
2230
extern int is_uv_system(void);
23-
extern int is_uv_hubless(void);
31+
extern int is_uv_hubless(int uvtype);
2432
extern void uv_cpu_init(void);
2533
extern void uv_nmi_init(void);
2634
extern void uv_system_init(void);
@@ -32,7 +40,7 @@ extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
3240
static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
3341
static inline bool is_early_uv_system(void) { return 0; }
3442
static inline int is_uv_system(void) { return 0; }
35-
static inline int is_uv_hubless(void) { return 0; }
43+
static inline int is_uv_hubless(int uv) { return 0; }
3644
static inline void uv_cpu_init(void) { }
3745
static inline void uv_system_init(void) { }
3846
static inline const struct cpumask *

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
static DEFINE_PER_CPU(int, x2apic_extra_bits);
2727

2828
static enum uv_system_type uv_system_type;
29-
static bool uv_hubless_system;
29+
static int uv_hubless_system;
3030
static u64 gru_start_paddr, gru_end_paddr;
3131
static u64 gru_dist_base, gru_first_node_paddr = -1LL, gru_last_node_paddr;
3232
static u64 gru_dist_lmask, gru_dist_umask;
@@ -268,11 +268,20 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
268268
uv_stringify(sizeof(oem_table_id), oem_table_id, _oem_table_id);
269269

270270
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+
276285
return 0;
277286
}
278287

@@ -350,9 +359,9 @@ int is_uv_system(void)
350359
}
351360
EXPORT_SYMBOL_GPL(is_uv_system);
352361

353-
int is_uv_hubless(void)
362+
int is_uv_hubless(int uvtype)
354363
{
355-
return uv_hubless_system;
364+
return (uv_hubless_system & uvtype);
356365
}
357366
EXPORT_SYMBOL_GPL(is_uv_hubless);
358367

@@ -1592,7 +1601,7 @@ static void __init uv_system_init_hub(void)
15921601
*/
15931602
void __init uv_system_init(void)
15941603
{
1595-
if (likely(!is_uv_system() && !is_uv_hubless()))
1604+
if (likely(!is_uv_system() && !is_uv_hubless(1)))
15961605
return;
15971606

15981607
if (is_uv_system())

0 commit comments

Comments
 (0)