* [PATCH 12/20] powerpc/mm: Add hook to flush pgtables when a PTE page is freed
@ 2009-07-23 5:59 Benjamin Herrenschmidt
2009-07-23 6:46 ` Stephen Rothwell
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2009-07-23 5:59 UTC (permalink / raw)
To: linuxppc-dev
64-bit BookE will use that hook to maintain the virtually linear
page tables or the indirect entries in the TLB when using the
HW loader.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/pgalloc.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- linux-work.orig/arch/powerpc/include/asm/pgalloc.h 2009-07-22 16:47:46.000000000 +1000
+++ linux-work/arch/powerpc/include/asm/pgalloc.h 2009-07-22 16:47:49.000000000 +1000
@@ -4,6 +4,12 @@
#include <linux/mm.h>
+#ifdef CONFIG_PPC_BOOK3E
+extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
+#else
+#define tlb_flush_pgtable(tlb, address) do { } while(0)
+#endif
+
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
free_page((unsigned long)pte);
@@ -41,11 +47,16 @@ extern void pgtable_free_tlb(struct mmu_
#define __pte_free_tlb(tlb,ptepage,address) \
do { \
pgtable_page_dtor(ptepage); \
+ tlb_flush_pgtable(tlb, address); \
pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \
} while (0)
#else
-#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, (pte))
+#define __pte_free_tlb(tlb,pte,address) \
+do { \
+ tlb_flush_pgtable(tlb, address); \
+ pte_free((tlb)->mm, (pte)); \
+} while (0)
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 12/20] powerpc/mm: Add hook to flush pgtables when a PTE page is freed
2009-07-23 5:59 [PATCH 12/20] powerpc/mm: Add hook to flush pgtables when a PTE page is freed Benjamin Herrenschmidt
@ 2009-07-23 6:46 ` Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2009-07-23 6:46 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
Hi Ben,
On Thu, 23 Jul 2009 15:59:46 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> +#ifdef CONFIG_PPC_BOOK3E
> +extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
> +#else
> +#define tlb_flush_pgtable(tlb, address) do { } while(0)
static inline void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address) {}
> #else
> -#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, (pte))
> +#define __pte_free_tlb(tlb,pte,address) \
> +do { \
> + tlb_flush_pgtable(tlb, address); \
> + pte_free((tlb)->mm, (pte)); \
> +} while (0)
This could (should?) be a static inline as well.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-23 6:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 5:59 [PATCH 12/20] powerpc/mm: Add hook to flush pgtables when a PTE page is freed Benjamin Herrenschmidt
2009-07-23 6:46 ` Stephen Rothwell
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).