efi/x86: Remove runtime table address from kexec EFI setup data
authorArd Biesheuvel <ardb@kernel.org>
Mon, 20 Jan 2020 15:15:00 +0000 (16:15 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:59:42 +0000 (21:59 +0100)
Since commit 33b85447fa61946b ("efi/x86: Drop two near identical versions
of efi_runtime_init()"), we no longer map the EFI runtime services table
before calling SetVirtualAddressMap(), which means we don't need the 1:1
mapped physical address of this table, and so there is no point in passing
the address via EFI setup data on kexec boot.

Note that the kexec tools will still look for this address in sysfs, so
we still need to provide it.

Tested-by: Tony Luck <tony.luck@intel.com> # arch/ia64
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/include/asm/efi.h
arch/x86/kernel/kexec-bzimage64.c
arch/x86/platform/efi/efi.c

index fcb21e3d13c55eaa484823e08934cd9b66d02bf6..ee867f01b2f68a16eabf18ec43678bc7e78457fe 100644 (file)
@@ -178,7 +178,6 @@ extern void __init efi_uv1_memmap_phys_epilog(pgd_t *save_pgd);
 
 struct efi_setup_data {
        u64 fw_vendor;
-       u64 runtime;
        u64 tables;
        u64 smbios;
        u64 reserved[8];
index f293d872602a4db853308ff4426f0804494d5724..f400678bd345371b82fdf355c6cea06b344f842b 100644 (file)
@@ -142,7 +142,6 @@ prepare_add_efi_setup_data(struct boot_params *params,
        struct efi_setup_data *esd = (void *)sd + sizeof(struct setup_data);
 
        esd->fw_vendor = efi.fw_vendor;
-       esd->runtime = efi.runtime;
        esd->tables = efi.config_table;
        esd->smbios = efi.smbios;
 
index 47367f4d82d0a5c2dfacb7a97d07bafc18f43596..7d932452a40f7f9bddcaa218af0250116b97ed06 100644 (file)
@@ -376,6 +376,7 @@ static int __init efi_systab_init(u64 phys)
                         systab64->con_out              > U32_MAX ||
                         systab64->stderr_handle        > U32_MAX ||
                         systab64->stderr               > U32_MAX ||
+                        systab64->runtime              > U32_MAX ||
                         systab64->boottime             > U32_MAX;
 
                if (efi_setup) {
@@ -388,17 +389,14 @@ static int __init efi_systab_init(u64 phys)
                        }
 
                        efi_systab.fw_vendor    = (unsigned long)data->fw_vendor;
-                       efi_systab.runtime      = (void *)(unsigned long)data->runtime;
                        efi_systab.tables       = (unsigned long)data->tables;
 
                        over4g |= data->fw_vendor       > U32_MAX ||
-                                 data->runtime         > U32_MAX ||
                                  data->tables          > U32_MAX;
 
                        early_memunmap(data, sizeof(*data));
                } else {
                        over4g |= systab64->fw_vendor   > U32_MAX ||
-                                 systab64->runtime     > U32_MAX ||
                                  systab64->tables      > U32_MAX;
                }
        } else {