CEPH-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, devel@lists.orangefs.org,
	ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-mtd@lists.infradead.org, dri-devel@lists.freedesktop.org,
	lustre-devel@lists.lustre.org,
	linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org
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> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

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 <hch@lst.de>
---
 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)
-- 
2.17.0

  parent reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  5:43 vm_fault_t conversion, for real Christoph Hellwig
2018-05-16  5:43 ` [PATCH 01/14] orangefs: don't return errno values from ->fault Christoph Hellwig
2018-05-16 11:18   ` Matthew Wilcox
2018-05-16  5:43 ` [PATCH 02/14] fs: make the filemap_page_mkwrite prototype consistent Christoph Hellwig
2018-05-16  5:43 ` [PATCH 03/14] dax: make the dax_iomap_fault " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 04/14] mm: remove the unused device_private_entry_fault export Christoph Hellwig
2018-05-16  5:43 ` [PATCH 05/14] ceph: untangle ceph_filemap_fault Christoph Hellwig
2018-05-16  5:43 ` [PATCH 06/14] btrfs: separate errno from VM_FAULT_* values Christoph Hellwig
     [not found]   ` <20180516054348.15950-7-hch-jcswGhMUV9g@public.gmane.org>
2018-05-16 11:13     ` David Sterba
2018-05-16  5:43 ` [PATCH 07/14] ext4: " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 08/14] ocfs2: " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 09/14] ubifs: " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 10/14] vgem: " Christoph Hellwig
2018-05-16  9:53   ` Daniel Vetter
2018-05-16 13:01     ` Christoph Hellwig
2018-05-16 13:13       ` Matthew Wilcox
2018-05-16  5:43 ` [PATCH 11/14] ttm: " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 12/14] lustre: " Christoph Hellwig
2018-05-16  5:43 ` Christoph Hellwig [this message]
2018-05-16  5:43 ` [PATCH 14/14] mm: turn on vm_fault_t type checking Christoph Hellwig
2018-05-16 11:28   ` Matthew Wilcox
2018-05-16 13:03     ` Christoph Hellwig
2018-05-16 15:08   ` Darrick J. Wong
2018-05-16 17:34     ` Christoph Hellwig
2018-05-16 11:23 ` vm_fault_t conversion, for real Matthew Wilcox
2018-05-16 13:03   ` Christoph Hellwig
2018-05-16 13:22     ` Matthew Wilcox
2018-05-16 17:32       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180516054348.15950-14-hch@lst.de \
    --to=hch@lst.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=devel@lists.orangefs.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

CEPH-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/ceph-devel/0 ceph-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ceph-devel ceph-devel/ https://lore.kernel.org/ceph-devel \
		ceph-devel@vger.kernel.org
	public-inbox-index ceph-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.ceph-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git