From patchwork Mon Aug 6 17:57:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10557731 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 5C5D513BB for ; Mon, 6 Aug 2018 18:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46C0B29A2D for ; Mon, 6 Aug 2018 18:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AAC729A51; Mon, 6 Aug 2018 18:05:15 +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 8684929A2D for ; Mon, 6 Aug 2018 18:05:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B94BC6B0275; Mon, 6 Aug 2018 14:05:13 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B68866B0276; Mon, 6 Aug 2018 14:05:13 -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 A59726B0277; Mon, 6 Aug 2018 14:05:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id 499826B0275 for ; Mon, 6 Aug 2018 14:05:13 -0400 (EDT) Received: by mail-wr1-f69.google.com with SMTP id r1-v6so11207075wrp.11 for ; Mon, 06 Aug 2018 11:05:13 -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=U/T9sBG0lR0GtAx/QyZL3RSo9GfMQENQc/vw8zEUhE8=; b=uKANL7SwhGOm7RpfaEP+xFY6Q09IcmYfdAPCLahfjFogO4H5DGf/iN7zh3DzO8zrMF l9HIMWKXV8jEKAb2q2qqgE+wH93T8gQtI0m03GCylEPZK+usGb0SGBHy92urUxX714tw kQamcVA5atTiO/07PmL1gvaI7BEdTUov4oWiOrwgO4tnl4U9dZJ759/vHnIbulRp0l+x bfEWCffaksa/Aj9N13Zj7KgjPe/bMIYk+o+/3Zu39hWf6Oe+wXxLKjj5fKv1QbCxQSOJ UzwF8xF5tyKsyxw2c/637BfjvKhu7ptPazZTF7MRIOKZ2ln6YDUiApLJk96uBV6khYCN JOzA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.198 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: AOUpUlGnD5WH5dKP38ZZXs+6Qyqwt+P6Xh/5gpxeeZKyiSS2xQhkdk3C Iom6OCHmihBQ64j7jKcyhgytJR6dCoLe+W40GN245dIHjCqz7o0NvshvGNVxFoNDESsSZ9Dop4q 2ss8vbln7x13cEjcmkbJTf+/wS9hGmrLuDkZzsTaE0eEVouyWiNybrrpe63OzUFo= X-Received: by 2002:adf:a211:: with SMTP id p17-v6mr10420464wra.196.1533578712828; Mon, 06 Aug 2018 11:05:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeRpHfYI/4DJ987gTwPRoOSNMK1aJZIiokWvnBmHQfAQH27ozhr8qj9CeQnUyNS8MA0A37Y X-Received: by 2002:adf:a211:: with SMTP id p17-v6mr10420428wra.196.1533578711845; Mon, 06 Aug 2018 11:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533578711; cv=none; d=google.com; s=arc-20160816; b=dddXpoWX1hssFisT+vMosf9fVd+4OlCbVOyDJl+a9bp6pjnDIUUbvnssryjb1fwFJM FVR4tTDMUz1pLa+yMWdkyzdhEJ0qVruKWAR8c1JqM+xcqboKwVRjGuCzbFBdKyim5XyI GWfnMqjZ9ui7emvnTDXkLvGDVYGs7pga4Wiy4t6b22EPZYdhrZ6Cwep9tmILoc7D+IUk 7fz8FzOfdR0OIFoxSpQjKRaQLvY9NShVE8bV1zS775xOUIuVuhd2Ck474BYW8APhyg6x LchnZ/VrbK4GtJ7wG5zKERxNKjgXpEp7UQyC4XuTEKM0+B1haX0mAs56nkKJOj76INQb qgjw== 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 :arc-authentication-results; bh=U/T9sBG0lR0GtAx/QyZL3RSo9GfMQENQc/vw8zEUhE8=; b=F0MRvXzEpRo8bcjCjP52aXFy0I+WkwR1KgDhB4WWl2qqW8TIHIt9jlPeuRFCYbOAg+ /Sisi7GVCVE6GjIw4CA8+pH43F2np6CV8x0oDJsZGnr2JE4TrQYlVkSFJX2veiimbhzW DyXiFtTn9zed9qTORIMQHhRkrJ67sUfzP0yCGWG0nxsLj2jxWfW8921PpzzXdnudq0dz 0OwsB5Oigif1oEX1D1MBDU8dOWh1PidaLi8qJ2S/72NGrlJbev3my81Nq4heJiZBoKIB LLqlLCQo2N0IZGGQamnwsfmGLYNJK6fbMCIWDrrhBwfuF2uFqW3d842NIveGGHcUzsDW lFBw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.198 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net. [217.70.183.198]) by mx.google.com with ESMTPS id q3-v6si5285905wmf.230.2018.08.06.11.05.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Aug 2018 11:05:11 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.198 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.198; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.198 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 relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 3754DC0003; Mon, 6 Aug 2018 18:05:05 +0000 (UTC) From: Alexandre Ghiti To: 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 Cc: Alexandre Ghiti Subject: [PATCH v6 07/11] hugetlb: Introduce generic version of huge_pte_wrprotect Date: Mon, 6 Aug 2018 17:57:07 +0000 Message-Id: <20180806175711.24438-8-alex@ghiti.fr> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180806175711.24438-1-alex@ghiti.fr> References: <20180806175711.24438-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 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 3562d46585ba..7123599089c6 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -152,11 +152,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 */