efi.c (09308012d8546dda75e96c02bed19e2ba1e875fd) efi.c (59f2a619a2db86111e8bb30f349aebff6eb75baa)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Common EFI (Extensible Firmware Interface) support functions
4 * Based on Extensible Firmware Interface Specification version 1.0
5 *
6 * Copyright (C) 1999 VA Linux Systems
7 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
8 * Copyright (C) 1999-2002 Hewlett-Packard Co.

--- 41 unchanged lines hidden (view full) ---

50#include <asm/e820/api.h>
51#include <asm/time.h>
52#include <asm/set_memory.h>
53#include <asm/tlbflush.h>
54#include <asm/x86_init.h>
55#include <asm/uv/uv.h>
56
57static efi_system_table_t efi_systab __initdata;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Common EFI (Extensible Firmware Interface) support functions
4 * Based on Extensible Firmware Interface Specification version 1.0
5 *
6 * Copyright (C) 1999 VA Linux Systems
7 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
8 * Copyright (C) 1999-2002 Hewlett-Packard Co.

--- 41 unchanged lines hidden (view full) ---

50#include <asm/e820/api.h>
51#include <asm/time.h>
52#include <asm/set_memory.h>
53#include <asm/tlbflush.h>
54#include <asm/x86_init.h>
55#include <asm/uv/uv.h>
56
57static efi_system_table_t efi_systab __initdata;
58static u64 efi_systab_phys __initdata;
59
58
59static unsigned long efi_systab_phys __initdata;
60static unsigned long prop_phys = EFI_INVALID_TABLE_ADDR;
61static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
62static unsigned long efi_runtime, efi_nr_tables;
63
64unsigned long efi_fw_vendor, efi_config_table;
65
66static const efi_config_table_type_t arch_tables[] __initconst = {
67 {EFI_PROPERTIES_TABLE_GUID, "PROP", &prop_phys},

--- 262 unchanged lines hidden (view full) ---

330 pr_info("mem%02u: %s range=[0x%016llx-0x%016llx] (%lluMB)\n",
331 i++, efi_md_typeattr_format(buf, sizeof(buf), md),
332 md->phys_addr,
333 md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1,
334 (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
335 }
336}
337
60static unsigned long prop_phys = EFI_INVALID_TABLE_ADDR;
61static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
62static unsigned long efi_runtime, efi_nr_tables;
63
64unsigned long efi_fw_vendor, efi_config_table;
65
66static const efi_config_table_type_t arch_tables[] __initconst = {
67 {EFI_PROPERTIES_TABLE_GUID, "PROP", &prop_phys},

--- 262 unchanged lines hidden (view full) ---

330 pr_info("mem%02u: %s range=[0x%016llx-0x%016llx] (%lluMB)\n",
331 i++, efi_md_typeattr_format(buf, sizeof(buf), md),
332 md->phys_addr,
333 md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1,
334 (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
335 }
336}
337
338static int __init efi_systab_init(u64 phys)
338static int __init efi_systab_init(unsigned long phys)
339{
340 int size = efi_enabled(EFI_64BIT) ? sizeof(efi_system_table_64_t)
341 : sizeof(efi_system_table_32_t);
342 const efi_table_hdr_t *hdr;
343 bool over4g = false;
344 void *p;
345 int ret;
346

--- 597 unchanged lines hidden (view full) ---

944 if (efi_setup_page_tables(pa, 1 << pg_shift))
945 goto err;
946
947 efi_sync_low_kernel_mappings();
948
949 status = efi_set_virtual_address_map(efi.memmap.desc_size * count,
950 efi.memmap.desc_size,
951 efi.memmap.desc_version,
339{
340 int size = efi_enabled(EFI_64BIT) ? sizeof(efi_system_table_64_t)
341 : sizeof(efi_system_table_32_t);
342 const efi_table_hdr_t *hdr;
343 bool over4g = false;
344 void *p;
345 int ret;
346

--- 597 unchanged lines hidden (view full) ---

944 if (efi_setup_page_tables(pa, 1 << pg_shift))
945 goto err;
946
947 efi_sync_low_kernel_mappings();
948
949 status = efi_set_virtual_address_map(efi.memmap.desc_size * count,
950 efi.memmap.desc_size,
951 efi.memmap.desc_version,
952 (efi_memory_desc_t *)pa);
952 (efi_memory_desc_t *)pa,
953 efi_systab_phys);
953 if (status != EFI_SUCCESS) {
954 pr_err("Unable to switch EFI into virtual mode (status=%lx)!\n",
955 status);
956 goto err;
957 }
958
959 efi_free_boot_services();
960

--- 17 unchanged lines hidden (view full) ---

978 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
979}
980
981void __init efi_enter_virtual_mode(void)
982{
983 if (efi_enabled(EFI_PARAVIRT))
984 return;
985
954 if (status != EFI_SUCCESS) {
955 pr_err("Unable to switch EFI into virtual mode (status=%lx)!\n",
956 status);
957 goto err;
958 }
959
960 efi_free_boot_services();
961

--- 17 unchanged lines hidden (view full) ---

979 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
980}
981
982void __init efi_enter_virtual_mode(void)
983{
984 if (efi_enabled(EFI_PARAVIRT))
985 return;
986
987 efi.runtime = (efi_runtime_services_t *)efi_runtime;
988
986 if (efi_setup)
987 kexec_enter_virtual_mode();
988 else
989 __efi_enter_virtual_mode();
990
991 efi_dump_pagetable();
992}
993

--- 53 unchanged lines hidden ---
989 if (efi_setup)
990 kexec_enter_virtual_mode();
991 else
992 __efi_enter_virtual_mode();
993
994 efi_dump_pagetable();
995}
996

--- 53 unchanged lines hidden ---