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: 10402659 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 E564A601F9 for ; Wed, 16 May 2018 05:45:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5BE328733 for ; Wed, 16 May 2018 05:45:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C91A528761; Wed, 16 May 2018 05:45:14 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 539B728733 for ; Wed, 16 May 2018 05:45:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 255F06B02FA; Wed, 16 May 2018 01:45:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1E37E6B02FB; Wed, 16 May 2018 01:45:02 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F26726B02FC; Wed, 16 May 2018 01:45:01 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 9F2A56B02FB for ; Wed, 16 May 2018 01:45:01 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id q7-v6so1311983pgt.11 for ; Tue, 15 May 2018 22:45:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=VGbjLoHXZIXle6JGDHpldaZpPb5Hn8l7Pq6ebApXQYg=; b=KfH2VNK4Dovb3tpptPUKBfZnX8Lsm1ZI91y3vvLUPX2kfKNeB2FXMZWIHJc8ufzQCf Zhn+3tqHaqWSSJFl5Ehd+pqdijab1th3FlCSYlULYPlWcvPQ76hX50r9HAZ22BovyD9k veNZgkZCThBbxzqvbKrNavDeMWDek8aXosZQR3IA4DJyAe2uPm6T9ugPk6aPUPMR+R1/ JKyJLR+pBx2pqTIxmIu529MpZEsF8Ergp6QySAeMRcakQeew15XIy+l9z/D6zMCi59dw ufb2nqlbOS+3tbMi/gRhoxQGCwqH+Ji4eTMxBrRZZ1t8dIy/Pl/7TrfpPCrFLnZhUWK/ Bj5g== X-Gm-Message-State: ALKqPwekZBhy0z3h91QoI6F07MwaFi/MJLuOpG2WR1Z8K1z3QLDe7wIf 8l5ddaIbVTf5SOcAdLkvg/PrrE8qQCa5TEuMMQzQ5VHzPWotN5UDCeXGRPHIYSVkPm3Qugpga2C bp6JlWmac24fA2q+ESobve/we5CkxNVztLaDpJOuPTVrTQgptbp0A/jhzQ4+2rI8= X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr12260618plm.123.1526449501327; Tue, 15 May 2018 22:45:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+s6KyVC5nah3N12UNzEslv6NBcVPbTRUlFuk/TQY1fceI8ICKw09+A23O1adLgfEetHnD X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr12260586plm.123.1526449500608; Tue, 15 May 2018 22:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526449500; cv=none; d=google.com; s=arc-20160816; b=i3OdtYPN9sT4yiHwd43Q+y9tcWQugeeJzEk0slk6O6tW4Ym6bY9L9O0oc9QE7cOqhH r4scpFIcS0fbskaFKn+iP/6r9sOhAvRzdx0JJjBUUOzLhD1jDcBgOEPFfkREe3JHahWR eytxapq1nR1GIQ23D0SxYQIUBd6krWllL2yKKOf3Tqhd53DJuJJ1T/MzXIIsFiLRqmvw BiIPID68plCezPMLm4KfdWMzyfyzwm6ZSxNWPY7nLJaDahLFtUQAizMteuKxSPTVWE+r O3Lu8bDiigmoN7wRYGgOMGGgMP8lK2J4d8j9KkEC4DKSzho3er58sIDXDLFsVdyKRIaa gqzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VGbjLoHXZIXle6JGDHpldaZpPb5Hn8l7Pq6ebApXQYg=; b=Oq/Zz/T7VlFJzfy2313e6u3Zutq61JdHakS2dA5DN7fVQDPpPsLTZQcEU+73rnhCJK LRLmlL44ShwyLPoTW3aBz0rdrTr5cG3Woha8ckS18am/wYcpqsvL/kJFMLXGBIgm4o4O TC9tOIBcocoqO+T540QAGIHM82VOplxJKAAMAgkpDppYOyKpEIGwmksUDZ8fjJnMd4B4 HgZTSseC+VMSYi5KFDeh3aXdxVKlOfU+cmH4VmAbtn96F4m6lw0ICNh4N2JDAHaUWySm tUejQ1CCCA9Kjlo9GYqulxEnbpX+FSmYeQxvkl+QZuKCs1TD9kU6hzB5NpbSyBKA5VkO hp1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=qVLWCKHs; spf=pass (google.com: best guess record for domain of batv+8c5add14d4fec8f33fc9+5379+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+8c5add14d4fec8f33fc9+5379+infradead.org+hch@bombadil.srs.infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id d25-v6si1830681plj.344.2018.05.15.22.45.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 22:45:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+8c5add14d4fec8f33fc9+5379+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=qVLWCKHs; spf=pass (google.com: best guess record for domain of batv+8c5add14d4fec8f33fc9+5379+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+8c5add14d4fec8f33fc9+5379+infradead.org+hch@bombadil.srs.infradead.org 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 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> 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-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: 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)