hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
....@@ -2,9 +2,24 @@
22 #ifndef _ASM_POWERPC_TLBFLUSH_RADIX_H
33 #define _ASM_POWERPC_TLBFLUSH_RADIX_H
44
5
+#include <asm/hvcall.h>
6
+
57 struct vm_area_struct;
68 struct mm_struct;
79 struct mmu_gather;
10
+
11
+static inline u64 psize_to_rpti_pgsize(unsigned long psize)
12
+{
13
+ if (psize == MMU_PAGE_4K)
14
+ return H_RPTI_PAGE_4K;
15
+ if (psize == MMU_PAGE_64K)
16
+ return H_RPTI_PAGE_64K;
17
+ if (psize == MMU_PAGE_2M)
18
+ return H_RPTI_PAGE_2M;
19
+ if (psize == MMU_PAGE_1G)
20
+ return H_RPTI_PAGE_1G;
21
+ return H_RPTI_PAGE_ALL;
22
+}
823
924 static inline int mmu_get_ap(int psize)
1025 {
....@@ -13,8 +28,32 @@
1328
1429 #ifdef CONFIG_PPC_RADIX_MMU
1530 extern void radix__tlbiel_all(unsigned int action);
31
+extern void radix__flush_tlb_lpid_page(unsigned int lpid,
32
+ unsigned long addr,
33
+ unsigned long page_size);
34
+extern void radix__flush_pwc_lpid(unsigned int lpid);
35
+extern void radix__flush_all_lpid(unsigned int lpid);
36
+extern void radix__flush_all_lpid_guest(unsigned int lpid);
1637 #else
1738 static inline void radix__tlbiel_all(unsigned int action) { WARN_ON(1); };
39
+static inline void radix__flush_tlb_lpid_page(unsigned int lpid,
40
+ unsigned long addr,
41
+ unsigned long page_size)
42
+{
43
+ WARN_ON(1);
44
+}
45
+static inline void radix__flush_pwc_lpid(unsigned int lpid)
46
+{
47
+ WARN_ON(1);
48
+}
49
+static inline void radix__flush_all_lpid(unsigned int lpid)
50
+{
51
+ WARN_ON(1);
52
+}
53
+static inline void radix__flush_all_lpid_guest(unsigned int lpid)
54
+{
55
+ WARN_ON(1);
56
+}
1857 #endif
1958
2059 extern void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma,
....@@ -48,12 +87,5 @@
4887 extern void radix__flush_tlb_pwc(struct mmu_gather *tlb, unsigned long addr);
4988 extern void radix__flush_tlb_collapsed_pmd(struct mm_struct *mm, unsigned long addr);
5089 extern void radix__flush_tlb_all(void);
51
-
52
-extern void radix__flush_tlb_lpid_page(unsigned int lpid,
53
- unsigned long addr,
54
- unsigned long page_size);
55
-extern void radix__flush_pwc_lpid(unsigned int lpid);
56
-extern void radix__local_flush_tlb_lpid(unsigned int lpid);
57
-extern void radix__local_flush_tlb_lpid_guest(unsigned int lpid);
5890
5991 #endif