Skip to content

Commit

Permalink
kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t
Browse files Browse the repository at this point in the history
On PAE systems (eg, ARM LPAE) the vmcore note may be located above 4GB
physical on 32-bit architectures, so we need a wider type than "unsigned
long" here.  Arrange for paddr_vmcoreinfo_note() to return a
phys_addr_t, thereby allowing it to be located above 4GB.

This makes no difference for kexec-tools, as they already assume a
64-bit type when reading from this file.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Russell King <[email protected]>
Reviewed-by: Pratyush Anand <[email protected]>
Acked-by: Baoquan He <[email protected]>
Cc: Keerthy <[email protected]>
Cc: Vitaly Andrianov <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Dave Young <[email protected]>
Cc: Vivek Goyal <[email protected]>
Cc: Simon Horman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Russell King authored and torvalds committed Aug 2, 2016
1 parent 465d377 commit dae2801
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void arch_crash_save_vmcoreinfo(void)
#endif
}

unsigned long paddr_vmcoreinfo_note(void)
phys_addr_t paddr_vmcoreinfo_note(void)
{
return ia64_tpa((unsigned long)(char *)&vmcoreinfo_note);
}
Expand Down
2 changes: 1 addition & 1 deletion include/linux/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void crash_save_vmcoreinfo(void);
void arch_crash_save_vmcoreinfo(void);
__printf(1, 2)
void vmcoreinfo_append_str(const char *fmt, ...);
unsigned long paddr_vmcoreinfo_note(void);
phys_addr_t paddr_vmcoreinfo_note(void);

#define VMCOREINFO_OSRELEASE(value) \
vmcoreinfo_append_str("OSRELEASE=%s\n", value)
Expand Down
2 changes: 1 addition & 1 deletion kernel/kexec_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
void __weak arch_crash_save_vmcoreinfo(void)
{}

unsigned long __weak paddr_vmcoreinfo_note(void)
phys_addr_t __weak paddr_vmcoreinfo_note(void)
{
return __pa((unsigned long)(char *)&vmcoreinfo_note);
}
Expand Down
4 changes: 2 additions & 2 deletions kernel/ksysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ KERNEL_ATTR_RW(kexec_crash_size);
static ssize_t vmcoreinfo_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%lx %x\n",
paddr_vmcoreinfo_note(),
phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
return sprintf(buf, "%pa %x\n", &vmcore_base,
(unsigned int)sizeof(vmcoreinfo_note));
}
KERNEL_ATTR_RO(vmcoreinfo);
Expand Down

0 comments on commit dae2801

Please sign in to comment.