From patchwork Thu Sep 20 06:03:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94D5A5A4 for ; Thu, 20 Sep 2018 06:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 829B22D252 for ; Thu, 20 Sep 2018 06:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8047D2D232; Thu, 20 Sep 2018 06:12:04 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham 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 5ABF52D26C for ; Thu, 20 Sep 2018 06:12:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8016A8E0009; Thu, 20 Sep 2018 02:12:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7B04A8E0001; Thu, 20 Sep 2018 02:12: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 6A01D8E0009; Thu, 20 Sep 2018 02:12:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 0DE398E0001 for ; Thu, 20 Sep 2018 02:12:02 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id p51-v6so3549644eda.18 for ; Wed, 19 Sep 2018 23:12:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=h6d90W+XgNg/arZ5XwNMwiatSTJFlInCaM8gEnEBAF4=; b=X55ABO2EbGT37gGUBy+lFLklhvkmvaSyvuznp6983X5Ukjgym+kBcEP/47JviUjmdl z1gGTEK+lNY9TbNfuJ1Lm6lcBH4C3kvVl2xaUc1ggMMDjrzNMKME7UxS/laM5+H7sMY4 IlWoAwHMrRwsaoP5Ga0dbU2fYsl+8cyywmclg3r/74FKEUun6kHsF4iJGma39LGM/LeK /TtymhzaGjt4wpCXLghk2fb3FKVYNhB+MWENQBEhdi24bLNrsIDK/jAndl+0fRer4iGs zWV9qdew9gV+wmYbDAQAVBYruI0kasjDgr9pQ66MQ7F/yT18mXJMJlufsJ59zBe3tyCO uqLg== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.194 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APzg51CKZZpuPGrlxeX77NPHqy1gbU29QilVab4jjuzPpZVjUE5Y/jat C/AH917gEnN0HDyXRjlscgKlteDzVe9rUS8QEMMVeq9w8Chuwo+JqGT4Ul+NSh6pg/zNLboroR+ C0tA6qZFMtuLBuSTQRb9NNSEhmXRNsEnDj07+9yRl+R+ZCNamKmMP5mMbmz5TG4k= X-Received: by 2002:a50:b5e6:: with SMTP id a93-v6mr2162519ede.94.1537423921501; Wed, 19 Sep 2018 23:12:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHypDNiEnpsv8/fbS6kxVcQFB1bxcHxyjO2XF7OYDz3MVfrv/gd6/kQLieZf9YKKL+O5Be X-Received: by 2002:a50:b5e6:: with SMTP id a93-v6mr2162402ede.94.1537423920173; Wed, 19 Sep 2018 23:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423920; cv=none; d=google.com; s=arc-20160816; b=e1NStM7A2t2xX0pY6iz+D8tfsboqm95TaSq+2H6+u2XFhEjVbPQJNRWxzWu/v+xtOk CriIyNs2ceXiQxkrTfdBWW1H9tPg7f0FVkOzy+QGXWHByARPLO7iUTBtDrkxo8KSQsnM Kp5cE0wMOYnXeXCSpZ4PKMlAcqriuI6YTEunSv+dFoG1EOG/l7qrrgJpuW7KQ+CvbXkC dZyBUcoalluiymZrATY8LEkOYFWtE1CK74rA6zGU9D+R+Gd/g4b7g/D3f8UTBAdZLFWP bRcHXvYD+ePQIb3c6PKoStgtZRUf8DhhCY3jPh/5trK0FpIkAAvlAV20nq6vf6CaEus7 fZkw== 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; bh=h6d90W+XgNg/arZ5XwNMwiatSTJFlInCaM8gEnEBAF4=; b=oaT/NoPVEokBR1w7Qwrk768gP8HqGtRDTeQaYojGw7ZvWjV25ccMMRo9pEZiTt7/dq Tdoo2/n8fm1o/3badRfim1O3vpBH7tl/5zzCXgS1D/8V5bBfhM9xdVxUl2Qj75Pgu8Hg jcU9HmLdl4uG0Y+230fvf1dh4DBM1Pmml0neqk9lFsc7T9glFIvlosYRa78BK3iQ16N5 a3/ze4URDs1gI7Tx0U1mVWwdVOnxN5pibAecoPPN8/NKsvdAxcg4kjyzAQg1z04y7AOj P+Wsa2sWwrQL0LJz9FdSRecsBXKA6HoPIJfblY5/Q5OG9djRxz+JxctnU0IquSLHkOyF hBVg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.194 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net. [217.70.183.194]) by mx.google.com with ESMTPS id i6-v6si1118988edf.73.2018.09.19.23.12.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:12:00 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.194 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.194; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.194 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Originating-IP: 79.86.19.127 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id EA94F40009; Thu, 20 Sep 2018 06:11:53 +0000 (UTC) From: Alexandre Ghiti To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, tony.luck@intel.com, fenghua.yu@intel.com, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, jejb@parisc-linux.org, deller@gmx.de, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, ysato@users.sourceforge.jp, dalias@libc.org, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Alexandre Ghiti Subject: [PATCH v7 07/11] hugetlb: Introduce generic version of huge_pte_wrprotect Date: Thu, 20 Sep 2018 06:03:54 +0000 Message-Id: <20180920060358.16606-8-alex@ghiti.fr> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180920060358.16606-1-alex@ghiti.fr> References: <20180920060358.16606-1-alex@ghiti.fr> 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 arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the same version of huge_pte_wrprotect, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti Tested-by: Helge Deller # parisc Acked-by: Catalin Marinas # arm64 Acked-by: Paul Burton # MIPS parts Acked-by: Ingo Molnar # x86 Reviewed-by: Luiz Capitulino Reviewed-by: Mike Kravetz --- arch/arm/include/asm/hugetlb.h | 5 ----- arch/arm64/include/asm/hugetlb.h | 5 ----- arch/ia64/include/asm/hugetlb.h | 5 ----- arch/mips/include/asm/hugetlb.h | 5 ----- arch/parisc/include/asm/hugetlb.h | 5 ----- arch/powerpc/include/asm/hugetlb.h | 5 ----- arch/sh/include/asm/hugetlb.h | 5 ----- arch/sparc/include/asm/hugetlb.h | 5 ----- arch/x86/include/asm/hugetlb.h | 5 ----- include/asm-generic/hugetlb.h | 7 +++++++ 10 files changed, 7 insertions(+), 45 deletions(-) diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h index c821b550d6a4..9ca14227eeb7 100644 --- a/arch/arm/include/asm/hugetlb.h +++ b/arch/arm/include/asm/hugetlb.h @@ -44,11 +44,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void arch_clear_hugepage_flags(struct page *page) { clear_bit(PG_dcache_clean, &page->flags); diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 49247c6f94db..1fd64ebf0cd7 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -42,11 +42,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void arch_clear_hugepage_flags(struct page *page) { clear_bit(PG_dcache_clean, &page->flags); diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index bf573500b3c4..82fe3d7a38d9 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -26,11 +26,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 1c9c4531376c..b3d6bb53ee6e 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -62,11 +62,6 @@ static inline int huge_pte_none(pte_t pte) return !val || (val == (unsigned long)invalid_pte_table); } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index c09d8c74553c..5a102d7251e4 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -38,11 +38,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 6a534353c8eb..b5b57b309564 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -149,11 +149,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, flush_hugetlb_page(vma, addr); } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, int dirty); diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index a9f8266f33cf..54f65094efe6 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -31,11 +31,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 11115bbd712e..f661362376e0 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -48,11 +48,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index 42d872054791..3cd3a2c9840e 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -28,11 +28,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline pte_t huge_pte_wrprotect(pte_t pte) -{ - return pte_wrprotect(pte); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 2fc3d68424e9..cd9697672b79 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -80,4 +80,11 @@ static inline int huge_pte_none(pte_t pte) } #endif +#ifndef __HAVE_ARCH_HUGE_PTE_WRPROTECT +static inline pte_t huge_pte_wrprotect(pte_t pte) +{ + return pte_wrprotect(pte); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */