Commit bbc8e30f authored by Matthew McClintock's avatar Matthew McClintock Committed by Benjamin Herrenschmidt

powerpc/crashdump: Fix issues with kexec and 36bit physical addr

Fix sizes of variables so correct values are exported via /proc.
Cast variable in comparison to avoid compiler error.
Signed-off-by: default avatarMatthew McClintock <msm@freescale.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent fc53b420
...@@ -128,9 +128,9 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, ...@@ -128,9 +128,9 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
if (!csize) if (!csize)
return 0; return 0;
csize = min(csize, PAGE_SIZE); csize = min_t(size_t, csize, PAGE_SIZE);
if (pfn < max_pfn) { if ((min_low_pfn < pfn) && (pfn < max_pfn)) {
vaddr = __va(pfn << PAGE_SHIFT); vaddr = __va(pfn << PAGE_SHIFT);
csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
} else { } else {
......
...@@ -144,24 +144,24 @@ int overlaps_crashkernel(unsigned long start, unsigned long size) ...@@ -144,24 +144,24 @@ int overlaps_crashkernel(unsigned long start, unsigned long size)
} }
/* Values we need to export to the second kernel via the device tree. */ /* Values we need to export to the second kernel via the device tree. */
static unsigned long kernel_end; static phys_addr_t kernel_end;
static unsigned long crashk_size; static phys_addr_t crashk_size;
static struct property kernel_end_prop = { static struct property kernel_end_prop = {
.name = "linux,kernel-end", .name = "linux,kernel-end",
.length = sizeof(unsigned long), .length = sizeof(phys_addr_t),
.value = &kernel_end, .value = &kernel_end,
}; };
static struct property crashk_base_prop = { static struct property crashk_base_prop = {
.name = "linux,crashkernel-base", .name = "linux,crashkernel-base",
.length = sizeof(unsigned long), .length = sizeof(phys_addr_t),
.value = &crashk_res.start, .value = &crashk_res.start,
}; };
static struct property crashk_size_prop = { static struct property crashk_size_prop = {
.name = "linux,crashkernel-size", .name = "linux,crashkernel-size",
.length = sizeof(unsigned long), .length = sizeof(phys_addr_t),
.value = &crashk_size, .value = &crashk_size,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment