[patch 080/111] kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
Subject: 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@xxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
Reviewed-by: Pratyush Anand <panand@xxxxxxxxxx>
Acked-by: Baoquan He <bhe@xxxxxxxxxx>
Cc: Keerthy <j-keerthy@xxxxxx>
Cc: Vitaly Andrianov <vitalya@xxxxxx>
Cc: Eric Biederman <ebiederm@xxxxxxxxxxxx>
Cc: Dave Young <dyoung@xxxxxxxxxx>
Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
Cc: Simon Horman <horms@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/ia64/kernel/machine_kexec.c |    2 +-
 include/linux/kexec.h            |    2 +-
 kernel/kexec_core.c              |    2 +-
 kernel/ksysfs.c                  |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff -puN arch/ia64/kernel/machine_kexec.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t arch/ia64/kernel/machine_kexec.c
--- a/arch/ia64/kernel/machine_kexec.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t
+++ a/arch/ia64/kernel/machine_kexec.c
@@ -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);
 }
diff -puN include/linux/kexec.h~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t include/linux/kexec.h
--- a/include/linux/kexec.h~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t
+++ a/include/linux/kexec.h
@@ -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)
diff -puN kernel/kexec_core.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t kernel/kexec_core.c
--- a/kernel/kexec_core.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t
+++ a/kernel/kexec_core.c
@@ -1372,7 +1372,7 @@ void vmcoreinfo_append_str(const char *f
 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);
 }
diff -puN kernel/ksysfs.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t kernel/ksysfs.c
--- a/kernel/ksysfs.c~kdump-arrange-for-paddr_vmcoreinfo_note-to-return-phys_addr_t
+++ a/kernel/ksysfs.c
@@ -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);
_
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux