[PATCH 1/2] x86/platform/uv: Add is_early_uv_system check

From: Mike Travis
Date: Tue Oct 02 2018 - 13:59:20 EST


Introduce is_early_uv_system() which uses efi.uv_systab to decide early
in the boot process whether we're on a UV system.

This is needed to skip other early setup/init code that might break
the UV platform if done too early such as before necessary ACPI tables
parsing takes place.

Signed-off-by: Mike Travis <mike.travis@xxxxxxx>
Suggested-by: Hedi Berriche <hedi.berriche@xxxxxxx>
Reviewed-by: Russ Anderson <rja@xxxxxxx>
Reviewed-by: Dimitri Sivanich <sivanich@xxxxxxx>
---
arch/x86/include/asm/uv/uv.h | 6 ++++++
1 file changed, 6 insertions(+)

--- linux.orig/arch/x86/include/asm/uv/uv.h
+++ linux/arch/x86/include/asm/uv/uv.h
@@ -10,8 +10,13 @@ struct cpumask;
struct mm_struct;

#ifdef CONFIG_X86_UV
+#include <linux/efi.h>

extern enum uv_system_type get_uv_system_type(void);
+static inline bool is_early_uv_system(void)
+{
+ return !((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || !efi.uv_systab);
+}
extern int is_uv_system(void);
extern int is_uv_hubless(void);
extern void uv_cpu_init(void);
@@ -23,6 +28,7 @@ extern const struct cpumask *uv_flush_tl
#else /* X86_UV */

static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
+static inline bool is_early_uv_system(void) { return 0; }
static inline int is_uv_system(void) { return 0; }
static inline int is_uv_hubless(void) { return 0; }
static inline void uv_cpu_init(void) { }

--