From patchwork Wed May 16 05:43:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10402669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70501601D2 for ; Wed, 16 May 2018 05:45:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E28128733 for ; Wed, 16 May 2018 05:45:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C8328761; Wed, 16 May 2018 05:45:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB09628733 for ; Wed, 16 May 2018 05:45:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC4B86E32C; Wed, 16 May 2018 05:45:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2CCA6E2EF for ; Wed, 16 May 2018 05:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VGbjLoHXZIXle6JGDHpldaZpPb5Hn8l7Pq6ebApXQYg=; b=qVLWCKHsQId9rW4L41Ko7xPLp la1bQhb4lhQlPDyAOJbsCNen4Fah4AsrYmcT+r1+PvS/3BLjqfT8I8qy4n18bhJi16iMcErWAqcn5 +eyyRW2yUSpxowXGKPtetyxwU3v/ZqWBoXMPCzdEE30aoCqdL9jAJVJuPkJk64s30qEE0us/tXQMq sGDs6W0QNiY8Qe0ijYFdSQiHQcXEtowe0GLxTpSEqOtwoIHvrAQ388wXliPcDFrLVgWIDgKRk1Am2 mlyRPyKesxXzlCn18FlWJVX2iPMF8MavnCV8+09a2yHnfNw4h8dr9+8sk4qpZ1adGMKQsKZwR+6n1 SgMcjP+aw==; Received: from [93.83.86.253] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIpEr-0008Hf-33; Wed, 16 May 2018 05:44:37 +0000 From: Christoph Hellwig To: Souptick Joarder , Matthew Wilcox Subject: [PATCH 13/14] mm: move arch specific VM_FAULT_* flags to mm.h Date: Wed, 16 May 2018 07:43:47 +0200 Message-Id: <20180516054348.15950-14-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516054348.15950-1-hch@lst.de> References: <20180516054348.15950-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, lustre-devel@lists.lustre.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Various architectures define their own internal flags. Not sure a public header like mm.h is a good place, but keeping them inside the arch code with possible conflicts also seems like a bad idea. Maybe we just need to stop overloading the value instead. Signed-off-by: Christoph Hellwig --- arch/arm/mm/fault.c | 3 --- arch/arm64/mm/fault.c | 3 --- arch/s390/mm/fault.c | 6 ------ arch/unicore32/mm/fault.c | 3 --- include/linux/mm.h | 7 +++++++ 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 32034543f49c..b696eabccf60 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -201,9 +201,6 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) } #ifdef CONFIG_MMU -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 - /* * Check that the permissions on the VMA allow for the fault which occurred. * If we encountered a write fault, we must have write permission, otherwise diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 91c53a7d2575..3d0b1f8eacce 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -318,9 +318,6 @@ 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, unsigned int mm_flags, unsigned long vm_flags, struct task_struct *tsk) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index e074480d3598..48c781ae25d0 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -44,12 +44,6 @@ #define __SUBCODE_MASK 0x0600 #define __PF_RES_FIELD 0x8000000000000000ULL -#define VM_FAULT_BADCONTEXT 0x010000 -#define VM_FAULT_BADMAP 0x020000 -#define VM_FAULT_BADACCESS 0x040000 -#define VM_FAULT_SIGNAL 0x080000 -#define VM_FAULT_PFAULT 0x100000 - enum fault_type { KERNEL_FAULT, USER_FAULT, diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index 381473412937..6c3c1a82925f 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c @@ -148,9 +148,6 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) __do_kernel_fault(mm, addr, fsr, regs); } -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 - /* * Check that the permissions on the VMA allow for the fault which occurred. * If we encountered a write fault, we must have write permission, otherwise diff --git a/include/linux/mm.h b/include/linux/mm.h index 338b8a1afb02..64d09e3afc24 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1250,6 +1250,13 @@ static inline void clear_page_pfmemalloc(struct page *page) * and needs fsync() to complete (for * synchronous page faults in DAX) */ +/* Only for use in architecture specific page fault handling: */ +#define VM_FAULT_BADMAP 0x010000 +#define VM_FAULT_BADACCESS 0x020000 +#define VM_FAULT_BADCONTEXT 0x040000 +#define VM_FAULT_SIGNAL 0x080000 +#define VM_FAULT_PFAULT 0x100000 + #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE | \ VM_FAULT_FALLBACK)