linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ARM: LPAE: Fix alloc_init_section to flush all the pmd entries.
@ 2012-08-06 10:33 R Sricharan
  2012-08-17 11:03 ` R, Sricharan
  0 siblings, 1 reply; 2+ messages in thread
From: R Sricharan @ 2012-08-06 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

flush_pmd_entry flushes one cache line by MVA. This is
called by alloc_init_section to flush the mapped pmd
entries. But this is called outside the loop and when
LPAE is enabled the number of pmd entries to be
flushed can be across multiple cache lines. So call
this inside the loop so that all the mapped entries are
flushed.

This is going to result in additional cache line
flushes. There might be other better way to handle
this.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mm/mmu.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 0ed8808..02af3fe 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -619,7 +619,6 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
 	 * up one logical pointer to an L2 table.
 	 */
 	if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) == 0) {
-		pmd_t *p = pmd;
 
 #ifndef CONFIG_ARM_LPAE
 		if (addr & SECTION_SIZE)
@@ -629,9 +628,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
 		do {
 			*pmd = __pmd(phys | type->prot_sect);
 			phys += SECTION_SIZE;
+			flush_pmd_entry(pmd);
 		} while (pmd++, addr += SECTION_SIZE, addr != end);
-
-		flush_pmd_entry(p);
 	} else {
 		/*
 		 * No need to loop; pte's aren't interested in the
-- 
1.7.9.5

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

* [RFC PATCH] ARM: LPAE: Fix alloc_init_section to flush all the pmd entries.
  2012-08-06 10:33 [RFC PATCH] ARM: LPAE: Fix alloc_init_section to flush all the pmd entries R Sricharan
@ 2012-08-17 11:03 ` R, Sricharan
  0 siblings, 0 replies; 2+ messages in thread
From: R, Sricharan @ 2012-08-17 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,
On Mon, Aug 6, 2012 at 4:03 PM, R Sricharan <r.sricharan@ti.com> wrote:
> flush_pmd_entry flushes one cache line by MVA. This is
> called by alloc_init_section to flush the mapped pmd
> entries. But this is called outside the loop and when
> LPAE is enabled the number of pmd entries to be
> flushed can be across multiple cache lines. So call
> this inside the loop so that all the mapped entries are
> flushed.
>
> This is going to result in additional cache line
> flushes. There might be other better way to handle
> this.
>
> Signed-off-by: R Sricharan <r.sricharan@ti.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/mm/mmu.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 0ed8808..02af3fe 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -619,7 +619,6 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
>          * up one logical pointer to an L2 table.
>          */
>         if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) == 0) {
> -               pmd_t *p = pmd;
>
>  #ifndef CONFIG_ARM_LPAE
>                 if (addr & SECTION_SIZE)
> @@ -629,9 +628,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
>                 do {
>                         *pmd = __pmd(phys | type->prot_sect);
>                         phys += SECTION_SIZE;
> +                       flush_pmd_entry(pmd);
>                 } while (pmd++, addr += SECTION_SIZE, addr != end);
> -
> -               flush_pmd_entry(p);
>         } else {
>                 /*
>                  * No need to loop; pte's aren't interested in the
  Ping...

Thanks,
 Sricharan

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

end of thread, other threads:[~2012-08-17 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 10:33 [RFC PATCH] ARM: LPAE: Fix alloc_init_section to flush all the pmd entries R Sricharan
2012-08-17 11:03 ` R, Sricharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).