Skip to contentSkip to conversation

kexec: change phys_to_virt() to always use 'unsigned long long'.

PATCH New Eugene Surovegin 1 participant 1 message Nov 1, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: change phys_to_virt() to always use 'unsigned long long'.

This fixes physical address truncation by 32-bit binary preparing ELF headers for 64-bit crash kernel, e.g. 32-bit kexec-tools running on x86_64..

---
 kexec/arch/arm/phys_to_virt.c |    4 ++--
 kexec/crashdump.h             |    4 ++--
 kexec/phys_to_virt.c          |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
kexec/arch/arm/phys_to_virt.c +2 -2
index bcced52..ed96cf3 100644
@@ -13,8 +13,8 @@
  * See also:
  * http://lists.arm.linux.org.uk/lurker/message/20010723.185051.94ce743c.en.html
  */
-unsigned long
-phys_to_virt(struct crash_elf_info *elf_info, unsigned long paddr)
+unsigned long long
+phys_to_virt(struct crash_elf_info *elf_info, unsigned long long paddr)
 {
 	return paddr + elf_info->page_offset - phys_offset;
 }
kexec/crashdump.h +2 -2
index 0f7c2ea..dab5dc1 100644
@@ -53,8 +53,8 @@ int crash_create_elf64_headers(struct kexec_info *info,
 
 unsigned long crash_architecture(struct crash_elf_info *elf_info);
 
-unsigned long phys_to_virt(struct crash_elf_info *elf_info,
-			   unsigned long paddr);
+unsigned long long phys_to_virt(struct crash_elf_info *elf_info,
+				unsigned long long paddr);
 
 int xen_present(void);
 unsigned long xen_architecture(struct crash_elf_info *elf_info);
kexec/phys_to_virt.c +2 -2
index 91b6d01..4d29631 100644
@@ -9,8 +9,8 @@
  * PAGE_OFFSET. Architectures that don't follow this convention should provide
  * their own implementation.
  */
-unsigned long
-phys_to_virt(struct crash_elf_info *elf_info, unsigned long paddr)
+unsigned long long
+phys_to_virt(struct crash_elf_info *elf_info, unsigned long long paddr)
 {
 	return paddr + elf_info->page_offset;
 }
Signature · 7 lines
1.7.3.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec