]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
efi/x86: move UV_SYSTAB handling into arch/x86
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 25 Jun 2019 13:48:35 +0000 (15:48 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 8 Aug 2019 08:01:48 +0000 (11:01 +0300)
The SGI UV UEFI machines are tightly coupled to the x86 architecture
so there is no need to keep any awareness of its existence in the
generic EFI layer, especially since we already have the infrastructure
to handle arch-specific configuration tables, and were even already
using it to some extent.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
arch/x86/include/asm/uv/uv.h
arch/x86/platform/efi/efi.c
arch/x86/platform/uv/bios_uv.c
drivers/firmware/efi/efi.c
include/linux/efi.h

index e60c45fd3679bf900a8e1d53d2cb731c316d519f..6bc6d89d8e2ad8d36819ae2457a815c9083f2d4b 100644 (file)
@@ -12,10 +12,12 @@ struct mm_struct;
 #ifdef CONFIG_X86_UV
 #include <linux/efi.h>
 
+extern unsigned long uv_systab_phys;
+
 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);
+       return uv_systab_phys && uv_systab_phys != EFI_INVALID_TABLE_ADDR;
 }
 extern int is_uv_system(void);
 extern int is_uv_hubless(void);
index 8d9be97a560738a3e5a1d97a58d79deb2c8f6c91..9866a358476518db6c0f36bc82b1e80bfc72c20e 100644 (file)
@@ -59,7 +59,7 @@ static efi_system_table_t efi_systab __initdata;
 
 static efi_config_table_type_t arch_tables[] __initdata = {
 #ifdef CONFIG_X86_UV
-       {UV_SYSTEM_TABLE_GUID, "UVsystab", &efi.uv_systab},
+       {UV_SYSTEM_TABLE_GUID, "UVsystab", &uv_systab_phys},
 #endif
        {NULL_GUID, NULL, NULL},
 };
@@ -74,7 +74,9 @@ static const unsigned long * const efi_tables[] = {
        &efi.boot_info,
        &efi.hcdp,
        &efi.uga,
-       &efi.uv_systab,
+#ifdef CONFIG_X86_UV
+       &uv_systab_phys,
+#endif
        &efi.fw_vendor,
        &efi.runtime,
        &efi.config_table,
index 7c69652ffeea2e6c3de91a8c6a349eea60b4bf55..c2ee31953372d4ed2b8a5fc9b19d9856eeaa9398 100644 (file)
@@ -14,6 +14,8 @@
 #include <asm/uv/bios.h>
 #include <asm/uv/uv_hub.h>
 
+unsigned long uv_systab_phys __ro_after_init = EFI_INVALID_TABLE_ADDR;
+
 struct uv_systab *uv_systab;
 
 static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
@@ -185,13 +187,13 @@ EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga_target);
 void uv_bios_init(void)
 {
        uv_systab = NULL;
-       if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) ||
-           !efi.uv_systab || efi_runtime_disabled()) {
+       if ((uv_systab_phys == EFI_INVALID_TABLE_ADDR) ||
+           !uv_systab_phys || efi_runtime_disabled()) {
                pr_crit("UV: UVsystab: missing\n");
                return;
        }
 
-       uv_systab = ioremap(efi.uv_systab, sizeof(struct uv_systab));
+       uv_systab = ioremap(uv_systab_phys, sizeof(struct uv_systab));
        if (!uv_systab || strncmp(uv_systab->signature, UV_SYSTAB_SIG, 4)) {
                pr_err("UV: UVsystab: bad signature!\n");
                iounmap(uv_systab);
@@ -203,7 +205,7 @@ void uv_bios_init(void)
                int size = uv_systab->size;
 
                iounmap(uv_systab);
-               uv_systab = ioremap(efi.uv_systab, size);
+               uv_systab = ioremap(uv_systab_phys, size);
                if (!uv_systab) {
                        pr_err("UV: UVsystab: ioremap(%d) failed!\n", size);
                        return;
index cbdbdbc8f9ebe2957c2be1f6f0ad6d3171a40952..4dfd873373bd93007e7d1800d04951a3145e307f 100644 (file)
@@ -43,7 +43,6 @@ struct efi __read_mostly efi = {
        .boot_info              = EFI_INVALID_TABLE_ADDR,
        .hcdp                   = EFI_INVALID_TABLE_ADDR,
        .uga                    = EFI_INVALID_TABLE_ADDR,
-       .uv_systab              = EFI_INVALID_TABLE_ADDR,
        .fw_vendor              = EFI_INVALID_TABLE_ADDR,
        .runtime                = EFI_INVALID_TABLE_ADDR,
        .config_table           = EFI_INVALID_TABLE_ADDR,
index 60a6242765d892ab6d340db8911e0645a8331aad..171bb1005a10b196ee89ab409254c7f92585b483 100644 (file)
@@ -988,7 +988,6 @@ extern struct efi {
        unsigned long boot_info;        /* boot info table */
        unsigned long hcdp;             /* HCDP table */
        unsigned long uga;              /* UGA table */
-       unsigned long uv_systab;        /* UV system table */
        unsigned long fw_vendor;        /* fw_vendor */
        unsigned long runtime;          /* runtime table */
        unsigned long config_table;     /* config tables */