hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/include/asm/tlb.h
....@@ -1,22 +1,17 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * TLB shootdown specifics for powerpc
34 *
45 * Copyright (C) 2002 Anton Blanchard, IBM Corp.
56 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version
10
- * 2 of the License, or (at your option) any later version.
117 */
128 #ifndef _ASM_POWERPC_TLB_H
139 #define _ASM_POWERPC_TLB_H
1410 #ifdef __KERNEL__
1511
1612 #ifndef __powerpc64__
17
-#include <asm/pgtable.h>
13
+#include <linux/pgtable.h>
1814 #endif
19
-#include <asm/pgalloc.h>
2015 #ifndef __powerpc64__
2116 #include <asm/page.h>
2217 #include <asm/mmu.h>
....@@ -27,9 +22,20 @@
2722 #define tlb_start_vma(tlb, vma) do { } while (0)
2823 #define tlb_end_vma(tlb, vma) do { } while (0)
2924 #define __tlb_remove_tlb_entry __tlb_remove_tlb_entry
30
-#define tlb_remove_check_page_size_change tlb_remove_check_page_size_change
3125
26
+#define tlb_flush tlb_flush
3227 extern void tlb_flush(struct mmu_gather *tlb);
28
+/*
29
+ * book3s:
30
+ * Hash does not use the linux page-tables, so we can avoid
31
+ * the TLB invalidate for page-table freeing, Radix otoh does use the
32
+ * page-tables and needs the TLBI.
33
+ *
34
+ * nohash:
35
+ * We still do TLB invalidate in the __pte_free_tlb routine before we
36
+ * add the page table pages to mmu gather table batch.
37
+ */
38
+#define tlb_needs_table_invalidate() radix_enabled()
3339
3440 /* Get the generic bits... */
3541 #include <asm-generic/tlb.h>
....@@ -40,26 +46,10 @@
4046 static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
4147 unsigned long address)
4248 {
43
-#ifdef CONFIG_PPC_STD_MMU_32
49
+#ifdef CONFIG_PPC_BOOK3S_32
4450 if (pte_val(*ptep) & _PAGE_HASHPTE)
4551 flush_hash_entry(tlb->mm, ptep, address);
4652 #endif
47
-}
48
-
49
-static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb,
50
- unsigned int page_size)
51
-{
52
- if (!tlb->page_size)
53
- tlb->page_size = page_size;
54
- else if (tlb->page_size != page_size) {
55
- if (!tlb->fullmm)
56
- tlb_flush_mmu(tlb);
57
- /*
58
- * update the page size after flush for the new
59
- * mmu_gather.
60
- */
61
- tlb->page_size = page_size;
62
- }
6353 }
6454
6555 #ifdef CONFIG_SMP