linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Remove flush_HPTE()
Date: Wed, 10 Dec 2008 19:34:57 +1100	[thread overview]
Message-ID: <1228898097.22413.49.camel@pasglop> (raw)
In-Reply-To: <20081210060941.31C43DDF5A@ozlabs.org>

On Wed, 2008-12-10 at 17:08 +1100, Benjamin Herrenschmidt wrote:
> The function flush_HPTE() is used in only one place, the implementation
> of DEBUG_PAGEALLOC on ppc32.
> 
> It's actually a dup of flush_tlb_page() though it's -slightly- more
> efficient on hash based processors. We remove it and replace it by
> a direct call to the hash flush code on those processors and to
> flush_tlb_page() for everybody else.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---

Actually, patch is bogus, it will break on 603. I'll fix that tomorrow
by just calling flush_tlb_page().

Cheers,
Ben.

>  arch/powerpc/mm/mmu_decl.h   |   17 -----------------
>  arch/powerpc/mm/pgtable_32.c |    6 +++++-
>  2 files changed, 5 insertions(+), 18 deletions(-)
> 
> --- linux-work.orig/arch/powerpc/mm/mmu_decl.h	2008-12-10 17:01:18.000000000 +1100
> +++ linux-work/arch/powerpc/mm/mmu_decl.h	2008-12-10 17:01:35.000000000 +1100
> @@ -58,17 +58,14 @@ extern phys_addr_t lowmem_end_addr;
>   * architectures.  -- Dan
>   */
>  #if defined(CONFIG_8xx)
> -#define flush_HPTE(X, va, pg)	_tlbie(va, 0 /* 8xx doesn't care about PID */)
>  #define MMU_init_hw()		do { } while(0)
>  #define mmu_mapin_ram()		(0UL)
>  
>  #elif defined(CONFIG_4xx)
> -#define flush_HPTE(pid, va, pg)	_tlbie(va, pid)
>  extern void MMU_init_hw(void);
>  extern unsigned long mmu_mapin_ram(void);
>  
>  #elif defined(CONFIG_FSL_BOOKE)
> -#define flush_HPTE(pid, va, pg)	_tlbie(va, pid)
>  extern void MMU_init_hw(void);
>  extern unsigned long mmu_mapin_ram(void);
>  extern void adjust_total_lowmem(void);
> @@ -77,18 +74,4 @@ extern void adjust_total_lowmem(void);
>  /* anything 32-bit except 4xx or 8xx */
>  extern void MMU_init_hw(void);
>  extern unsigned long mmu_mapin_ram(void);
> -
> -/* Be careful....this needs to be updated if we ever encounter 603 SMPs,
> - * which includes all new 82xx processors.  We need tlbie/tlbsync here
> - * in that case (I think). -- Dan.
> - */
> -static inline void flush_HPTE(unsigned context, unsigned long va,
> -			      unsigned long pdval)
> -{
> -	if ((Hash != 0) &&
> -	    mmu_has_feature(MMU_FTR_HPTE_TABLE))
> -		flush_hash_pages(0, va, pdval, 1);
> -	else
> -		_tlbie(va);
> -}
>  #endif
> Index: linux-work/arch/powerpc/mm/pgtable_32.c
> ===================================================================
> --- linux-work.orig/arch/powerpc/mm/pgtable_32.c	2008-12-10 17:01:49.000000000 +1100
> +++ linux-work/arch/powerpc/mm/pgtable_32.c	2008-12-10 17:04:36.000000000 +1100
> @@ -342,7 +342,11 @@ static int __change_page_attr(struct pag
>  		return -EINVAL;
>  	set_pte_at(&init_mm, address, kpte, mk_pte(page, prot));
>  	wmb();
> -	flush_HPTE(0, address, pmd_val(*kpmd));
> +#ifdef CONFIG_PPC_STD_MMU
> +	flush_hash_pages(0, address, pmd_val(*kpmd), 1);
> +#else
> +	flush_tlb_page(NULL, address);
> +#endif
>  	pte_unmap(kpte);
>  
>  	return 0;
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

      reply	other threads:[~2008-12-10  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10  6:08 [PATCH] powerpc: Remove flush_HPTE() Benjamin Herrenschmidt
2008-12-10  8:34 ` Benjamin Herrenschmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1228898097.22413.49.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).