kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 2 Aug 2016 21:06:00 +0000 (14:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Aug 2016 23:35:27 +0000 (19:35 -0400)
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/E1b8koK-0004HS-K9@rmk-PC.armlinux.org.uk
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Vitaly Andrianov <vitalya@ti.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/ia64/kernel/machine_kexec.c
include/linux/kexec.h
kernel/kexec_core.c
kernel/ksysfs.c

index b72cd7a07222696978c64b33f3e86bf38b70fd19..599507bcec91fc577147cf97d894fe7f6dd11677 100644 (file)
@@ -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);
 }
index ce2fe197f5838611df03b2d6ecdbd69dec182405..555227f0029fcdeccd36017ce7794bee572607d0 100644 (file)
@@ -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)
index 5a83b2a9d5848bbdafd124a53e9aa8a0fcfa54f5..dab03f17be25e3482d3ed5c0c760bd9cc2a186ad 100644 (file)
@@ -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);
 }
index 152da4a48867c4e32df888aac674fd7a42d49799..9f1920d2d0c6dfaa285039b02edcf9db2af3352f 100644 (file)
@@ -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);