[patch 3/6] Cleanup efi_enter_virtual_mode function

2013-10-26 Thread dyoung
Add two small functions: efi_merge_regions and efi_map_regions, efi_enter_virtual_mode calls them instead of embedding two long for loop. Signed-off-by: Dave Young dyo...@redhat.com --- arch/x86/platform/efi/efi.c | 83 +++- 1 file changed, 52

[patch 0/6] kexec kernel efi runtime support

2013-10-26 Thread dyoung
Hi, Here is the 1st version for supporting kexec kernel efi runtime. Per pervious discussion I pass the 1st kernel efi runtime mapping via setup_data to 2nd kernel. Besides of the runtime mapping info I also pass the fw_vendor, runtime, config table, smbios physical address in setup_data. EFI

[patch 4/6] export more efi table variable to sysfs

2013-10-26 Thread dyoung
Export fw_vendor, runtime and config tables physical addresses to /sys/firmware/efi/systab becaue kexec kernel will need them. From EFI spec these 3 variables will be updated to virtual address after entering virtual mode. But kernel startup code will need the physical address. Signed-off-by:

[patch 5/6] export efi runtime memory mapping to sysfs

2013-10-26 Thread dyoung
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directly /sys/firmware/efi/efi-runtime-map Just like /sys/firmware/memmap.

[patch 6/6] passing kexec necessary efi data via setup_data

2013-10-26 Thread dyoung
Add a new setup_data type SETUP_EFI for kexec use. Passing the saved fw_vendor, runtime, config tables and efi runtime mappings. When entering virtual mode, directly mapping the efi runtime ragions which we passed in previously. And skip the step to call SetVirtualAddressMap. Specially for HP

[patch 1/6] Add function efi_remap_region for remapping to saved virt address

2013-10-26 Thread dyoung
Kexec kernel will use saved runtime virtual mapping, so add a new function efi_remap_region to remapping it directly without calculate the virt addr from efi_va. The md is passed in from 1st kernel, the virtual addr is saved in md-virt_addr. Signed-off-by: Dave Young dyo...@redhat.com ---

[patch 6/7 v2] passing kexec necessary efi data via setup_data

2013-11-05 Thread dyoung
Add a new setup_data type SETUP_EFI for kexec use. Passing the saved fw_vendor, runtime, config tables and efi runtime mappings. When entering virtual mode, directly mapping the efi runtime ragions which we passed in previously. And skip the step to call SetVirtualAddressMap. Specially for HP

[patch 1/7 v2] Add function efi_remap_region for remapping to saved virt address

2013-11-05 Thread dyoung
Kexec kernel will use saved runtime virtual mapping, so add a new function efi_remap_region to remapping it directly without calculate the virt addr from efi_va. The md is passed in from 1st kernel, the virtual addr is saved in md-virt_addr. Signed-off-by: Dave Young dyo...@redhat.com ---

[patch 2/3 v2] Add efi_info in x86 setup header

2013-11-05 Thread dyoung
For supporting efi runtime on kexec kernel we need to fill the efi_info struct in setup_header. I just get the info in kernel exported boot_params data in debugfs. v1-v2: update comment for offset of reserved4_1[] in x87_linux_param_header Address comment from mjg59: do not break old kernel when

[patch 1/3 v2] Add function get_bootparam

2013-11-05 Thread dyoung
Not only setup_subarch will get data from debugfs file boot_params/data, later code for adding efi_info will also need do same thing. Thus add a common function here for later use. v1-v2: make get_bootparam() static Signed-off-by: Dave Young dyo...@redhat.com ---

[patch 4/7 v2] export more efi table variable to sysfs

2013-11-05 Thread dyoung
Export fw_vendor, runtime and config tables physical addresses to /sys/firmware/efi/systab becaue kexec kernel will need them. From EFI spec these 3 variables will be updated to virtual address after entering virtual mode. But kernel startup code will need the physical address. Signed-off-by:

[patch 7/7 v2] x86: add xloadflags bit for efi runtime support on kexec

2013-11-05 Thread dyoung
Old kexec-tools can not load new kernel. The reason is previously kexec-tools do not fill efi_info in x86 setup header thus efi init fail and switch to noefi boot. In new kexec-tools it will by default fill efi_info and pass other efi required infomation to 2nd kernel so kexec kernel efi

[patch 0/7 v2] kexec kernel efi runtime support

2013-11-05 Thread dyoung
Hi, Here is the V2 for supporting kexec kernel efi runtime. Per pervious discussion I pass the 1st kernel efi runtime mapping via setup_data to 2nd kernel. Besides of the runtime mapping info I also pass the fw_vendor, runtime, config table, smbios physical address in setup_data. EFI spec

[patch 3/3 v2] Passing efi related data via setup_data

2013-11-05 Thread dyoung
For supporting efi runtime, several efi physical addresses fw_vendor, runtime, config tables, smbios and the whole runtime mapping info need to be used in kexec kernel. Thus introduce setup_data struct for passing these data. collect the varialbes from /sys/firmware/efi/systab and

[patch 3/7 v2] Cleanup efi_enter_virtual_mode function

2013-11-05 Thread dyoung
Add two small functions: efi_merge_regions and efi_map_regions, efi_enter_virtual_mode calls them instead of embedding two long for loop. v1-v2: refresh; coding style fixes. Signed-off-by: Dave Young dyo...@redhat.com --- arch/x86/platform/efi/efi.c | 107

[patch 7/9 v3] efi: passing kexec necessary efi data via setup_data

2013-11-20 Thread dyoung
Add a new setup_data type SETUP_EFI for kexec use. Passing the saved fw_vendor, runtime, config tables and efi runtime mappings. When entering virtual mode, directly mapping the efi runtime ragions which we passed in previously. And skip the step to call SetVirtualAddressMap. Specially for HP

[patch 8/9 v3] x86: add xloadflags bit for efi runtime support on kexec

2013-11-20 Thread dyoung
Old kexec-tools can not load new kernel. The reason is previously kexec-tools do not fill efi_info in x86 setup header thus efi init fail and switch to noefi boot. In new kexec-tools it will by default fill efi_info and pass other efi required infomation to 2nd kernel so kexec kernel efi

[patch 3/9 v3] efi: reserve boot service fix

2013-11-20 Thread dyoung
Current code check boot service region with kernel text region by: start+size = __pa_symbol(_text) The end of the above region should be start + size - 1 instead. I see this problem in ovmf + Fedora 19 grub boot: text start: 100 md start: 80 md size: 80 Signed-off-by: Dave Young

[patch 1/9 v3] efi: remove unused variables in __map_region

2013-11-20 Thread dyoung
variables size and end is useless in this function, thus remove them. Reported-by: Toshi Kani toshi.k...@hp.com Signed-off-by: Dave Young dyo...@redhat.com --- arch/x86/platform/efi/efi_64.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) ---

[patch 6/9 v3] efi: export efi runtime memory mapping to sysfs

2013-11-20 Thread dyoung
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directly /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap.

[patch 0/9 v3] kexec kernel efi runtime support

2013-11-20 Thread dyoung
Hi, Here is the V3 for supporting kexec kernel efi runtime. Per pervious discussion I pass the 1st kernel efi runtime mapping via setup_data to 2nd kernel. Besides of the runtime mapping info I also pass the fw_vendor, runtime, config table, smbios physical address in setup_data. EFI spec

[patch 5/9 v3] efi: export more efi table variable to sysfs

2013-11-20 Thread dyoung
Export fw_vendor, runtime and config tables physical addresses to /sys/firmware/efi/systab becaue kexec kernel will need them. From EFI spec these 3 variables will be updated to virtual address after entering virtual mode. But kernel startup code will need the physical address. changelog: Greg:

[patch 1/4 v3] build fix: include x86-linux.h in x86-linux-setup.h

2013-11-20 Thread dyoung
There's build warnings about using struct x86_linux_param_header * in x86-linux-setup.h, it is declared in x86-linux.h Fix it by include x86-linux.h in x86-linux-setup.h Signed-off-by: Dave Young dyo...@redhat.com --- kexec/arch/i386/x86-linux-setup.h |1 + 1 file changed, 1 insertion(+)

[patch 0/4 v3] kexec-tools: efi runtime support

2013-11-20 Thread dyoung
Hi, This is the v3 patchset for adding efi runtime support on kexec kernel kernel patches was sent a while ago, not yet updated in archive. in kexec-tools, this patchset will do below: 1. retrieve efi_info from sysfs boot_params, and fill the x86 setup header. If kernel does not export sysfs

[patch 4/4 v3] Passing efi related data via setup_data

2013-11-20 Thread dyoung
For supporting efi runtime, several efi physical addresses fw_vendor, runtime, config tables, smbios and the whole runtime mapping info need to be used in kexec kernel. Thus introduce setup_data struct for passing these data. collect the varialbes from /sys/firmware/efi/systab and

[patch 3/4 v3] Add efi_info in x86 setup header

2013-11-20 Thread dyoung
For supporting efi runtime on kexec kernel we need to fill the efi_info struct in setup_header. I just get the info in kernel exported boot_params data in debugfs. v1-v2: update comment for offset of reserved4_1[] in x87_linux_param_header Address comment from mjg59: do not break old kernel when

[patch 2/4 v3] Add function get_bootparam

2013-11-20 Thread dyoung
Not only setup_subarch will get data from debugfs file boot_params/data, later code for adding efi_info will also need do same thing. Thus add a common function here for later use. v1-v2: make get_bootparam() static v2-v3: return error code when get_bootparam fails because later patch to

efi: remove unused variables in __map_region

2013-11-25 Thread dyoung
variables size and end is useless in this function, thus remove them. Reported-by: Toshi Kani toshi.k...@hp.com Signed-off-by: Dave Young dyo...@redhat.com Acked-by: Borislav Petkov b...@suse.de --- arch/x86/platform/efi/efi_64.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) ---

efi: export efi runtime memory mapping to sysfs

2013-11-25 Thread dyoung
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directly /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap.

x86: add xloadflags bit for efi runtime support on kexec

2013-11-25 Thread dyoung
Old kexec-tools can not load new kernel. The reason is previously kexec-tools do not fill efi_info in x86 setup header thus efi init fail and switch to noefi boot. In new kexec-tools it will by default fill efi_info and pass other efi required infomation to 2nd kernel so kexec kernel efi

Only print saved efi runtime maps instead of all memmap ranges.

2013-11-25 Thread dyoung
For kexec/kdump kernel efi runtime mappings are saved, printing original whole memmap ranges does not make sense anymore. So introduce a new function to only print runtime maps in case kexec/kdump kernel is used. Signed-off-by: Dave Young dyo...@redhat.com --- arch/x86/platform/efi/efi.c | 23

x86: export x86 boot_params to sysfs

2013-11-25 Thread dyoung
kexec-tools use boot_params for getting the 1st kernel hardware_subarch, the kexec kernel efi runtime support also need read the old efi_info from boot_params. Currently it exists in debugfs which is not a good place for such infomation. Per HPA, we should avoid of sploit debugfs. In this patch

efi: add a wrapper function efi_map_region_fixed

2013-11-25 Thread dyoung
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

kexec kernel efi runtime support

2013-11-25 Thread dyoung
Hi, Here is the V4 for supporting kexec kernel efi runtime. Per pervious discussion I pass the 1st kernel efi runtime mapping via setup_data to 2nd kernel. Besides of the runtime mapping info I also pass the fw_vendor, runtime, config table, smbios physical address in setup_data. EFI spec

efi: passing kexec necessary efi data via setup_data

2013-11-25 Thread dyoung
Add a new setup_data type SETUP_EFI for kexec use. Passing the saved fw_vendor, runtime, config tables and efi runtime mappings. When entering virtual mode, directly mapping the efi runtime ragions which we passed in previously. And skip the step to call SetVirtualAddressMap. Specially for HP

[patch 07/12 v4] efi: passing kexec necessary efi data via setup_data

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=07-use-efi-setup-data.patch Add a new setup_data type SETUP_EFI for kexec use. Passing the saved fw_vendor, runtime, config tables and efi runtime mappings. When entering virtual mode,

[patch 01/12 v4] efi: remove unused variables in __map_region

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=01-remove-unused-var-in-map-region.patch variables size and end is useless in this function, thus remove them. Reported-by: Toshi Kani toshi.k...@hp.com Signed-off-by: Dave Young

[patch 11/12 v4] x86: reserve setup_data ranges late after parsing memmap cmdline

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=11-reserve-setup-data-late.patch Kdump kernel using memmap=exactmap, move e820_reserve_setup_data after parsing early params so they can be set reserved finally. Or kdump kernel will warn

[patch 10/12 v4] efi: only print saved efi runtime maps instead of all memmap ranges.

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=10-print-efi-runtime-memmap.patch For kexec/kdump kernel efi runtime mappings are saved, printing original whole memmap ranges does not make sense anymore. So introduce a new function to only

[patch 08/12 v4] x86: add xloadflags bit for efi runtime support on kexec

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=08-add-xloadflags-for-kexec-efi-runtime-feature.patch Old kexec-tools can not load new kernel. The reason is previously kexec-tools do not fill efi_info in x86 setup header thus efi init

[patch 12/12 v4] x86: do not use __va for getting setup_data virt addr

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=12-x86-kdebugfs-use-ioremap.patch __va does not work in case memmap=exactmap, so let's always use ioremap_cache. Signed-off-by: Dave Young dyo...@redhat.com --- arch/x86/kernel/kdebugfs.c |

[patch 04/12 v4] efi: cleanup efi_enter_virtual_mode function

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=04-efi-enter-virtual-mode-cleanup.patch Add two small functions: efi_merge_regions and efi_map_regions, efi_enter_virtual_mode calls them instead of embedding two long for loop. v1-v2:

[patch 02/12 v4] efi: add a wrapper function efi_map_region_fixed

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-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

[patch 05/12 v4] efi: export more efi table variable to sysfs

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=05-export-more-efi-sysfs-vars.patch Export fw_vendor, runtime and config tables physical addresses to /sys/firmware/efi/systab becaue kexec kernel will need them. From EFI spec these 3

efi: cleanup efi_enter_virtual_mode function

2013-11-25 Thread dyoung
Add two small functions: efi_merge_regions and efi_map_regions, efi_enter_virtual_mode calls them instead of embedding two long for loop. v1-v2: refresh; coding style fixes. v2-v3: Toshi Kani: remove unused variable Matt: check return value of krealloc. v3-v4: Boris: Stretch comment to 80 cols

[patch 06/12 v4] efi: export efi runtime memory mapping to sysfs

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=06-export-efi-runtime-mapping.patch kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble

[patch 03/12 v4] efi: reserve boot service fix

2013-11-25 Thread dyoung
Hi, References: 20131125085630.417850...@dhcp-16-126.nay.redhat.com Content-Disposition: inline; filename=03-boot-service-fix.patch Current code check boot service region with kernel text region by: start+size = __pa_symbol(_text) The end of the above region should be start + size - 1 instead.