]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mm: convert return type of handle_mm_fault() caller to vm_fault_t
authorSouptick Joarder <jrdr.linux@gmail.com>
Fri, 17 Aug 2018 22:44:47 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Aug 2018 23:20:28 +0000 (16:20 -0700)
Use new return type vm_fault_t for fault handler.  For now, this is just
documenting that the function returns a VM_FAULT value rather than an
errno.  Once all instances are converted, vm_fault_t will become a
distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

In this patch all the caller of handle_mm_fault() are changed to return
vm_fault_t type.

Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PC
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: James Hogan <jhogan@kernel.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: James E.J. Bottomley <jejb@parisc-linux.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: David S. Miller <davem@davemloft.net>
Cc: Richard Weinberger <richard@nod.at>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
32 files changed:
arch/alpha/mm/fault.c
arch/arc/mm/fault.c
arch/arm/mm/fault.c
arch/arm64/mm/fault.c
arch/hexagon/mm/vm_fault.c
arch/ia64/mm/fault.c
arch/m68k/mm/fault.c
arch/microblaze/mm/fault.c
arch/mips/mm/fault.c
arch/nds32/mm/fault.c
arch/nios2/mm/fault.c
arch/openrisc/mm/fault.c
arch/parisc/mm/fault.c
arch/powerpc/include/asm/copro.h
arch/powerpc/mm/copro_fault.c
arch/powerpc/mm/fault.c
arch/powerpc/platforms/cell/spufs/fault.c
arch/riscv/mm/fault.c
arch/s390/mm/fault.c
arch/sh/mm/fault.c
arch/sparc/mm/fault_32.c
arch/sparc/mm/fault_64.c
arch/um/kernel/trap.c
arch/unicore32/mm/fault.c
arch/x86/mm/fault.c
arch/xtensa/mm/fault.c
drivers/iommu/amd_iommu_v2.c
drivers/iommu/intel-svm.c
drivers/misc/cxl/fault.c
drivers/misc/ocxl/link.c
mm/hmm.c
mm/ksm.c

index de2bd217adad110842122cb1610c1c76209a1745..d73dc473fbb9432f61d6f1383224a6aff1f67249 100644 (file)
@@ -87,7 +87,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
        struct vm_area_struct * vma;
        struct mm_struct *mm = current->mm;
        const struct exception_table_entry *fixup;
-       int fault, si_code = SEGV_MAPERR;
+       int si_code = SEGV_MAPERR;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        /* As of EV6, a load into $31/$f31 is a prefetch, and never faults
index b884bbd6f354ad6e01c3253bc44b6f7eb72f4765..db6913094be3c9b2bc9ad87e91f7aab779da728d 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/uaccess.h>
 #include <linux/kdebug.h>
 #include <linux/perf_event.h>
+#include <linux/mm_types.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu.h>
 
@@ -66,7 +67,8 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
        siginfo_t info;
-       int fault, ret;
+       int ret;
+       vm_fault_t fault;
        int write = regs->ecr_cause & ECR_C_PROTV_STORE;  /* ST/EX */
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
index 84becc911ee3347df1e43feae344d52eda425fef..3232afb6fdc00be7da29c521068d3ba08e08e500 100644 (file)
@@ -224,12 +224,12 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
        return vma->vm_flags & mask ? false : true;
 }
 
-static int __kprobes
+static vm_fault_t __kprobes
 __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
                unsigned int flags, struct task_struct *tsk)
 {
        struct vm_area_struct *vma;
-       int fault;
+       vm_fault_t fault;
 
        vma = find_vma(mm, addr);
        fault = VM_FAULT_BADMAP;
@@ -264,7 +264,8 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 {
        struct task_struct *tsk;
        struct mm_struct *mm;
-       int fault, sig, code;
+       int sig, code;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        if (notify_page_fault(regs, fsr))
index 9943690a39242cc870bdeb1659c746f826dd483c..50b30ff30de4b45b35f97252d2c0a6b8aa9dd749 100644 (file)
@@ -379,12 +379,12 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
 #define VM_FAULT_BADMAP                0x010000
 #define VM_FAULT_BADACCESS     0x020000
 
-static int __do_page_fault(struct mm_struct *mm, unsigned long addr,
+static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,
                           unsigned int mm_flags, unsigned long vm_flags,
                           struct task_struct *tsk)
 {
        struct vm_area_struct *vma;
-       int fault;
+       vm_fault_t fault;
 
        vma = find_vma(mm, addr);
        fault = VM_FAULT_BADMAP;
@@ -427,7 +427,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
        struct task_struct *tsk;
        struct mm_struct *mm;
        struct siginfo si;
-       int fault, major = 0;
+       vm_fault_t fault, major = 0;
        unsigned long vm_flags = VM_READ | VM_WRITE;
        unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
index 933bbcef5363c736b66eee9bad7d96a4f924bc1b..eb263e61daf40d5e238e63ef1432d2460d4ec5aa 100644 (file)
@@ -52,7 +52,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
        struct mm_struct *mm = current->mm;
        int si_signo;
        int si_code = SEGV_MAPERR;
-       int fault;
+       vm_fault_t fault;
        const struct exception_table_entry *fixup;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
index 817fa120645f1166f39e19fcf871bb98b102d72d..a9d55ad8d67be8e1bb4ef0c0010cda5742637a43 100644 (file)
@@ -86,7 +86,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
        struct vm_area_struct *vma, *prev_vma;
        struct mm_struct *mm = current->mm;
        unsigned long mask;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        mask = ((((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
index f2ff3779875aedf533ddc262f521e33e82b2ced8..9b6163c05a754f8d86e6508eba4fd77483f71892 100644 (file)
@@ -70,7 +70,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
 {
        struct mm_struct *mm = current->mm;
        struct vm_area_struct * vma;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        pr_debug("do page fault:\nregs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
@@ -136,7 +136,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
         */
 
        fault = handle_mm_fault(vma, address, flags);
-       pr_debug("handle_mm_fault returns %d\n", fault);
+       pr_debug("handle_mm_fault returns %x\n", fault);
 
        if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
                return 0;
index af607447c68302af99aee6ccbbb1ec3d6d19785a..202ad6a494f595cf9185b12a9aadd887c9bdab96 100644 (file)
@@ -90,7 +90,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
        struct mm_struct *mm = current->mm;
        int code = SEGV_MAPERR;
        int is_write = error_code & ESR_S;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        regs->ear = address;
index 5f71f2b903b7ebed307cbd8b8f06c3135a97c3d2..73d8a0f0b810c669d7d541704ab417a386e2cb74 100644 (file)
@@ -43,7 +43,7 @@ static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write,
        struct mm_struct *mm = tsk->mm;
        const int field = sizeof(unsigned long) * 2;
        int si_code;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
index 9bdb7c3ecbb6c4f24b1ede1d00c09270329bb47e..b740534b152c1dbf340d11db9dd1650e4228a11c 100644 (file)
@@ -73,7 +73,7 @@ void do_page_fault(unsigned long entry, unsigned long addr,
        struct mm_struct *mm;
        struct vm_area_struct *vma;
        int si_code;
-       int fault;
+       vm_fault_t fault;
        unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
index b804dd06ea1cecca880f7a3b85846a168de2e926..24fd84cf6006cf2a7ac285152918db0668af69da 100644 (file)
@@ -47,7 +47,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause,
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
        int code = SEGV_MAPERR;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        cause >>= 2;
index 9f011d16cc46a868f2ac16549a56f1a7c1aabd8f..dc4dbafc1d83254066687dce319aaf3b16c2d752 100644 (file)
@@ -53,7 +53,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
        struct mm_struct *mm;
        struct vm_area_struct *vma;
        int si_code;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        tsk = current;
index a80117980fc2ffe31d4644ce620c5f02e4dfc79e..c8e8b7c0555837144d3427daaf395b6317d06aa6 100644 (file)
@@ -262,7 +262,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
        struct task_struct *tsk;
        struct mm_struct *mm;
        unsigned long acc_type;
-       int fault = 0;
+       vm_fault_t fault = 0;
        unsigned int flags;
 
        if (faulthandler_disabled())
index ce216df313812606eeadb335728cf86cad086d12..48616fe7ea752279e8d054fcbc1e70bc053c9ce7 100644 (file)
 #ifndef _ASM_POWERPC_COPRO_H
 #define _ASM_POWERPC_COPRO_H
 
+#include <linux/mm_types.h>
+
 struct copro_slb
 {
        u64 esid, vsid;
 };
 
 int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
-                         unsigned long dsisr, unsigned *flt);
+                         unsigned long dsisr, vm_fault_t *flt);
 
 int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb);
 
index 7d0945bd3a61b6630b8e1958f36bd769b27eca8d..c8da352e8686c4ebfba1299ce8d2c69e1b05386f 100644 (file)
@@ -34,7 +34,7 @@
  * to handle fortunately.
  */
 int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
-               unsigned long dsisr, unsigned *flt)
+               unsigned long dsisr, vm_fault_t *flt)
 {
        struct vm_area_struct *vma;
        unsigned long is_write;
index b1ca7a0974e301e9c9697d791c7a23559a87b912..7c061313cc6faba08548938adeb7dc510f5b39ca 100644 (file)
@@ -156,7 +156,7 @@ static noinline int bad_access(struct pt_regs *regs, unsigned long address)
 }
 
 static int do_sigbus(struct pt_regs *regs, unsigned long address,
-                    unsigned int fault)
+                    vm_fault_t fault)
 {
        siginfo_t info;
        unsigned int lsb = 0;
@@ -187,7 +187,8 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
        return 0;
 }
 
-static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
+static int mm_fault_error(struct pt_regs *regs, unsigned long addr,
+                               vm_fault_t fault)
 {
        /*
         * Kernel page fault interrupted by SIGKILL. We have no reason to
@@ -415,7 +416,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
        int is_exec = TRAP(regs) == 0x400;
        int is_user = user_mode(regs);
        int is_write = page_fault_is_write(error_code);
-       int fault, major = 0;
+       vm_fault_t fault, major = 0;
        bool must_retry = false;
 
        if (notify_page_fault(regs))
index 1e002e94d0f6121100839c3e0cd5536bee92eac5..83cf58daaa7970fd0415b21af558eb3845d706db 100644 (file)
@@ -111,7 +111,7 @@ int spufs_handle_class1(struct spu_context *ctx)
 {
        u64 ea, dsisr, access;
        unsigned long flags;
-       unsigned flt = 0;
+       vm_fault_t flt = 0;
        int ret;
 
        /*
index 148c98ca9b45ccf729ed5aa4ed067ecf1b8bb2d4..88401d5125bcc0b354833eb5205b7b995f033752 100644 (file)
@@ -41,7 +41,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
        struct mm_struct *mm;
        unsigned long addr, cause;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
-       int fault, code = SEGV_MAPERR;
+       int code = SEGV_MAPERR;
+       vm_fault_t fault;
 
        cause = regs->scause;
        addr = regs->sbadaddr;
index 4cc3f06b0ab3356c78349f8a2497811eb2af174c..72af23bacbb586ee87dce086fac2e28dd85bc7ec 100644 (file)
@@ -341,7 +341,8 @@ static noinline int signal_return(struct pt_regs *regs)
        return -EACCES;
 }
 
-static noinline void do_fault_error(struct pt_regs *regs, int access, int fault)
+static noinline void do_fault_error(struct pt_regs *regs, int access,
+                                       vm_fault_t fault)
 {
        int si_code;
 
@@ -401,7 +402,7 @@ static noinline void do_fault_error(struct pt_regs *regs, int access, int fault)
  *   11       Page translation     ->  Not present       (nullification)
  *   3b       Region third trans.  ->  Not present       (nullification)
  */
-static inline int do_exception(struct pt_regs *regs, int access)
+static inline vm_fault_t do_exception(struct pt_regs *regs, int access)
 {
        struct gmap *gmap;
        struct task_struct *tsk;
@@ -411,7 +412,7 @@ static inline int do_exception(struct pt_regs *regs, int access)
        unsigned long trans_exc_code;
        unsigned long address;
        unsigned int flags;
-       int fault;
+       vm_fault_t fault;
 
        tsk = current;
        /*
@@ -564,7 +565,8 @@ static inline int do_exception(struct pt_regs *regs, int access)
 void do_protection_exception(struct pt_regs *regs)
 {
        unsigned long trans_exc_code;
-       int access, fault;
+       int access;
+       vm_fault_t fault;
 
        trans_exc_code = regs->int_parm_long;
        /*
@@ -599,7 +601,8 @@ NOKPROBE_SYMBOL(do_protection_exception);
 
 void do_dat_exception(struct pt_regs *regs)
 {
-       int access, fault;
+       int access;
+       vm_fault_t fault;
 
        access = VM_READ | VM_EXEC | VM_WRITE;
        fault = do_exception(regs, access);
index b8e7bb84b6b1cc35b54921af5fe4156e71f41ef7..6defd2c6d9b1d95698670cbd65e7426de56b5c15 100644 (file)
@@ -313,7 +313,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
 
 static noinline int
 mm_fault_error(struct pt_regs *regs, unsigned long error_code,
-              unsigned long address, unsigned int fault)
+              unsigned long address, vm_fault_t fault)
 {
        /*
         * Pagefault was interrupted by SIGKILL. We have no reason to
@@ -396,7 +396,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        struct task_struct *tsk;
        struct mm_struct *mm;
        struct vm_area_struct * vma;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        tsk = current;
index 9f75b6444bf12fa0149d22fa3ea63c4e6d233a9c..b0440b0edd97b4af739c6aa53d49402bc8de2656 100644 (file)
@@ -166,7 +166,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
        unsigned int fixup;
        unsigned long g2;
        int from_user = !(regs->psr & PSR_PS);
-       int fault, code;
+       int code;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        if (text_fault)
index 63166fcf9e25f8701e2d2a977326e3b4ca05fb93..8f8a604c130023fb238408cedbb3f5a2a30c0a26 100644 (file)
@@ -278,7 +278,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
        unsigned int insn = 0;
-       int si_code, fault_code, fault;
+       int si_code, fault_code;
+       vm_fault_t fault;
        unsigned long address, mm_rss;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
index ec9a42c14c56596777a0f5d78a9d48c60ace3ac0..cced829460427180091b494e7eb2c9315dd66d73 100644 (file)
@@ -72,7 +72,7 @@ int handle_page_fault(unsigned long address, unsigned long ip,
        }
 
        do {
-               int fault;
+               vm_fault_t fault;
 
                fault = handle_mm_fault(vma, address, flags);
 
index 3814734129378eda8edf49148e83df9a5da81c9b..8f12a5b50a42bffaa14efa03c04c8f6f67f8b1b1 100644 (file)
@@ -168,11 +168,11 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
        return vma->vm_flags & mask ? false : true;
 }
 
-static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
-               unsigned int flags, struct task_struct *tsk)
+static vm_fault_t __do_pf(struct mm_struct *mm, unsigned long addr,
+               unsigned int fsr, unsigned int flags, struct task_struct *tsk)
 {
        struct vm_area_struct *vma;
-       int fault;
+       vm_fault_t fault;
 
        vma = find_vma(mm, addr);
        fault = VM_FAULT_BADMAP;
@@ -209,7 +209,8 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 {
        struct task_struct *tsk;
        struct mm_struct *mm;
-       int fault, sig, code;
+       int sig, code;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        tsk = current;
index db1c042e9853c142b9ebf7e67337ce875b20bb40..b9123c497e0a7b20e25aa6608622118e6a00e3ea 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/prefetch.h>            /* prefetchw                    */
 #include <linux/context_tracking.h>    /* exception_enter(), ...       */
 #include <linux/uaccess.h>             /* faulthandler_disabled()      */
+#include <linux/mm_types.h>
 
 #include <asm/cpufeature.h>            /* boot_cpu_has, ...            */
 #include <asm/traps.h>                 /* dotraplinkage, ...           */
@@ -999,7 +1000,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
 
 static noinline void
 mm_fault_error(struct pt_regs *regs, unsigned long error_code,
-              unsigned long address, u32 *pkey, unsigned int fault)
+              unsigned long address, u32 *pkey, vm_fault_t fault)
 {
        if (fatal_signal_pending(current) && !(error_code & X86_PF_USER)) {
                no_context(regs, error_code, address, 0, 0);
@@ -1213,7 +1214,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
        struct vm_area_struct *vma;
        struct task_struct *tsk;
        struct mm_struct *mm;
-       int fault, major = 0;
+       vm_fault_t fault, major = 0;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
        u32 pkey;
 
index c111a833205ad8e7cf8dd04b6cf24adf6e93d687..2ab0e0dcd1668bce6fb9ea6f9035d99d13458ed3 100644 (file)
@@ -42,7 +42,7 @@ void do_page_fault(struct pt_regs *regs)
        int code;
 
        int is_write, is_exec;
-       int fault;
+       vm_fault_t fault;
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
        code = SEGV_MAPERR;
index 1d0b53a04a086cf14842a69d511dbda4f3627023..58da65df03f5e2551352c9d99c42a794d036b8e5 100644 (file)
@@ -508,7 +508,7 @@ static void do_fault(struct work_struct *work)
 {
        struct fault *fault = container_of(work, struct fault, work);
        struct vm_area_struct *vma;
-       int ret = VM_FAULT_ERROR;
+       vm_fault_t ret = VM_FAULT_ERROR;
        unsigned int flags = 0;
        struct mm_struct *mm;
        u64 address;
index 45f6e581cd56f63026f50ffed1c2e815f76deff8..7d65aab36a9695e7f4ef932a8d3530f83acd2e08 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/pci-ats.h>
 #include <linux/dmar.h>
 #include <linux/interrupt.h>
+#include <linux/mm_types.h>
 #include <asm/page.h>
 
 #define PASID_ENTRY_P          BIT_ULL(0)
@@ -594,7 +595,8 @@ static irqreturn_t prq_event_thread(int irq, void *d)
                struct vm_area_struct *vma;
                struct page_req_dsc *req;
                struct qi_desc resp;
-               int ret, result;
+               int result;
+               vm_fault_t ret;
                u64 address;
 
                handled = 1;
index 70dbb6de102ce90253857e0430d2bb0a60169215..93ecc67a0f3b27077548d0f02e31b4fd6c377c5b 100644 (file)
@@ -134,7 +134,7 @@ static int cxl_handle_segment_miss(struct cxl_context *ctx,
 
 int cxl_handle_mm_fault(struct mm_struct *mm, u64 dsisr, u64 dar)
 {
-       unsigned flt = 0;
+       vm_fault_t flt = 0;
        int result;
        unsigned long access, flags, inv_flags = 0;
 
index 88876ae8f33004b4dce970e31fce773958d48b25..ffc731b0731ac1cbd3db7f7b310a636904bce8ec 100644 (file)
@@ -2,6 +2,7 @@
 // Copyright 2017 IBM Corp.
 #include <linux/sched/mm.h>
 #include <linux/mutex.h>
+#include <linux/mm_types.h>
 #include <linux/mmu_context.h>
 #include <asm/copro.h>
 #include <asm/pnv-ocxl.h>
@@ -126,7 +127,7 @@ static void ack_irq(struct spa *spa, enum xsl_response r)
 
 static void xsl_fault_handler_bh(struct work_struct *fault_work)
 {
-       unsigned int flt = 0;
+       vm_fault_t flt = 0;
        unsigned long access, flags, inv_flags = 0;
        enum xsl_response r;
        struct xsl_fault *fault = container_of(fault_work, struct xsl_fault,
index f40e8add84b5ed186a5f5028fbb9140ed1ee4138..caf9df27599e79f7d21fea0615a4d7a754e7081c 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -299,14 +299,14 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr,
        struct hmm_vma_walk *hmm_vma_walk = walk->private;
        struct hmm_range *range = hmm_vma_walk->range;
        struct vm_area_struct *vma = walk->vma;
-       int r;
+       vm_fault_t ret;
 
        flags |= hmm_vma_walk->block ? 0 : FAULT_FLAG_ALLOW_RETRY;
        flags |= write_fault ? FAULT_FLAG_WRITE : 0;
-       r = handle_mm_fault(vma, addr, flags);
-       if (r & VM_FAULT_RETRY)
+       ret = handle_mm_fault(vma, addr, flags);
+       if (ret & VM_FAULT_RETRY)
                return -EBUSY;
-       if (r & VM_FAULT_ERROR) {
+       if (ret & VM_FAULT_ERROR) {
                *pfn = range->values[HMM_PFN_ERROR];
                return -EFAULT;
        }
index 9b855a8b0f2d8770a27c6e38cdc7f9cdcbeac36d..2621be57bd957caabd5df559d41f2c40e284a26d 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -470,7 +470,7 @@ static inline bool ksm_test_exit(struct mm_struct *mm)
 static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
 {
        struct page *page;
-       int ret = 0;
+       vm_fault_t ret = 0;
 
        do {
                cond_resched();