Re: [PATCH kexec-tools v2 16/32] arm: fix ELF32/ELF64 check

2016-06-06 Thread Pratyush Anand
On 06/06/2016:06:00:05 PM, Russell King wrote: > Rather than using ULONG_MAX to decide whether to use the ELF64 or ELF32 > core dump format, use UINT32_MAX instead - we include stdint.h, so we > might as well use a constant which is meaningful for the limits of > the 32-bit ELF format. > > Signed-

Re: [PATCH kexec-tools v2 18/32] arm: report if crash kernel is out of bounds

2016-06-06 Thread Pratyush Anand
On 06/06/2016:06:00:16 PM, Russell King wrote: > Report an error if the crash kernel memory region is outside of the > boot-view memory range - this can happen with systems such as > Keystone 2. > > Signed-off-by: Russell King Reviewed-by: Pratyush Anand > --- > kexec/arch/arm/crashdump-arm.c

Re: [PATCH kexec-tools v2 12/32] kexec: add helper to exlude a region from a set of memory ranges

2016-06-06 Thread Pratyush Anand
On 06/06/2016:05:59:44 PM, Russell King wrote: > Add a helper to exclude a region from a set of memory ranges. > > Signed-off-by: Russell King Reviewed-by: Pratyush Anand > --- > kexec/mem_regions.c | 71 > + > kexec/mem_regions.h | 4 +++ >

RE: [ANNOUNCE] makedumpfile: v1.6.0 release date

2016-06-06 Thread Atsushi Kumagai
>Hello, > >makedumpfile-1.6.0 was scheduled in May, but still there is a >unresolved issue so the release will be delayed. > >The issue is that the multi-thread feature doesn't work correctly >on ia64, the generated dump is indefinite. >The dumps below are generated by the same option (-cd31 + --nu

RE: [PATCH V7] makedumpfile: exclude page structures of non-dumped pages

2016-06-06 Thread Atsushi Kumagai
>If the pgd entry is null, the code below will try to read 0x0. >This behavior will cause unexpected results, especially if pfn:0 is on >memory hole. >I think null pgd (and pud) entries should be skipped, how about you ? >I would like you to post the bug fix if you have no objection. For v1.6.0, I

RE: [PATCH 2/3] makedumpfile: Mark unstored ELF pages as filtered

2016-06-06 Thread Atsushi Kumagai
>>+static void >>+exclude_nodata_pages(struct cycle *cycle) >>+{ >>+ int i; >>+ unsigned long long phys_start, phys_end; >>+ off_t file_size; >>+ >>+ i = 0; >>+ while (get_pt_load_extents(i, &phys_start, &phys_end, >>+NULL, &file_size)) { >>+

Re: [PATCH kexec-tools v2 04/32] kdump: fix kdump mapping

2016-06-06 Thread Pratyush Anand
On 06/06/2016:05:59:03 PM, Russell King wrote: > When kdump tries to map the program header, it fails to take account > of ehdr->e_phoff being an offset from the start of the ELF "file", > which causes: > > Cannot mmap /dev/mem offset: 64 size: 392: Invalid argument > > Ensure that we take accoun

Re: [PATCH v17 00/13] arm64 kexec kernel patches

2016-06-06 Thread AKASHI Takahiro
On Fri, Jun 03, 2016 at 06:13:40PM +, Geoff Levand wrote: > This series adds the core support for kexec re-boot and kdump on ARM64. This > version of the series combines Takahiro's kdump patches with my kexec patches. > Please consider all patches for inclusion. > > Takahiro has done some ext

[PATCH kexec-tools v2 24/32] arm: add support for platforms with boot memory aliases

2016-06-06 Thread Russell King
The kexec API deals with boot-view addresses, rather than normal system view addresses. This causes problems for platforms such as Keystone 2, where the boot view is substantially different from the normal system view. This is because Keystone 2 boots from a memory alias in the lower 4GiB, before

[PATCH kexec-tools v2 16/32] arm: fix ELF32/ELF64 check

2016-06-06 Thread Russell King
Rather than using ULONG_MAX to decide whether to use the ELF64 or ELF32 core dump format, use UINT32_MAX instead - we include stdint.h, so we might as well use a constant which is meaningful for the limits of the 32-bit ELF format. Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c |

[PATCH kexec-tools v2 09/32] kexec: phys_to_virt() must take unsigned long long

2016-06-06 Thread Russell King
crashdump-elf.c passes unsigned long long addresses into phys_to_virt() so make phys_to_virt() accept such addresses without truncating them. This is important for ARM LPAE systems. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/phys_to_virt.c | 2 +- kexec/crashdump

[PATCH kexec-tools v2 12/32] kexec: add helper to exlude a region from a set of memory ranges

2016-06-06 Thread Russell King
Add a helper to exclude a region from a set of memory ranges. Signed-off-by: Russell King --- kexec/mem_regions.c | 71 + kexec/mem_regions.h | 4 +++ 2 files changed, 75 insertions(+) diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c in

[PATCH kexec-tools v2 17/32] arm: return proper error for missing crash kernel

2016-06-06 Thread Russell King
Return the proper error code (ENOCRASHKERNEL) for a missing crash kernel region in /proc/iomem, so the error handling in kexec.c can print the appropriate message. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/kexec-zImage-arm.c | 2 +- 1 file changed, 1 insertion(+

[PATCH kexec-tools v2 14/32] arm: fix off-by-one on memory end

2016-06-06 Thread Russell King
The memory range end is inclusive, not exclusive (see x86). We should not be adding one to the value parsed from the /proc/iomem resources. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/kexec-arm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kexec/arch/arm/k

[PATCH kexec-tools v2 25/32] arm: crashdump needs boot alias of crash kernel region

2016-06-06 Thread Russell King
When crashdumping, we need the boot memory alias of the crash kernel region rather than the system view. Arrange to check for the boot alias of the crash kernel region first, and if found, use it instead of the main alias. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/

[PATCH kexec-tools v2 10/32] kexec: add generic helper to add to memory_regions

2016-06-06 Thread Russell King
Add a helper to add a memory range to a memory_regions array. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/Makefile | 4 kexec/mem_regions.c | 30 ++ kexec/mem_regions.h | 9 + 3 files changed, 43 insertions(+) create mode 10

[PATCH kexec-tools v2 29/32] arm: add debug of reserved and coredump memory ranges

2016-06-06 Thread Russell King
Add debug of the reserved and coredump memory ranges for validation. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c index 25fdbe

[PATCH kexec-tools v2 27/32] arm: add support for multiple reserved regions

2016-06-06 Thread Russell King
Add support for reserving multiple memory regions rather than just a single region. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 66 -- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/kexec/a

[PATCH kexec-tools v2 30/32] arm: fix type of phys_offset

2016-06-06 Thread Russell King
Some LPAE systems may have phys_offset above the 4GB mark. Hence, we need phys_offset to be a 64-bit integer. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 4 ++-- kexec/arch/arm/crashdump-arm.h | 1 - kexec/arch/arm/phys_to_virt.c | 4 +++- kexe

[PATCH kexec-tools v2 26/32] arm: rename crash_reserved_mem to crash_kernel_mem

2016-06-06 Thread Russell King
Rename crash_reserved_mem to crash_kernel_mem as we want to support multiple reserved memory ranges. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/kexe

[PATCH kexec-tools v2 23/32] arm: move crash system RAM parsing earlier

2016-06-06 Thread Russell King
Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/Makefile| 2 ++ kexec/arch/arm/crashdump-arm.c | 51 -- 2 files changed, 11 insertions(+), 42 deletions(-) diff --git a/kexec/arch/arm/Makefile b/kexec/arch/arm/Makefile i

[PATCH kexec-tools v2 28/32] arm: add support for boot-time crash kernel resource

2016-06-06 Thread Russell King
Add support for detecting and using the boot-time crash kernel resource, which is needed for systems which have special boot-time memory views, such as Keystone 2. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 13 +++-- 1 file changed, 11 i

[PATCH kexec-tools v2 11/32] kexec: add mem_regions sorting implementation

2016-06-06 Thread Russell King
Add a mem_regions sorting implementation taken from the arm code. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/mem_regions.c | 27 +++ kexec/mem_regions.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/kexec/mem_regions.c b/kexec/mem_region

[PATCH kexec-tools v2 15/32] arm: fix get_kernel_stext_sym() to close its file

2016-06-06 Thread Russell King
Fix get_kernel_stext_sym() so that it closes its file once it's finsihed with it - there's no need to leak file descriptors. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-)

[PATCH kexec-tools v2 13/32] arm: fix pointer signedness warning in kexec-uImage-arm.c

2016-06-06 Thread Russell King
kexec/arch/arm/kexec-uImage-arm.c: In function 'uImage_arm_probe': kexec/arch/arm/kexec-uImage-arm.c:14:2: warning: pointer targets in passing argument 1 of 'uImage_probe_kernel' differ in signedness [-Wpointer-sign] Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/ke

[PATCH kexec-tools v2 21/32] arm: parse crash_reserved_mem early

2016-06-06 Thread Russell King
We parse the crash kernel memory region in several locations in the kexec tools - once to check that there's a region, another time for real when we're locating the memory regions to dump, and another while loading the image. Move the real parsing step to is_crashkernel_mem_reserved(), which match

[PATCH kexec-tools v2 31/32] arm: clean up phys/page offset debug

2016-06-06 Thread Russell King
Clean up the physical and page offset debug prints. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c index 2589582..

[PATCH kexec-tools v2 32/32] arm: report which ELF core format we will use

2016-06-06 Thread Russell King
Report which ELF core format will be used to create the template ELF core dump in the debug information. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/

[PATCH kexec-tools v2 06/32] kdump: print mmap() offset in hex

2016-06-06 Thread Russell King
When mmap() fails, printing a large decimal number is mostly meaningless - it's not obvious what it means. Printing a hex number is more obvious, because we can see whether it's over 32-bit, or not page aligned. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kdump/kdump.c | 2 +-

[PATCH kexec-tools v2 05/32] arm: fix kdump to work on LPAE systems

2016-06-06 Thread Russell King
We need to use 64-bit file IO when mapping system memory and the core dump file as we may be running on a LPAE system, otherwise we risk mapping memory we shouldn't, and causing a kernel oops: Unhandled fault: asynchronous external abort (0x211) at 0x pgd = edd2c740 [] *pgd=82ec980

[PATCH kexec-tools v2 03/32] kdump: actually write out the memory

2016-06-06 Thread Russell King
Actually write out the memory rather than writing the notes a second time. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kdump/kdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdump/kdump.c b/kdump/kdump.c index 99a1789..1f5b984 100644 --- a/kdump/kdump.

[PATCH kexec-tools v2 04/32] kdump: fix kdump mapping

2016-06-06 Thread Russell King
When kdump tries to map the program header, it fails to take account of ehdr->e_phoff being an offset from the start of the ELF "file", which causes: Cannot mmap /dev/mem offset: 64 size: 392: Invalid argument Ensure that we take account of the start address when mapping this. This fix has been

[PATCH kexec-tools v2 22/32] arm: use generic mem_region sorting implementation

2016-06-06 Thread Russell King
Use the generic mem_region sorting implementation. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c inde

[PATCH kexec-tools v2 02/32] kdump: fix multiple program header entries

2016-06-06 Thread Russell King
generate_new_headers() forgot to increment the program header pointer after adding each program header from the kexec template. Fix it to increment it correctly. Without this, the program headers contain only the last entry, which means we will be missing most of the kernel image in the dump. Rev

[PATCH kexec-tools v2 01/32] kdump: mmap() and munmap() only work on page-aligned quantites

2016-06-06 Thread Russell King
The man page for mmap() and munmap() says that mmap() and munmap() only works for page-aligned addresses, sizes and offsets. Arrange to give these interfaces what they want. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kdump/kdump.c | 19 --- 1 file changed, 16 i

[PATCH kexec-tools v2 20/32] arm: add maximum number of memory ranges

2016-06-06 Thread Russell King
Add the maximum number of memory ranges to the list of usable memory ranges, so that we don't have to carry this around. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kexec/arch/

[PATCH kexec-tools v2 18/32] arm: report if crash kernel is out of bounds

2016-06-06 Thread Russell King
Report an error if the crash kernel memory region is outside of the boot-view memory range - this can happen with systems such as Keystone 2. Signed-off-by: Russell King --- kexec/arch/arm/crashdump-arm.c | 11 +++ kexec/arch/arm/crashdump-arm.h | 1 + 2 files changed, 12 insertions(+)

[PATCH kexec-tools v2 19/32] arm: add memory ranges debug

2016-06-06 Thread Russell King
Add the call to dbgprint_mem_range() into the ARM version of get_memory_ranges(). Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/kexec-arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c index e47fc00..

[PATCH kexec-tools v2 08/32] kexec: add max_size to memory_ranges

2016-06-06 Thread Russell King
Many implementations statically allocate the memory range array, which therefore will have a maximum allowable size. Add this information to the memory_ranges structure, so we don't have to carry it around. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/kexec.h | 1 + 1 file

[PATCH kexec-tools v2 07/32] kexec: fix warnings caused by selecting 64-bit file IO on 32-bit platforms

2016-06-06 Thread Russell King
Fix warnings caused by selecting 64-bit file IO on 32-bit platforms. kexec/kexec.c:710:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' [-Wformat] kexec/zlib.c:63:4: warning: format '%ld' expects argument of type 'long int', but argument 4 ha

[PATCH kexec-tools v2 00/32] Keystone II updates for kexec tools

2016-06-06 Thread Russell King - ARM Linux
Here's the latest set of kexec-tools patches to support Keystone II platforms, which work in conjunction with the kernel patches which Andrew Morton has already taken. Most of the patches have been reviewed, but there are a small number which do not have Reviewed-by or Acked-by tags; these are due