[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20131125090034.636810276@dhcp-16-126.nay.redhat.com>
Date: Mon, 25 Nov 2013 16:56:32 +0800
From: dyoung@...hat.com
To: linux-kernel@...r.kernel.org
Cc: linux-efi@...r.kernel.org, x86@...nel.org, mjg59@...f.ucam.org,
hpa@...or.com, James.Bottomley@...senPartnership.com,
vgoyal@...hat.com, ebiederm@...ssion.com, horms@...ge.net.au,
kexec@...ts.infradead.org, bp@...en8.de, greg@...ah.com,
matt@...sole-pimps.org, toshi.kani@...com,
Dave Young <dyoung@...hat.com>, Borislav Petkov <bp@...e.de>
Subject: [patch 02/12 v4] efi: add a wrapper function efi_map_region_fixed
Hi,
References: <20131125085630.417850406@...p-16-126.nay.redhat.com>
Content-Disposition: inline; filename=02-efi-map-fixed-addr.patch
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.
Matt: coding style
reuse __map_region
Boris: Strenthen comment lines to 80 cols.
Signed-off-by: Dave Young <dyoung@...hat.com>
Acked-by: Borislav Petkov <bp@...e.de>
---
arch/x86/include/asm/efi.h | 1 +
arch/x86/platform/efi/efi_32.c | 2 ++
arch/x86/platform/efi/efi_64.c | 10 ++++++++++
3 files changed, 13 insertions(+)
--- efi.orig/arch/x86/include/asm/efi.h
+++ efi/arch/x86/include/asm/efi.h
@@ -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);
--- efi.orig/arch/x86/platform/efi/efi_64.c
+++ efi/arch/x86/platform/efi/efi_64.c
@@ -199,6 +199,16 @@ void __init efi_map_region(efi_memory_de
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)
{
--- efi.orig/arch/x86/platform/efi/efi_32.c
+++ efi/arch/x86/platform/efi/efi_32.c
@@ -47,6 +47,8 @@ void __init efi_map_region(efi_memory_de
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists