]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
powerpc/mm/radix: Move function from radix.h to pgtable-radix.c
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Tue, 29 May 2018 14:28:39 +0000 (19:58 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:40:34 +0000 (20:40 +1000)
In later patch we will update them which require them to be moved
to pgtable-radix.c. Keeping the function in radix.h results in
compile warning as below.

./arch/powerpc/include/asm/book3s/64/radix.h: In function ‘radix__ptep_set_access_flags’:
./arch/powerpc/include/asm/book3s/64/radix.h:196:28: error: dereferencing pointer to incomplete type ‘struct vm_area_struct’
  struct mm_struct *mm = vma->vm_mm;
                            ^~
./arch/powerpc/include/asm/book3s/64/radix.h:204:6: error: implicit declaration of function ‘atomic_read’; did you mean ‘__atomic_load’? [-Werror=implicit-function-declaration]
      atomic_read(&mm->context.copros) > 0) {
      ^~~~~~~~~~~
      __atomic_load
./arch/powerpc/include/asm/book3s/64/radix.h:204:21: error: dereferencing pointer to incomplete type ‘struct mm_struct’
      atomic_read(&mm->context.copros) > 0) {

Instead of fixing header dependencies, we move the function to pgtable-radix.c
Also the function is now large to be a static inline . Doing the
move in separate patch helps in review.

No functional change in this patch. Only code movement.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/radix.h
arch/powerpc/mm/pgtable-radix.c

index 705193e7192fb8a531974125d1f19f36d337037d..36ed025b4e13930634435e4e183258da76f85444 100644 (file)
@@ -124,6 +124,9 @@ extern void radix__mark_rodata_ro(void);
 extern void radix__mark_initmem_nx(void);
 #endif
 
+extern void radix__ptep_set_access_flags(struct mm_struct *mm, pte_t *ptep,
+                                        pte_t entry, unsigned long address);
+
 static inline unsigned long __radix_pte_update(pte_t *ptep, unsigned long clr,
                                               unsigned long set)
 {
@@ -190,34 +193,6 @@ static inline pte_t radix__ptep_get_and_clear_full(struct mm_struct *mm,
        return __pte(old_pte);
 }
 
-/*
- * Set the dirty and/or accessed bits atomically in a linux PTE, this
- * function doesn't need to invalidate tlb.
- */
-static inline void radix__ptep_set_access_flags(struct mm_struct *mm,
-                                               pte_t *ptep, pte_t entry,
-                                               unsigned long address)
-{
-
-       unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED |
-                                             _PAGE_RW | _PAGE_EXEC);
-
-       if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
-
-               unsigned long old_pte, new_pte;
-
-               old_pte = __radix_pte_update(ptep, ~0, 0);
-               /*
-                * new value of pte
-                */
-               new_pte = old_pte | set;
-               radix__flush_tlb_pte_p9_dd1(old_pte, mm, address);
-               __radix_pte_update(ptep, 0, new_pte);
-       } else
-               __radix_pte_update(ptep, 0, set);
-       asm volatile("ptesync" : : : "memory");
-}
-
 static inline int radix__pte_same(pte_t pte_a, pte_t pte_b)
 {
        return ((pte_raw(pte_a) ^ pte_raw(pte_b)) == 0);
index ce24d72ea679999f6baf3c468a740013cc23e92a..a6eec41dd3475f4b6308ab04d831f93b30b346ef 100644 (file)
@@ -1084,3 +1084,25 @@ int radix__has_transparent_hugepage(void)
        return 0;
 }
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+
+void radix__ptep_set_access_flags(struct mm_struct *mm,
+                                 pte_t *ptep, pte_t entry,
+                                 unsigned long address)
+{
+       unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED |
+                                             _PAGE_RW | _PAGE_EXEC);
+
+       if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+               unsigned long old_pte, new_pte;
+
+               old_pte = __radix_pte_update(ptep, ~0, 0);
+               /*
+                * new value of pte
+                */
+               new_pte = old_pte | set;
+               radix__flush_tlb_pte_p9_dd1(old_pte, mm, address);
+               __radix_pte_update(ptep, 0, new_pte);
+       } else
+               __radix_pte_update(ptep, 0, set);
+       asm volatile("ptesync" : : : "memory");
+}