public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] makedumpfile: few ARM fixes
@ 2010-11-08  7:59 Mika Westerberg
  2010-11-08  7:59 ` [PATCH v2 1/2] ARM: determine PAGE_OFFSET from _stext Mika Westerberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mika Westerberg @ 2010-11-08  7:59 UTC (permalink / raw)
  To: igawa; +Cc: kexec, 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

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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] ARM: determine PAGE_OFFSET from _stext
  2010-11-08  7:59 [PATCH v2 0/2] makedumpfile: few ARM fixes Mika Westerberg
@ 2010-11-08  7:59 ` Mika Westerberg
  2010-11-08  7:59 ` [PATCH v2 2/2] ARM: don't depend on vmalloc_start Mika Westerberg
  2010-11-09  2:51 ` [PATCH v2 0/2] makedumpfile: few ARM fixes Masayuki Igawa
  2 siblings, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2010-11-08  7:59 UTC (permalink / raw)
  To: igawa; +Cc: kexec, Mika Westerberg

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.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
---
 arm.c          |    2 +-
 makedumpfile.h |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arm.c b/arm.c
index 3fc0599..3ea450a 100644
--- a/arm.c
+++ b/arm.c
@@ -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;
diff --git a/makedumpfile.h b/makedumpfile.h
index 3f39a88..6d91d51 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -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)
-- 
1.5.6.5


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] ARM: don't depend on vmalloc_start
  2010-11-08  7:59 [PATCH v2 0/2] makedumpfile: few ARM fixes Mika Westerberg
  2010-11-08  7:59 ` [PATCH v2 1/2] ARM: determine PAGE_OFFSET from _stext Mika Westerberg
@ 2010-11-08  7:59 ` Mika Westerberg
  2010-11-09  2:51 ` [PATCH v2 0/2] makedumpfile: few ARM fixes Masayuki Igawa
  2 siblings, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2010-11-08  7:59 UTC (permalink / raw)
  To: igawa; +Cc: kexec, 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.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
---
 arm.c |   48 ++++++++----------------------------------------
 1 files changed, 8 insertions(+), 40 deletions(-)

diff --git a/arm.c b/arm.c
index 3ea450a..00ca654 100644
--- a/arm.c
+++ b/arm.c
@@ -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__ */
-- 
1.5.6.5


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] makedumpfile: few ARM fixes
  2010-11-08  7:59 [PATCH v2 0/2] makedumpfile: few ARM fixes Mika Westerberg
  2010-11-08  7:59 ` [PATCH v2 1/2] ARM: determine PAGE_OFFSET from _stext Mika Westerberg
  2010-11-08  7:59 ` [PATCH v2 2/2] ARM: don't depend on vmalloc_start Mika Westerberg
@ 2010-11-09  2:51 ` Masayuki Igawa
  2 siblings, 0 replies; 4+ messages in thread
From: Masayuki Igawa @ 2010-11-09  2:51 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: kexec

Hi,

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

Regards,
Masayuki Igawa


On Mon,  8 Nov 2010 09:59:26 +0200, Mika Westerberg wrote:

> 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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-09  2:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08  7:59 [PATCH v2 0/2] makedumpfile: few ARM fixes Mika Westerberg
2010-11-08  7:59 ` [PATCH v2 1/2] ARM: determine PAGE_OFFSET from _stext Mika Westerberg
2010-11-08  7:59 ` [PATCH v2 2/2] ARM: don't depend on vmalloc_start Mika Westerberg
2010-11-09  2:51 ` [PATCH v2 0/2] makedumpfile: few ARM fixes Masayuki Igawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox