From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E6E8C4360C for ; Thu, 26 Sep 2019 09:40:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E827C222D2 for ; Thu, 26 Sep 2019 09:40:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E827C222D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 99A5B6B026B; Thu, 26 Sep 2019 05:40:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94BF66B026C; Thu, 26 Sep 2019 05:40:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8124F6B026D; Thu, 26 Sep 2019 05:40:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 58A5F6B026B for ; Thu, 26 Sep 2019 05:40:53 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 110F12F269 for ; Thu, 26 Sep 2019 09:40:53 +0000 (UTC) X-FDA: 75976577586.03.cloth80_7c129800eb559 X-HE-Tag: cloth80_7c129800eb559 X-Filterd-Recvd-Size: 17224 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 09:40:52 +0000 (UTC) Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD8D78D0F8 for ; Thu, 26 Sep 2019 09:40:51 +0000 (UTC) Received: by mail-pg1-f200.google.com with SMTP id a31so1057328pgm.20 for ; Thu, 26 Sep 2019 02:40:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XP6gr3eQdJ6u+sy/NHvjIjEoZ5vslpS8bcX23tyuCE4=; b=W2w/2SSVB13+YGaN3xtek+YJI0toEqHt7Wj8pb57UtEwAvHvIBr/pGieG7f4cp5p/4 X3/CGSjohMm7Id+AJvFal0vnj/M4SYJVBP+Jdfk+Nvb9/mLKNdU9UH+McO4t0d5naGqE ply1EBJL5HMByN76BR7tMbcB+Aar4hlHgh6RyVJ+9UMnGL47XXav86abqRSF80wkSnvK S+BPp4LLQFYWex0RAJl1Zw8lkF6JaT0KWDh8dZf08s4XyIlVb6iE82mGuQi7G5U149Sd PINc+S9XNTsmZnis8ChvqbVUfu0CkR4GjntF9tFFWIWEzVmugp2ipqg2hGqEUrHrFlam BhYg== X-Gm-Message-State: APjAAAUfFmYi6Rk3Tf2z/sbYfAofENCYUHZnm0ro+lYuSxs3hx05v3tc jb8H0TWL4aD0yWTGoq8zc5JGRbf/epfq7O9U+FNyuY2ITlrNHuVF7yH69KLc3Y4s9QqW0oIP+mF 7+nZQGS7tbOQ= X-Received: by 2002:a17:90a:cb18:: with SMTP id z24mr2531940pjt.108.1569490850676; Thu, 26 Sep 2019 02:40:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7yR58nRgGu4SMpKi5ogu9u89i//blno2FCMu/YjHE1i9BEbFh647zHZqW2SOGSk22OQdVhg== X-Received: by 2002:a17:90a:cb18:: with SMTP id z24mr2531894pjt.108.1569490850207; Thu, 26 Sep 2019 02:40:50 -0700 (PDT) Received: from xz-x1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p68sm3224982pfp.9.2019.09.26.02.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 02:40:49 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Hugh Dickins , Maya Gokhale , Jerome Glisse , Pavel Emelyanov , Johannes Weiner , peterx@redhat.com, Martin Cracauer , Matthew Wilcox , Shaohua Li , Marty McFadden , Andrea Arcangeli , Mike Kravetz , Denis Plotnikov , Mike Rapoport , Linus Torvalds , Mel Gorman , "Kirill A . Shutemov" , "Dr . David Alan Gilbert" Subject: [PATCH v5 11/16] mm: Introduce FAULT_FLAG_DEFAULT Date: Thu, 26 Sep 2019 17:38:59 +0800 Message-Id: <20190926093904.5090-12-peterx@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190926093904.5090-1-peterx@redhat.com> References: <20190926093904.5090-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Although there're tons of arch-specific page fault handlers, most of them are still sharing the same initial value of the page fault flags. Say, merely all of the page fault handlers would allow the fault to be retried, and they also allow the fault to respond to SIGKILL. Let's define a default value for the fault flags to replace those initial page fault flags that were copied over. With this, it'll be far easier to introduce new fault flag that can be used by all the architectures instead of touching all the archs. Reviewed-by: David Hildenbrand Signed-off-by: Peter Xu --- arch/alpha/mm/fault.c | 2 +- arch/arc/mm/fault.c | 2 +- arch/arm/mm/fault.c | 2 +- arch/arm64/mm/fault.c | 2 +- arch/hexagon/mm/vm_fault.c | 2 +- arch/ia64/mm/fault.c | 2 +- arch/m68k/mm/fault.c | 2 +- arch/microblaze/mm/fault.c | 2 +- arch/mips/mm/fault.c | 2 +- arch/nds32/mm/fault.c | 2 +- arch/nios2/mm/fault.c | 2 +- arch/openrisc/mm/fault.c | 2 +- arch/parisc/mm/fault.c | 2 +- arch/powerpc/mm/fault.c | 2 +- arch/riscv/mm/fault.c | 2 +- arch/s390/mm/fault.c | 2 +- arch/sh/mm/fault.c | 2 +- arch/sparc/mm/fault_32.c | 2 +- arch/sparc/mm/fault_64.c | 2 +- arch/um/kernel/trap.c | 2 +- arch/unicore32/mm/fault.c | 2 +- arch/x86/mm/fault.c | 2 +- arch/xtensa/mm/fault.c | 2 +- include/linux/mm.h | 7 +++++++ 24 files changed, 30 insertions(+), 23 deletions(-) diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index aea33b599037..fcfa229cc1e7 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -89,7 +89,7 @@ do_page_fault(unsigned long address, unsigned long mmcs= r, const struct exception_table_entry *fixup; int si_code =3D SEGV_MAPERR; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 /* As of EV6, a load into $31/$f31 is a prefetch, and never faults (or is suppressed by the PALcode). Support that for older CPUs diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index ee3ba7c7b891..33a609f1c43c 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c @@ -94,7 +94,7 @@ void do_page_fault(unsigned long address, struct pt_reg= s *regs) (regs->ecr_cause =3D=3D ECR_C_PROTV_INST_FETCH)) exec =3D 1; =20 - flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + flags =3D FAULT_FLAG_DEFAULT; if (user_mode(regs)) flags |=3D FAULT_FLAG_USER; if (write) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index c8f2950fa733..101ae6698637 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -241,7 +241,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, s= truct pt_regs *regs) struct mm_struct *mm; int sig, code; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 if (kprobe_page_fault(regs, fsr)) return 0; diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 4a695a44fb05..23e3feca0f02 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -410,7 +410,7 @@ static int __kprobes do_page_fault(unsigned long addr= , unsigned int esr, struct mm_struct *mm =3D current->mm; vm_fault_t fault, major =3D 0; unsigned long vm_flags =3D VM_READ | VM_WRITE; - unsigned int mm_flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int mm_flags =3D FAULT_FLAG_DEFAULT; =20 if (kprobe_page_fault(regs, esr)) return 0; diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c index d19beaf11b4c..d9e15d941bdb 100644 --- a/arch/hexagon/mm/vm_fault.c +++ b/arch/hexagon/mm/vm_fault.c @@ -41,7 +41,7 @@ void do_page_fault(unsigned long address, long cause, s= truct pt_regs *regs) int si_code =3D SEGV_MAPERR; vm_fault_t fault; const struct exception_table_entry *fixup; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 /* * If we're in an interrupt or have no user context, diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 211b4f439384..b5aa4e80c762 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -65,7 +65,7 @@ ia64_do_page_fault (unsigned long address, unsigned lon= g isr, struct pt_regs *re struct mm_struct *mm =3D current->mm; unsigned long mask; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 mask =3D ((((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT) | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT)); diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index a455e202691b..182799fd9987 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -71,7 +71,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long a= ddress, struct mm_struct *mm =3D current->mm; struct vm_area_struct * vma; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 pr_debug("do page fault:\nregs->sr=3D%#x, regs->pc=3D%#lx, address=3D%#= lx, %ld, %p\n", regs->sr, regs->pc, address, error_code, mm ? mm->pgd : NULL); diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c index cdde01dcdfc3..32da02778a63 100644 --- a/arch/microblaze/mm/fault.c +++ b/arch/microblaze/mm/fault.c @@ -91,7 +91,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long = address, int code =3D SEGV_MAPERR; int is_write =3D error_code & ESR_S; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 regs->ear =3D address; regs->esr =3D error_code; diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 31fda59199eb..f811ef5efb80 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -44,7 +44,7 @@ static void __kprobes __do_page_fault(struct pt_regs *r= egs, unsigned long write, const int field =3D sizeof(unsigned long) * 2; int si_code; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10); =20 diff --git a/arch/nds32/mm/fault.c b/arch/nds32/mm/fault.c index c8f32b4784bd..4e402f2c88c3 100644 --- a/arch/nds32/mm/fault.c +++ b/arch/nds32/mm/fault.c @@ -76,7 +76,7 @@ void do_page_fault(unsigned long entry, unsigned long a= ddr, int si_code; vm_fault_t fault; unsigned int mask =3D VM_READ | VM_WRITE | VM_EXEC; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 error_code =3D error_code & (ITYPE_mskINST | ITYPE_mskETYPE); tsk =3D current; diff --git a/arch/nios2/mm/fault.c b/arch/nios2/mm/fault.c index 704ace8ca0ee..c38bea4220fb 100644 --- a/arch/nios2/mm/fault.c +++ b/arch/nios2/mm/fault.c @@ -47,7 +47,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, uns= igned long cause, struct mm_struct *mm =3D tsk->mm; int code =3D SEGV_MAPERR; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 cause >>=3D 2; =20 diff --git a/arch/openrisc/mm/fault.c b/arch/openrisc/mm/fault.c index 85c7eb0c0186..30d5c51e9d40 100644 --- a/arch/openrisc/mm/fault.c +++ b/arch/openrisc/mm/fault.c @@ -50,7 +50,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, uns= igned long address, struct vm_area_struct *vma; int si_code; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 tsk =3D current; =20 diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index f9be1d1cb43f..8e88e5c5f26a 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -274,7 +274,7 @@ void do_page_fault(struct pt_regs *regs, unsigned lon= g code, if (!mm) goto no_context; =20 - flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + flags =3D FAULT_FLAG_DEFAULT; if (user_mode(regs)) flags |=3D FAULT_FLAG_USER; =20 diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 7dabd1243f1b..db156537a2fa 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -435,7 +435,7 @@ static int __do_page_fault(struct pt_regs *regs, unsi= gned long address, { struct vm_area_struct * vma; struct mm_struct *mm =3D current->mm; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; int is_exec =3D TRAP(regs) =3D=3D 0x400; int is_user =3D user_mode(regs); int is_write =3D page_fault_is_write(error_code); diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index 48a60e128b3f..1f77dd2c491c 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -28,7 +28,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs) struct vm_area_struct *vma; struct mm_struct *mm; unsigned long addr, cause; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; int code =3D SEGV_MAPERR; vm_fault_t fault; =20 diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 179cf92a56e5..551ac311bd35 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -429,7 +429,7 @@ static inline vm_fault_t do_exception(struct pt_regs = *regs, int access) =20 address =3D trans_exc_code & __FAIL_ADDR_MASK; perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + flags =3D FAULT_FLAG_DEFAULT; if (user_mode(regs)) flags |=3D FAULT_FLAG_USER; if (access =3D=3D VM_WRITE || (trans_exc_code & store_indication) =3D=3D= 0x400) diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index eb4048ad0b38..d9c8f2d00a54 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -380,7 +380,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_reg= s *regs, struct mm_struct *mm; struct vm_area_struct * vma; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 tsk =3D current; mm =3D tsk->mm; diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 7a62edf7f68b..447f61c4e996 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c @@ -168,7 +168,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, = int text_fault, int write, int from_user =3D !(regs->psr & PSR_PS); int code; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 if (text_fault) address =3D regs->pc; diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c index d90bafb63e17..6807fba66331 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c @@ -267,7 +267,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_= regs *regs) int si_code, fault_code; vm_fault_t fault; unsigned long address, mm_rss; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 fault_code =3D get_thread_fault_code(); =20 diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index 58fe36856182..bc2756782d64 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c @@ -32,7 +32,7 @@ int handle_page_fault(unsigned long address, unsigned l= ong ip, pmd_t *pmd; pte_t *pte; int err =3D -EFAULT; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 *code_out =3D SEGV_MAPERR; =20 diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index 59d0e6ec2cfc..34a90453ca18 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c @@ -202,7 +202,7 @@ static int do_pf(unsigned long addr, unsigned int fsr= , struct pt_regs *regs) struct mm_struct *mm; int sig, code; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 tsk =3D current; mm =3D tsk->mm; diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 059331797827..d211585cfffd 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1287,7 +1287,7 @@ void do_user_addr_fault(struct pt_regs *regs, struct task_struct *tsk; struct mm_struct *mm; vm_fault_t fault, major =3D 0; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 tsk =3D current; mm =3D tsk->mm; diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 8651520de460..6467e3fb9762 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -43,7 +43,7 @@ void do_page_fault(struct pt_regs *regs) =20 int is_write, is_exec; vm_fault_t fault; - unsigned int flags =3D FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; + unsigned int flags =3D FAULT_FLAG_DEFAULT; =20 code =3D SEGV_MAPERR; =20 diff --git a/include/linux/mm.h b/include/linux/mm.h index 0334ca97c584..57fb5c535f8e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -393,6 +393,13 @@ extern pgprot_t protection_map[16]; #define FAULT_FLAG_REMOTE 0x80 /* faulting for non current tsk/mm */ #define FAULT_FLAG_INSTRUCTION 0x100 /* The fault was during an instruc= tion fetch */ =20 +/* + * The default fault flags that should be used by most of the + * arch-specific page fault handlers. + */ +#define FAULT_FLAG_DEFAULT (FAULT_FLAG_ALLOW_RETRY | \ + FAULT_FLAG_KILLABLE) + #define FAULT_FLAG_TRACE \ { FAULT_FLAG_WRITE, "WRITE" }, \ { FAULT_FLAG_MKWRITE, "MKWRITE" }, \ --=20 2.21.0