aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/runtime-map.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-08-08 17:26:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:33 -0400
commit6a2c20e7d8900ed273dc34a9af9bf02fc478e427 (patch)
treed4825b15aa4b9fd6cc92d4fb107d920544a4548b /drivers/firmware/efi/runtime-map.c
parentdd5f726076cc7639d9713b334c8c133f77c6757a (diff)
kexec: support kexec/kdump on EFI systems
This patch does two things. It passes EFI run time mappings to second kernel in bootparams efi_info. Second kernel parse this info and create new mappings in second kernel. That means mappings in first and second kernel will be same. This paves the way to enable EFI in kexec kernel. This patch also prepares and passes EFI setup data through bootparams. This contains bunch of information about various tables and their addresses. These information gathering and passing has been written along the lines of what current kexec-tools is doing to make kexec work with UEFI. [akpm@linux-foundation.org: s/get_efi/efi_get/g, per Matt] Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Matt Fleming <matt@console-pimps.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/firmware/efi/runtime-map.c')
-rw-r--r--drivers/firmware/efi/runtime-map.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c
index 97cdd16a2169..018c29a26615 100644
--- a/drivers/firmware/efi/runtime-map.c
+++ b/drivers/firmware/efi/runtime-map.c
@@ -138,6 +138,27 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr)
138 return entry; 138 return entry;
139} 139}
140 140
141int efi_get_runtime_map_size(void)
142{
143 return nr_efi_runtime_map * efi_memdesc_size;
144}
145
146int efi_get_runtime_map_desc_size(void)
147{
148 return efi_memdesc_size;
149}
150
151int efi_runtime_map_copy(void *buf, size_t bufsz)
152{
153 size_t sz = efi_get_runtime_map_size();
154
155 if (sz > bufsz)
156 sz = bufsz;
157
158 memcpy(buf, efi_runtime_map, sz);
159 return 0;
160}
161
141void efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) 162void efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size)
142{ 163{
143 efi_runtime_map = map; 164 efi_runtime_map = map;