]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - arch/microblaze/mm/fault.c
mmap locking API: convert mmap_sem comments
[mirror_ubuntu-jammy-kernel.git] / arch / microblaze / mm / fault.c
index 3248141f8ed54e3ca6f3419a10258b7a333a555a..a2bfe587b49126f4fa44a035cf02e2e7463345f2 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/interrupt.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <linux/mmu_context.h>
 #include <linux/uaccess.h>
@@ -125,7 +124,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
         * kernel and should generate an OOPS.  Unfortunately, in the case of an
-        * erroneous fault occurring in a code path which already holds mmap_sem
+        * erroneous fault occurring in a code path which already holds mmap_lock
         * we will deadlock attempting to validate the fault against the
         * address space.  Luckily the kernel only validly references user
         * space from well defined areas of code, which are listed in the
@@ -137,12 +136,12 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
         * source.  If this is invalid we can skip the address space check,
         * thus avoiding the deadlock.
         */
-       if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
+       if (unlikely(!mmap_read_trylock(mm))) {
                if (kernel_mode(regs) && !search_exception_tables(regs->pc))
                        goto bad_area_nosemaphore;
 
 retry:
-               down_read(&mm->mmap_sem);
+               mmap_read_lock(mm);
        }
 
        vma = find_vma(mm, address);
@@ -239,7 +238,7 @@ good_area:
                        flags |= FAULT_FLAG_TRIED;
 
                        /*
-                        * No need to up_read(&mm->mmap_sem) as we would
+                        * No need to mmap_read_unlock(mm) as we would
                         * have already released it in __lock_page_or_retry
                         * in mm/filemap.c.
                         */
@@ -248,7 +247,7 @@ good_area:
                }
        }
 
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
        /*
         * keep track of tlb+htab misses that are good addrs but
@@ -259,7 +258,7 @@ good_area:
        return;
 
 bad_area:
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
        pte_errors++;
@@ -278,7 +277,7 @@ bad_area_nosemaphore:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
        if (!user_mode(regs))
                bad_page_fault(regs, address, SIGKILL);
        else
@@ -286,7 +285,7 @@ out_of_memory:
        return;
 
 do_sigbus:
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
        if (user_mode(regs)) {
                force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address);
                return;