Skip to content

Commit

Permalink
x86/efi: Add a wrapper function efi_map_region_fixed()
Browse files Browse the repository at this point in the history
Kexec kernel will use saved runtime virtual mapping, so add a new
function efi_map_region_fixed() for directly mapping a md to md->virt.

The md is passed in from 1st kernel, the virtual addr is saved in
md->virt_addr.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Borislav Petkov <bp@suse.de>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Dave Young authored and Matt Fleming committed Dec 21, 2013
1 parent 2da6e57 commit 3b26649
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ extern void efi_call_phys_epilog(void);
extern void efi_unmap_memmap(void);
extern void efi_memory_uc(u64 addr, unsigned long size);
extern void __init efi_map_region(efi_memory_desc_t *md);
extern void __init efi_map_region_fixed(efi_memory_desc_t *md);
extern void efi_sync_low_kernel_mappings(void);
extern void efi_setup_page_tables(void);
extern void __init old_map_region(efi_memory_desc_t *md);
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/platform/efi/efi_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void __init efi_map_region(efi_memory_desc_t *md)
old_map_region(md);
}

void __init efi_map_region_fixed(efi_memory_desc_t *md) {}

void efi_call_phys_prelog(void)
{
struct desc_ptr gdt_descr;
Expand Down
10 changes: 10 additions & 0 deletions arch/x86/platform/efi/efi_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@ void __init efi_map_region(efi_memory_desc_t *md)
md->virt_addr = efi_va;
}

/*
* kexec kernel will use efi_map_region_fixed to map efi runtime memory ranges.
* md->virt_addr is the original virtual address which had been mapped in kexec
* 1st kernel.
*/
void __init efi_map_region_fixed(efi_memory_desc_t *md)
{
__map_region(md, md->virt_addr);
}

void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
u32 type, u64 attribute)
{
Expand Down

0 comments on commit 3b26649

Please sign in to comment.