Skip to contentSkip to conversation

makedumpfile: few ARM fixes

PATCH In review Mika Westerberg 2 participants 4 messages Nov 8, 2010 – Nov 9, 2010

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

v2 cover makedumpfile: few ARM fixes

Hi,

While using makedumpfile on ARM I found few issues from the current implementation. Basically the current implementation only works on 3G/1G VM split but not others.

These patches should make makedumpfile on ARM to work on other VM split values as well. I've tested with 1G/3G, 2G/2G, 3G/1G, and VMSPLIT_3G_OPT (2.7G/1.3G).

Changes to previous version:
- removed any references to vmalloc_start as per review comments

This version still allows users to use '--vtop' option to perform V->P translations via page tables.

Regards,
MW

Mika Westerberg (2):
ARM: determine PAGE_OFFSET from _stext
ARM: don't depend on vmalloc_start

 arm.c          |   50 +++++++++-----------------------------------------
 makedumpfile.h |    1 -
 2 files changed, 9 insertions(+), 42 deletions(-)

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

#1 lore raw

PATCH v2 1/2 ARM: determine PAGE_OFFSET from _stext

It is normal that we can have different values for PAGE_OFFSET depending on selected VM split. We avoid the hard-coded value and derive the value from the _stext symbol instead.

---
 arm.c          |    2 +-
 makedumpfile.h |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
arm.c +1 -1
index 3fc0599..3ea450a 100644
@@ -81,7 +81,7 @@ get_machdep_info_arm(void)
 {
 	unsigned long vmlist, vmalloc_start;
 
-	info->page_offset = __PAGE_OFFSET;
+	info->page_offset = SYMBOL(_stext) & 0xffff0000UL;
 	info->max_physmem_bits = _MAX_PHYSMEM_BITS;
 	info->kernel_start = SYMBOL(_stext);
 	info->section_size_bits = _SECTION_SIZE_BITS;
makedumpfile.h +0 -1
index 3f39a88..6d91d51 100644
@@ -507,7 +507,6 @@ do { \
 #define VMEMMAP_END		(info->vmemmap_end)
 
 #ifdef __arm__
-#define __PAGE_OFFSET		(0xc0000000)
 #define KVBASE_MASK		(0xffff)
 #define KVBASE			(SYMBOL(_stext) & ~KVBASE_MASK)
 #define _SECTION_SIZE_BITS	(28)
Signature · 7 lines
1.5.6.5


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

PATCH v2 2/2 ARM: don't depend on vmalloc_start

In reply to Mika Westerberg

In ARM, modules are placed in vmalloc'ed area right above user stack and the rest of the vmalloc area is somewhere after high_memory (this can be different from different platforms). This value is not stored in vmcoreinfo so we have no means to find out the correct vmalloc_start value.

So we assume that all V->P translations are within the kernel direct mapped memory and use translation tables only when '--vtop' option is passed.

---
 arm.c |   48 ++++++++----------------------------------------
 1 files changed, 8 insertions(+), 40 deletions(-)
arm.c +8 -40
index 3ea450a..00ca654 100644
@@ -79,47 +79,17 @@ get_phys_base_arm(void)
 int
 get_machdep_info_arm(void)
 {
-	unsigned long vmlist, vmalloc_start;
-
 	info->page_offset = SYMBOL(_stext) & 0xffff0000UL;
 	info->max_physmem_bits = _MAX_PHYSMEM_BITS;
 	info->kernel_start = SYMBOL(_stext);
 	info->section_size_bits = _SECTION_SIZE_BITS;
 
-	/*
-	 * For the compatibility, makedumpfile should run without the symbol
-	 * vmlist and the offset of vm_struct.addr if they are not necessary.
-	 */
-	if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL) ||
-		OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE) {
-		return TRUE;
-	}
-
-	if (!readmem(VADDR, SYMBOL(vmlist), &vmlist, sizeof(vmlist))) {
-		ERRMSG("Can't get vmlist.\n");
-		return FALSE;
-	}
-	if (!readmem(VADDR, vmlist + OFFSET(vm_struct.addr), &vmalloc_start,
-		     sizeof(vmalloc_start))) {
-		ERRMSG("Can't get vmalloc_start.\n");
-		return FALSE;
-	}
-
-	info->vmalloc_start = vmalloc_start;
-
 	DEBUG_MSG("page_offset  : %lx\n", info->page_offset);
 	DEBUG_MSG("kernel_start : %lx\n", info->kernel_start);
-	DEBUG_MSG("vmalloc_start: %lx\n", vmalloc_start);
 
 	return TRUE;
 }
 
-static int
-is_vmalloc_addr_arm(unsigned long vaddr)
-{
-	return (info->vmalloc_start && vaddr >= info->vmalloc_start);
-}
-
 /*
  * vtop_arm() - translate arbitrary virtual address to physical
  * @vaddr: virtual address to translate
@@ -184,17 +154,15 @@ vtop_arm(unsigned long vaddr)
 unsigned long long
 vaddr_to_paddr_arm(unsigned long vaddr)
 {
-	unsigned long long paddr = vaddr_to_paddr_general(vaddr);
-
-	if (paddr != NOT_PADDR)
-		return paddr;
-
-	if (is_vmalloc_addr_arm(vaddr))
-		paddr = vtop_arm(vaddr);
-	else
-		paddr = __pa(vaddr);
+	/*
+	 * Only use translation tables when user has explicitly requested us to
+	 * perform translation for a given address. Otherwise we assume that the
+	 * translation is done within the kernel direct mapped region.
+	 */
+	if (info->vaddr_for_vtop == vaddr)
+		return vtop_arm(vaddr);
 
-	return paddr;
+	return __pa(vaddr);
 }
 
 #endif /* __arm__ */
Signature · 7 lines
1.5.6.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
In reply to Mika Westerberg

Hi,

Thank you for your patches. I've merged and pushed.

Regards,
Masayuki Igawa

Quoted 19 lines · Mika Westerberg

Hi,

While using makedumpfile on ARM I found few issues from the current implementation. Basically the current implementation only works on 3G/1G VM split but not others.

These patches should make makedumpfile on ARM to work on other VM split values as well. I've tested with 1G/3G, 2G/2G, 3G/1G, and VMSPLIT_3G_OPT (2.7G/1.3G).

Changes to previous version:
- removed any references to vmalloc_start as per review comments

This version still allows users to use '--vtop' option to perform V->P translations via page tables.

Regards,
MW

Quoted 8 lines

Mika Westerberg (2):
ARM: determine PAGE_OFFSET from _stext
ARM: don't depend on vmalloc_start

 arm.c          |   50 +++++++++-----------------------------------------
 makedumpfile.h |    1 -
 2 files changed, 9 insertions(+), 42 deletions(-)

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