Skip to content

Commit 66d67fe

Browse files
swahlhpeKAGA-KOKO
authored andcommitted
x86/efi: Remove references to no-longer-used efi_have_uv1_memmap()
In removing UV1 support, efi_have_uv1_memmap is no longer used. Signed-off-by: Steve Wahl <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent cadde23 commit 66d67fe

File tree

4 files changed

+6
-63
lines changed

4 files changed

+6
-63
lines changed

arch/x86/kernel/kexec-bzimage64.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,6 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
170170
if (!current_ei->efi_memmap_size)
171171
return 0;
172172

173-
/*
174-
* If 1:1 mapping is not enabled, second kernel can not setup EFI
175-
* and use EFI run time services. User space will have to pass
176-
* acpi_rsdp=<addr> on kernel command line to make second kernel boot
177-
* without efi.
178-
*/
179-
if (efi_have_uv1_memmap())
180-
return 0;
181-
182173
params->secure_boot = boot_params.secure_boot;
183174
ei->efi_loader_signature = current_ei->efi_loader_signature;
184175
ei->efi_systab = current_ei->efi_systab;

arch/x86/platform/efi/efi.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ static inline void *efi_map_next_entry_reverse(void *entry)
648648
*/
649649
static void *efi_map_next_entry(void *entry)
650650
{
651-
if (!efi_have_uv1_memmap() && efi_enabled(EFI_64BIT)) {
651+
if (efi_enabled(EFI_64BIT)) {
652652
/*
653653
* Starting in UEFI v2.5 the EFI_PROPERTIES_TABLE
654654
* config table feature requires us to map all entries
@@ -777,11 +777,9 @@ static void __init kexec_enter_virtual_mode(void)
777777

778778
/*
779779
* We don't do virtual mode, since we don't do runtime services, on
780-
* non-native EFI. With the UV1 memmap, we don't do runtime services in
781-
* kexec kernel because in the initial boot something else might
782-
* have been mapped at these virtual addresses.
780+
* non-native EFI.
783781
*/
784-
if (efi_is_mixed() || efi_have_uv1_memmap()) {
782+
if (efi_is_mixed()) {
785783
efi_memmap_unmap();
786784
clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
787785
return;
@@ -832,12 +830,6 @@ static void __init kexec_enter_virtual_mode(void)
832830
* has the runtime attribute bit set in its memory descriptor into the
833831
* efi_pgd page table.
834832
*
835-
* The old method which used to update that memory descriptor with the
836-
* virtual address obtained from ioremap() is still supported when the
837-
* kernel is booted on SG1 UV1 hardware. Same old method enabled the
838-
* runtime services to be called without having to thunk back into
839-
* physical mode for every invocation.
840-
*
841833
* The new method does a pagetable switch in a preemption-safe manner
842834
* so that we're in a different address space when calling a runtime
843835
* function. For function arguments passing we do copy the PUDs of the

arch/x86/platform/efi/efi_64.c

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ int __init efi_alloc_page_tables(void)
7474
pud_t *pud;
7575
gfp_t gfp_mask;
7676

77-
if (efi_have_uv1_memmap())
78-
return 0;
79-
8077
gfp_mask = GFP_KERNEL | __GFP_ZERO;
8178
efi_pgd = (pgd_t *)__get_free_pages(gfp_mask, PGD_ALLOCATION_ORDER);
8279
if (!efi_pgd)
@@ -115,9 +112,6 @@ void efi_sync_low_kernel_mappings(void)
115112
pud_t *pud_k, *pud_efi;
116113
pgd_t *efi_pgd = efi_mm.pgd;
117114

118-
if (efi_have_uv1_memmap())
119-
return;
120-
121115
/*
122116
* We can share all PGD entries apart from the one entry that
123117
* covers the EFI runtime mapping space.
@@ -206,9 +200,6 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
206200
unsigned npages;
207201
pgd_t *pgd = efi_mm.pgd;
208202

209-
if (efi_have_uv1_memmap())
210-
return 0;
211-
212203
/*
213204
* It can happen that the physical address of new_memmap lands in memory
214205
* which is not mapped in the EFI page table. Therefore we need to go
@@ -315,9 +306,6 @@ void __init efi_map_region(efi_memory_desc_t *md)
315306
unsigned long size = md->num_pages << PAGE_SHIFT;
316307
u64 pa = md->phys_addr;
317308

318-
if (efi_have_uv1_memmap())
319-
return old_map_region(md);
320-
321309
/*
322310
* Make sure the 1:1 mappings are present as a catch-all for b0rked
323311
* firmware which doesn't update all internal pointers after switching
@@ -420,12 +408,6 @@ void __init efi_runtime_update_mappings(void)
420408
{
421409
efi_memory_desc_t *md;
422410

423-
if (efi_have_uv1_memmap()) {
424-
if (__supported_pte_mask & _PAGE_NX)
425-
runtime_code_page_mkexec();
426-
return;
427-
}
428-
429411
/*
430412
* Use the EFI Memory Attribute Table for mapping permissions if it
431413
* exists, since it is intended to supersede EFI_PROPERTIES_TABLE.
@@ -474,10 +456,7 @@ void __init efi_runtime_update_mappings(void)
474456
void __init efi_dump_pagetable(void)
475457
{
476458
#ifdef CONFIG_EFI_PGT_DUMP
477-
if (efi_have_uv1_memmap())
478-
ptdump_walk_pgd_level(NULL, &init_mm);
479-
else
480-
ptdump_walk_pgd_level(NULL, &efi_mm);
459+
ptdump_walk_pgd_level(NULL, &efi_mm);
481460
#endif
482461
}
483462

@@ -849,21 +828,13 @@ efi_set_virtual_address_map(unsigned long memory_map_size,
849828
const efi_system_table_t *systab = (efi_system_table_t *)systab_phys;
850829
efi_status_t status;
851830
unsigned long flags;
852-
pgd_t *save_pgd = NULL;
853831

854832
if (efi_is_mixed())
855833
return efi_thunk_set_virtual_address_map(memory_map_size,
856834
descriptor_size,
857835
descriptor_version,
858836
virtual_map);
859-
860-
if (efi_have_uv1_memmap()) {
861-
save_pgd = efi_uv1_memmap_phys_prolog();
862-
if (!save_pgd)
863-
return EFI_ABORTED;
864-
} else {
865-
efi_switch_mm(&efi_mm);
866-
}
837+
efi_switch_mm(&efi_mm);
867838

868839
kernel_fpu_begin();
869840

@@ -879,10 +850,7 @@ efi_set_virtual_address_map(unsigned long memory_map_size,
879850
/* grab the virtually remapped EFI runtime services table pointer */
880851
efi.runtime = READ_ONCE(systab->runtime);
881852

882-
if (save_pgd)
883-
efi_uv1_memmap_phys_epilog(save_pgd);
884-
else
885-
efi_switch_mm(efi_scratch.prev_mm);
853+
efi_switch_mm(efi_scratch.prev_mm);
886854

887855
return status;
888856
}

arch/x86/platform/efi/quirks.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,6 @@ static void __init efi_unmap_pages(efi_memory_desc_t *md)
380380
u64 pa = md->phys_addr;
381381
u64 va = md->virt_addr;
382382

383-
/*
384-
* To Do: Remove this check after adding functionality to unmap EFI boot
385-
* services code/data regions from direct mapping area because the UV1
386-
* memory map maps EFI regions in swapper_pg_dir.
387-
*/
388-
if (efi_have_uv1_memmap())
389-
return;
390-
391383
/*
392384
* EFI mixed mode has all RAM mapped to access arguments while making
393385
* EFI runtime calls, hence don't unmap EFI boot services code/data

0 commit comments

Comments
 (0)