Re: /proc/vmcore mmap() failure issue

2013-11-20 Thread chaow...@redhat.com
On 11/20/13 at 05:27am, Atsushi Kumagai wrote: > On 2013/11/19 18:56:21, kexec wrote: > > (2013/11/18 9:51), Atsushi Kumagai wrote: > > > (2013/11/15 23:26), Vivek Goyal wrote: > > >> On Fri, Nov 15, 2013 at 06:41:52PM +0900, HATAYAMA Daisuke wrote: > > >> > > >> [..] > > Given the fact that

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

2013-11-20 Thread Dave Young
kexec-tools patches see below: http://lists.infradead.org/pipermail/kexec/2013-November/010229.html ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec

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

2013-11-20 Thread Dave Young
On 11/21/13 at 02:40pm, Dave Young wrote: > 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. Here it is: https://lkml.org/lkml/2013/11/21/22 > > in kexec-tools, this patchset will do below: > 1. re

[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 /sys/firmware/ef

[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 --- kexec/arch/i386/x86-linux-setup.h |1 + 1 file changed, 1 insertion(+) --- kexec-tools.ori

[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

[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. Containing

[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 initializa

[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 4/9 v3] efi: cleanup efi_enter_virtual_mode function

2013-11-20 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. Signed-off-by: Dave Young --- arch/x86

[patch 2/9 v3] efi: add a wrapper function efi_map_region_fixed

2013-11-20 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 Signed-off-by: Dave Young --- arch

[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 z42

[patch 9/9 v3] x86: export x86 boot_params to sysfs

2013-11-20 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

[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 mentione

[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 Signed-off-by: Dave Young --- arch/x86/platform/efi/efi_64.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) --- efi.orig/arch/x86/platform/efi/efi_64.c +++ efi/arch/x86/platform/efi/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 Ac

Re: [RFC PATCH] Crashdump Accepting Active IOMMU

2013-11-20 Thread Baoquan He
Hi Bill, I have tested this prototype patch on hp z420, it works very well. Looking forward to your formal patch set. I can help test and review. Baoquan Thanks On 11/18/13 at 11:30pm, Sumner, William wrote: > Thank you for testing this RFC patch. It is great to have confirmation that > the co

Re: /proc/vmcore mmap() failure issue

2013-11-20 Thread Atsushi Kumagai
Hello Vivek, On 2013/11/21 0:00:01, kexec wrote: > > > > > Is there any chance that you could look into fixing this. I > > > > > have no experience writing code for makedumpfile. > > > > > > > > I'll send a patch to fix this soon. > > > > > > Thanks Atsushi. > > > > > > Vivek > > > > Vivek,

[PATCH v6 1/3] x86, apic: add bios_bsp_physical_apicid

2013-11-20 Thread HATAYAMA Daisuke
Add bios_bsp_physical_apicid variable. This variable is initialized with the value reported by BIOS tables such as ACPI MADT or MP table. Without this variable, boot_cpu_physical_apicid temporarilly has the value around MP table related codes such as kernel/mpparse.c, mm/amdtopology.c and platform

[PATCH v6 0/3] x86, apic, kexec: Add disable_cpu_apic kernel parameter

2013-11-20 Thread HATAYAMA Daisuke
This patch set is to allow kdump 2nd kernel to wake up multiple CPUs, a continueing work from: [PATCH v3 0/2] x86, apic, kdump: Disable BSP if boot cpu is AP https://lkml.org/lkml/2013/10/16/300. At v4, basic design has changed. Now users need to figure out initial APIC ID of BSP in the 1st k

[PATCH v6 3/3] Documentation, x86, apic, kexec: Add disable_cpu_apicid kernel parameter

2013-11-20 Thread HATAYAMA Daisuke
Add disable_cpu_apicid kernel parameter to disable the CPU with the specified number of initial APIC ID, mostly used for the kdump 2nd kernel to disable BSP to wake up multiple CPUs without causing system reset or hang due to sending INIT from AP to BSP. Signed-off-by: HATAYAMA Daisuke --- Docum

[PATCH v6 2/3] x86, apic: Add disable_cpu_apicid kernel parameter

2013-11-20 Thread HATAYAMA Daisuke
Add disable_cpu_apicid kernel parameter. To use this kernel parameter, specify an initial APIC ID of the corresponding CPU you want to disable. This is mostly used for the kdump 2nd kernel to disable BSP to wake up multiple CPUs without causing system reset or hang due to sending INIT from AP to B

[PATCH 2/6] kexec: Move segment verification code in a separate function

2013-11-20 Thread Vivek Goyal
Previously do_kimage_alloc() will allocate a kimage structure, copy segment list from user space and then do the segment list sanity verification. Break down this function in 3 parts. do_kimage_alloc_init() to do actual allocation and basic initialization of kimage structure. copy_user_segment_lis

[PATCH 3/6] resource: Provide new functions to walk through resources

2013-11-20 Thread Vivek Goyal
I have added two more functions to walk through resources. Current walk_system_ram_range() deals with pfn and /proc/iomem can contain partial pages. By dealing in pfn, callback function loses the info that last page of a memory range is a partial page and not the full page. So I implemented walk_sy

[PATCH 6/6] kexec: Support for Kexec on panic using new system call

2013-11-20 Thread Vivek Goyal
This patch adds support for loading a kexec on panic (kdump) kernel usning new system call. Signed-off-by: Vivek Goyal --- arch/x86/include/asm/crash.h |9 + arch/x86/include/asm/kexec.h | 17 + arch/x86/kernel/crash.c| 585 arc

[PATCH 4/6] kexec: A new system call, kexec_file_load, for in kernel kexec

2013-11-20 Thread Vivek Goyal
This patch implements the in kernel kexec functionality. It implements a new system call kexec_file_load. I think parameter list of this system call will change as I have not done the kernel image signature handling yet. I have been told that I might have to pass the detached signature and size as

[PATCH 5/6] kexec-bzImage: Support for loading bzImage using 64bit entry

2013-11-20 Thread Vivek Goyal
This is loader specific code which can load bzImage and set it up for 64bit entry. This does not take care of 32bit entry or real mode entry yet. Signed-off-by: Vivek Goyal --- arch/x86/include/asm/kexec-bzimage.h | 12 + arch/x86/include/asm/kexec.h | 26 +++ arch/x86/kernel/Makefil

[PATCH 0/6] kexec: A new system call to allow in kernel loading

2013-11-20 Thread Vivek Goyal
Current proposed secureboot implementation disables kexec/kdump because it can allow unsigned kernel to run on a secureboot platform. Intial idea was to sign /sbin/kexec binary and let that binary do the kernel signature verification. I had posted RFC patches for this apparoach here. https://lkml.

[PATCH 1/6] kexec: Export vmcoreinfo note size properly

2013-11-20 Thread Vivek Goyal
Right now we seem to be exporting the max data size contained inside vmcoreinfo note. But this does not include the size of meta data around vmcore info data. Like name of the note and starting and ending elf_note. I think user space expects total size and that size is put in PT_NOTE elf header.

Re: /proc/vmcore mmap() failure issue

2013-11-20 Thread Vivek Goyal
On Wed, Nov 20, 2013 at 05:29:16AM +, Atsushi Kumagai wrote: > On 2013/11/18 22:56:10, kexec wrote: > > On Mon, Nov 18, 2013 at 12:51:39AM +, Atsushi Kumagai wrote: > > > > [..] > > > > Is there any chance that you could look into fixing this. I have no > > > > experience writing code fo

Re: [PATCH] kexec/ppc64: bring up new ppc64le architecture

2013-11-20 Thread Laurent Dufour
On 19/11/2013 02:01, Simon Horman wrote: > On Fri, Nov 15, 2013 at 04:01:51PM +0100, Laurent Dufour wrote: >> This patch provides support for the new Power PC litte endian (LE) mode. The >> LE mode only differs in the way the instructions and data are stored in >> memory >> thus there is no real n