aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2016-08-02 17:06:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:27 -0400
commitdae28018f56645b61f5beb84d5831346d3c5e457 (patch)
tree3d472ba7f21e4d0c6d6283605052b716af1794a2
parent465d377701dfe6a08a9f361a3fd926dea7f89c74 (diff)
kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t
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>
-rw-r--r--arch/ia64/kernel/machine_kexec.c2
-rw-r--r--include/linux/kexec.h2
-rw-r--r--kernel/kexec_core.c2
-rw-r--r--kernel/ksysfs.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c
index b72cd7a07222..599507bcec91 100644
--- a/arch/ia64/kernel/machine_kexec.c
+++ b/arch/ia64/kernel/machine_kexec.c
@@ -163,7 +163,7 @@ void arch_crash_save_vmcoreinfo(void)
163#endif 163#endif
164} 164}
165 165
166unsigned long paddr_vmcoreinfo_note(void) 166phys_addr_t paddr_vmcoreinfo_note(void)
167{ 167{
168 return ia64_tpa((unsigned long)(char *)&vmcoreinfo_note); 168 return ia64_tpa((unsigned long)(char *)&vmcoreinfo_note);
169} 169}
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index ce2fe197f583..555227f0029f 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -233,7 +233,7 @@ void crash_save_vmcoreinfo(void);
233void arch_crash_save_vmcoreinfo(void); 233void arch_crash_save_vmcoreinfo(void);
234__printf(1, 2) 234__printf(1, 2)
235void vmcoreinfo_append_str(const char *fmt, ...); 235void vmcoreinfo_append_str(const char *fmt, ...);
236unsigned long paddr_vmcoreinfo_note(void); 236phys_addr_t paddr_vmcoreinfo_note(void);
237 237
238#define VMCOREINFO_OSRELEASE(value) \ 238#define VMCOREINFO_OSRELEASE(value) \
239 vmcoreinfo_append_str("OSRELEASE=%s\n", value) 239 vmcoreinfo_append_str("OSRELEASE=%s\n", value)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5a83b2a9d584..dab03f17be25 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1372,7 +1372,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
1372void __weak arch_crash_save_vmcoreinfo(void) 1372void __weak arch_crash_save_vmcoreinfo(void)
1373{} 1373{}
1374 1374
1375unsigned long __weak paddr_vmcoreinfo_note(void) 1375phys_addr_t __weak paddr_vmcoreinfo_note(void)
1376{ 1376{
1377 return __pa((unsigned long)(char *)&vmcoreinfo_note); 1377 return __pa((unsigned long)(char *)&vmcoreinfo_note);
1378} 1378}
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 152da4a48867..9f1920d2d0c6 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -128,8 +128,8 @@ KERNEL_ATTR_RW(kexec_crash_size);
128static ssize_t vmcoreinfo_show(struct kobject *kobj, 128static ssize_t vmcoreinfo_show(struct kobject *kobj,
129 struct kobj_attribute *attr, char *buf) 129 struct kobj_attribute *attr, char *buf)
130{ 130{
131 return sprintf(buf, "%lx %x\n", 131 phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
132 paddr_vmcoreinfo_note(), 132 return sprintf(buf, "%pa %x\n", &vmcore_base,
133 (unsigned int)sizeof(vmcoreinfo_note)); 133 (unsigned int)sizeof(vmcoreinfo_note));
134} 134}
135KERNEL_ATTR_RO(vmcoreinfo); 135KERNEL_ATTR_RO(vmcoreinfo);