Skip to content

Commit 8391635

Browse files
Russell Kingsfrothwell
authored andcommitted
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>
1 parent bbd2ed0 commit 8391635

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

arch/ia64/kernel/machine_kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void arch_crash_save_vmcoreinfo(void)
163163
#endif
164164
}
165165

166-
unsigned long paddr_vmcoreinfo_note(void)
166+
phys_addr_t paddr_vmcoreinfo_note(void)
167167
{
168168
return ia64_tpa((unsigned long)(char *)&vmcoreinfo_note);
169169
}

include/linux/kexec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void crash_save_vmcoreinfo(void);
233233
void arch_crash_save_vmcoreinfo(void);
234234
__printf(1, 2)
235235
void vmcoreinfo_append_str(const char *fmt, ...);
236-
unsigned long paddr_vmcoreinfo_note(void);
236+
phys_addr_t paddr_vmcoreinfo_note(void);
237237

238238
#define VMCOREINFO_OSRELEASE(value) \
239239
vmcoreinfo_append_str("OSRELEASE=%s\n", value)

kernel/kexec_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
13721372
void __weak arch_crash_save_vmcoreinfo(void)
13731373
{}
13741374

1375-
unsigned long __weak paddr_vmcoreinfo_note(void)
1375+
phys_addr_t __weak paddr_vmcoreinfo_note(void)
13761376
{
13771377
return __pa((unsigned long)(char *)&vmcoreinfo_note);
13781378
}

kernel/ksysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ KERNEL_ATTR_RW(kexec_crash_size);
128128
static ssize_t vmcoreinfo_show(struct kobject *kobj,
129129
struct kobj_attribute *attr, char *buf)
130130
{
131-
return sprintf(buf, "%lx %x\n",
132-
paddr_vmcoreinfo_note(),
131+
phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
132+
return sprintf(buf, "%pa %x\n", &vmcore_base,
133133
(unsigned int)sizeof(vmcoreinfo_note));
134134
}
135135
KERNEL_ATTR_RO(vmcoreinfo);

0 commit comments

Comments
 (0)