Mika Westerberg | 4 Nov 2010 09:15
Picon

[PATCH 2/2] ARM: don't depend on vmalloc_start

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
on different platforms). Since this value is not stored in vmcoreinfo, we have
no means to find out the correct value for vmalloc_start.

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@...>
---
 arm.c |   40 +++++++++++++++++++---------------------
 1 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/arm.c b/arm.c
index 3ea450a..6469f03 100644
--- a/arm.c
+++ b/arm.c
 <at>  <at>  -86,6 +86,9  <at>  <at>  get_machdep_info_arm(void)
 	info->kernel_start = SYMBOL(_stext);
 	info->section_size_bits = _SECTION_SIZE_BITS;

+	DEBUG_MSG("page_offset  : %lx\n", info->page_offset);
+	DEBUG_MSG("kernel_start : %lx\n", info->kernel_start);
+
 	/*
 	 * For the compatibility, makedumpfile should run without the symbol
 	 * vmlist and the offset of vm_struct.addr if they are not necessary.
 <at>  <at>  -95,31 +98,28  <at>  <at>  get_machdep_info_arm(void)
 		return TRUE;
 	}
(Continue reading)

Mika Westerberg | 4 Nov 2010 09:15
Picon

[PATCH 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.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@...>
---
 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
 <at>  <at>  -81,7 +81,7  <at>  <at>  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
 <at>  <at>  -507,7 +507,6  <at>  <at>  do { \
 #define VMEMMAP_END		(info->vmemmap_end)

(Continue reading)

Mika Westerberg | 4 Nov 2010 09:15
Picon

[PATCH 0/2] 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).

Regards,
MW

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

 arm.c          |   42 ++++++++++++++++++++----------------------
 makedumpfile.h |    1 -
 2 files changed, 20 insertions(+), 23 deletions(-)
Mika Westerberg | 5 Nov 2010 07:02
Picon

Re: [PATCH 2/2] ARM: don't depend on vmalloc_start

On Fri, Nov 05, 2010 at 11:18:42AM +0900, ext Masayuki Igawa wrote:
> 
> Some comments are below.

Thanks for the comments.

> 
> 
> From: Mika Westerberg <ext-mika.1.westerberg@...>
> Subject: [PATCH 2/2] ARM: don't depend on vmalloc_start
> Date: Thu,  4 Nov 2010 10:15:17 +0200
> 
> > 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
> > on different platforms). Since this value is not stored in vmcoreinfo, we have
> > no means to find out the correct value for vmalloc_start.
> > 
> > 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@...>
> > ---
> >  arm.c |   40 +++++++++++++++++++---------------------
> >  1 files changed, 19 insertions(+), 21 deletions(-)
> > 
> > diff --git a/arm.c b/arm.c
> > index 3ea450a..6469f03 100644
> > --- a/arm.c
> > +++ b/arm.c
> >  <at>  <at>  -86,6 +86,9  <at>  <at>  get_machdep_info_arm(void)
(Continue reading)

Masayuki Igawa | 5 Nov 2010 08:41
X-Face
Picon
Picon

Re: [PATCH 2/2] ARM: don't depend on vmalloc_start

Thanks for quick reply.

On Fri, 5 Nov 2010 08:02:26 +0200, Mika Westerberg wrote:
> On Fri, Nov 05, 2010 at 11:18:42AM +0900, ext Masayuki Igawa wrote:

> > >  
> > >  	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
> > >   *  <at> vaddr: virtual address to translate
> > >  <at>  <at>  -184,17 +184,15  <at>  <at>  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
(Continue reading)

Mika Westerberg | 5 Nov 2010 09:03
Picon

Re: [PATCH 2/2] ARM: don't depend on vmalloc_start

On Fri, Nov 05, 2010 at 04:41:34PM +0900, ext Masayuki Igawa wrote:
> On Fri, 5 Nov 2010 08:02:26 +0200, Mika Westerberg wrote:
> > 
> > Normal makedumpfile run (at least on ARM) only does V->P translation on kernel
> > directly mapped memory so I considered this to save few clock cycles since that
> > translation is trivial compared to the one using page tables.
> 
> Unfortunately, I'm not good at ARM. So I have a few questions.
> In (all) ARM, is all the kernel memory directly mapped?

Not all -- vmalloc() memory is not directly mapped.

> The result of vtop_arm()'s translation is always equals __pa()'s in ARM?

vtop_arm() also handles this vmalloc() memory as it uses page tables to perform
the translation.

> > Well my intention was to leave user a option to use '--vtop' for all the kernel
> > memory (not just for kernel directly mapped memory). IMO, it is useful to have
> > such option available for debugging etc. Is it ok for you?
> 
> IIUC, is there the kernel memory which isn't directly mapped?

Yes, see above.

> If so, the memory(which isn't directly mapped) is not supported by your patch?

As makedumpfile uses only values from VMCOREINFO which are in kernel direct
mapped memory the patch should work (I've tested this).

(Continue reading)

Masayuki Igawa | 5 Nov 2010 03:18
X-Face
Picon
Picon

Re: [PATCH 2/2] ARM: don't depend on vmalloc_start

Hi Mika,
Thank you for your patches.

Some comments are below.

From: Mika Westerberg <ext-mika.1.westerberg@...>
Subject: [PATCH 2/2] ARM: don't depend on vmalloc_start
Date: Thu,  4 Nov 2010 10:15:17 +0200

> 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
> on different platforms). Since this value is not stored in vmcoreinfo, we have
> no means to find out the correct value for vmalloc_start.
> 
> 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@...>
> ---
>  arm.c |   40 +++++++++++++++++++---------------------
>  1 files changed, 19 insertions(+), 21 deletions(-)
> 
> diff --git a/arm.c b/arm.c
> index 3ea450a..6469f03 100644
> --- a/arm.c
> +++ b/arm.c
>  <at>  <at>  -86,6 +86,9  <at>  <at>  get_machdep_info_arm(void)
>  	info->kernel_start = SYMBOL(_stext);
>  	info->section_size_bits = _SECTION_SIZE_BITS;
>  
(Continue reading)

Mika Westerberg | 8 Nov 2010 08:59
Picon

[PATCH v2 0/2] 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(-)
Mika Westerberg | 8 Nov 2010 08:59
Picon

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

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@...>
---
 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
 <at>  <at>  -79,47 +79,17  <at>  <at>  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
(Continue reading)

Mika Westerberg | 8 Nov 2010 08:59
Picon

[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.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@...>
---
 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
 <at>  <at>  -81,7 +81,7  <at>  <at>  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
 <at>  <at>  -507,7 +507,6  <at>  <at>  do { \
 #define VMEMMAP_END		(info->vmemmap_end)

(Continue reading)


Gmane