From patchwork Thu Sep 20 06:03:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606881 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 86F381508 for ; Thu, 20 Sep 2018 06:05:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 748082BC46 for ; Thu, 20 Sep 2018 06:05:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67D6D2D1F9; Thu, 20 Sep 2018 06:05:23 +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 9D53E2BC46 for ; Thu, 20 Sep 2018 06:05:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB0F98E0003; Thu, 20 Sep 2018 02:05:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B379A8E0001; Thu, 20 Sep 2018 02:05:21 -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 A0C508E0003; Thu, 20 Sep 2018 02:05:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 3F8DB8E0001 for ; Thu, 20 Sep 2018 02:05:21 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id g18-v6so3666560edg.14 for ; Wed, 19 Sep 2018 23:05:21 -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=s7A7T+L1VS756FapPZbdAia5omZaBGV2Vsarr+SMg7U=; b=b3RRLu3UtZI9TvWG1bER3yEUmNb4FuItFGiW0drO9n6hQzfbeVLpDFutMsJdjnpqdX zp+ZDPuN1d4n+LtGYwcWaSDe2mwvm5ezvk6WqtguWAUhWx1hbuA5KL88MuW50bD224bs rXbeClUd9BGc/E3eQtde5llCTuurEQNpxqFGtSiMrZhPlfp9SpGG07a2eDlunC+DF36a XgIt0Zk4HPC9QEyhMXBzrxHRvLtiGXLAvIkgkzIe13wOq1azdAFU2yFqafnZIoj9aWwb 5BiZBR19ieo55NM5u00oyjcDcpPHeX0nNY4JB/eu3UliMbdiWONrkNZyNSr7EQBKLDVC z7Qw== 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: APzg51DxvT7BZeNjH4CyDKpHF6ZsTe2qZCr3q/6UrjLXTul5R74kvVF7 ghKI+IQ4NdiK/Mj0AroLdWWtwP/eE+VIfDDDIYoussf1WwiwkPwVlgUWqgkLGmOJniqBUlmywGw /na1yS3ZJPIT9TewX0OqJLz23sCJGUjeb0cfkxPFiD2OUvTI2zEBOqbb4k6cF31M= X-Received: by 2002:a50:c181:: with SMTP id m1-v6mr2092991edf.199.1537423520693; Wed, 19 Sep 2018 23:05:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJoMxCfx1Tutur7pKWbOs/OPC60iqX2dgS6g873UOdAhM+OMijmkOeJNt764qKbCLPMfdB X-Received: by 2002:a50:c181:: with SMTP id m1-v6mr2092885edf.199.1537423519646; Wed, 19 Sep 2018 23:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423519; cv=none; d=google.com; s=arc-20160816; b=CWtkJfJE7oa2+6mEu3+FRC4dAuwzl3akV+E5LGt4uFFxc1qehxq2RaCYXowUUE57Bs TopoNGeiZ4bBx9IKpRtdyf6EVV4HA2yHJx2PoCP/OcUhf7N8cLW4zwwGzP1xsjZjWeFY LtL4XQGH0EvhBoRrdvt6XRp1COUvEPRRhNe8QsJsqIh6enss8EoSS0jkUdehBbozfEC3 Ltk5e4rk7EHZbqAvTA2qI+vU0ppMK+67wQaFNFrO9WruZcAKKtZXl+7LL3IlBqU/Mlxx EwaNctktOAhyG6M+qELHYYSLHCPYz87vdy+6JOJKqvwj+MlKvvhNzh9V8PgtQtI7BJmN fTtQ== 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=s7A7T+L1VS756FapPZbdAia5omZaBGV2Vsarr+SMg7U=; b=b5c7oA+4d5Y4efr2vqstV7lny3AwxxNrWWJ0OZHcb4/Va6l5rmQwztI8QfuuQCNGxq oXU+2pWYfx8rFHQOqG6nUTCGIOTLRYx9Nf69XfZQHeuQ9seRe9hbIrUfj8+z21DQsjjI sDv23X9ZVJPs+95y3UFlAxBV0AwAQUxE79xMcomW6y8HZecKODUjuCxuCBl/RHr2ohzx BIRVBAh7Uo+FOLHKaV88WUFDALFMPVVaUx16jiyLFF/wigVBjaPtfZNP1FolwDAbXnT/ czAwM+nZwKiasriUPUk8+pPNEyqlC1JYKMPKHii8lMQwT4zZ92DK82qIXUfkde64Uim1 lAtg== 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 v24-v6si1117252edq.63.2018.09.19.23.05.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:05:19 -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 E499440009; Thu, 20 Sep 2018 06:05:09 +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 01/11] hugetlb: Harmonize hugetlb.h arch specific defines with pgtable.h Date: Thu, 20 Sep 2018 06:03:48 +0000 Message-Id: <20180920060358.16606-2-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 asm-generic/hugetlb.h proposes generic implementations of hugetlb related functions: use __HAVE_ARCH_HUGE* defines in order to make arch specific implementations of hugetlb functions consistent with pgtable.h scheme. Signed-off-by: Alexandre Ghiti Acked-by: Catalin Marinas # arm64 Reviewed-by: Luiz Capitulino Reviewed-by: Mike Kravetz --- arch/arm64/include/asm/hugetlb.h | 2 +- include/asm-generic/hugetlb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index e73f68569624..3fcf14663dfa 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -81,9 +81,9 @@ extern void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); extern void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep); +#define __HAVE_ARCH_HUGE_PTE_CLEAR extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz); -#define huge_pte_clear huge_pte_clear extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned long sz); #define set_huge_swap_pte_at set_huge_swap_pte_at diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 9d0cde8ab716..3da7cff52360 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -32,7 +32,7 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot) return pte_modify(pte, newprot); } -#ifndef huge_pte_clear +#ifndef __HAVE_ARCH_HUGE_PTE_CLEAR static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz) { From patchwork Thu Sep 20 06:03:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606891 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 30BA11508 for ; Thu, 20 Sep 2018 06:06:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F8CB2D1F9 for ; Thu, 20 Sep 2018 06:06:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10B812D20C; Thu, 20 Sep 2018 06:06:32 +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 2EA942D1F9 for ; Thu, 20 Sep 2018 06:06:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 397EE8E0004; Thu, 20 Sep 2018 02:06:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 320CB8E0001; Thu, 20 Sep 2018 02:06:30 -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 1C2D38E0004; Thu, 20 Sep 2018 02:06:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id AC9378E0001 for ; Thu, 20 Sep 2018 02:06:29 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id q29-v6so3681895edd.0 for ; Wed, 19 Sep 2018 23:06:29 -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=jNYJHxbEwjB/4r5ca/Xp1V7+oik8+EhvHa2Lwxf6QeQ=; b=oJO8h17dIuU3GJ0ztJwpnydzMpZoATAUSV9V8P5HQjGX4WkTO3zHL0nEDHUBzVJlmR y/Mw/4XH3VV1IDWPJF2XMGGY6Uxt8sQyY5vCfRqocqQ4YYw1nnSEb9r+Z1Byz1gAbkp2 XHbZqiOTj/AgqBJLkQ9qKw1JHcHQjLpdjDxwGcjhnyDRg8SRpgnjJYdQ1LCnHuupXkfV zPRPGPerccZ/6lIMDaT7POHt809q0aCZElqNjcl4PzMLGFMj2Vrm+cWpaHkC1fX1v7jm /PbdKdwbRDUzMpWh+Z3m3axOTJ1+m1+86XnP6ms8ySvk5vX0r4PgHXg6m063FILdCs1Q Gbng== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APzg51BpbsDI1UVAirJ1FXrGxxrbPCANWxhgnqLGhCr1T1MHbcIHR5eq Z0+kkJJFi6OychanVB/6psO418fYNQD4Tf+fZfBCepA28o1f8/l3Gts9HYwVMC2rZtc70DOvHCe JVboCN1BCAKL2RGpv+BOhLoQNKPlbU9GY9XlQjylJsH2kiHbbSbngh1B37j0K2IY= X-Received: by 2002:a50:cf42:: with SMTP id d2-v6mr2153920edk.242.1537423589177; Wed, 19 Sep 2018 23:06:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaraa9k0499vGX3LCl3VVFHjA9NBtzGfpQ0b5jzSOViz4F7Erx+FthuWYbW3JWdlR67htbX X-Received: by 2002:a50:cf42:: with SMTP id d2-v6mr2153803edk.242.1537423587881; Wed, 19 Sep 2018 23:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423587; cv=none; d=google.com; s=arc-20160816; b=IF0eJErDO0P7ShPvdH3MiWabdytGlLWaLikwKyIhNX8F4hyrcGmzbsQ90DpQAm/yh/ 9gDUwEhfqGQ/amsNdrfeLstKCSn/7pwpuhIFcqllMhie6DvyrRIrIFIduE6kIyeDyrvK /KXXdBiW7QcoQPLjEY2ecPmaQT6oEC4fFByw3IWZ72FyiED5qgmA/d1NFbL8rjVgzIlH 9bEENf41v5SvKmiPVo6+65GlnBKFNhVWW2iTOMZXHt2CRECBa+iCCv7bGQEHR/OV/zcl aPz8u92/PGduIzmT2vzRy8tVHhqATZtDE1cZs50YpKxLmFOi+T5VPQ45nE0/0tulXEzf YaOg== 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=jNYJHxbEwjB/4r5ca/Xp1V7+oik8+EhvHa2Lwxf6QeQ=; b=bgVN49dDG6Dml2Mb/gC7c8OMX3Y1jUIZ1iElduAJPngsq9DSS4g+uBKXqMxg/LSFYs ly6njJ39xz4cCkNSXh3PAn0HhBXdw+B/zN7Uf+PZ2fokxy5XU8th6KKz4LGvk3QfHdCs c7++XtTqB+WU/QWiSttKT5bol0R1cIHbOcsn1vJGnFMcJXHXi2eXjifs4NKGlXmeDDbW gzaKb4cmIOBQWbrpibM3HmCML/bJWJxGfJB2f4e8g0Z80kd7FKaQ8O5DM6xUnr71QuGb QHajeGrdGsFHNbsfbUc/4IzshG04JKyaZrSmVXozPgw9+cxboTceorwoIMXnfPhugJlY Bm8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net. [217.70.183.199]) by mx.google.com with ESMTPS id g5-v6si909257edh.109.2018.09.19.23.06.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:06:27 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.199; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.199 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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A5DFDFF806; Thu, 20 Sep 2018 06:06:19 +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 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range Date: Thu, 20 Sep 2018 06:03:49 +0000 Message-Id: <20180920060358.16606-3-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, mips, parisc, sh, x86 architectures use the same version of hugetlb_free_pgd_range, 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 | 9 --------- arch/arm64/include/asm/hugetlb.h | 10 ---------- arch/ia64/include/asm/hugetlb.h | 5 +++-- arch/mips/include/asm/hugetlb.h | 13 ++----------- arch/parisc/include/asm/hugetlb.h | 12 ++---------- arch/powerpc/include/asm/hugetlb.h | 4 +++- arch/sh/include/asm/hugetlb.h | 12 ++---------- arch/sparc/include/asm/hugetlb.h | 4 +++- arch/x86/include/asm/hugetlb.h | 8 -------- include/asm-generic/hugetlb.h | 11 +++++++++++ 10 files changed, 26 insertions(+), 62 deletions(-) diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h index 7d26f6c4f0f5..537660891f9f 100644 --- a/arch/arm/include/asm/hugetlb.h +++ b/arch/arm/include/asm/hugetlb.h @@ -27,15 +27,6 @@ #include -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - - static inline int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, unsigned long len) { diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 3fcf14663dfa..4af1a800a900 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -25,16 +25,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return READ_ONCE(*ptep); } - - -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - static inline int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, unsigned long len) { diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index 74d2a5540aaf..afe9fa4d969b 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -3,9 +3,8 @@ #define _ASM_IA64_HUGETLB_H #include -#include - +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); @@ -70,4 +69,6 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } +#include + #endif /* _ASM_IA64_HUGETLB_H */ diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 982bc0685330..53764050243e 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -10,8 +10,6 @@ #define __ASM_HUGETLB_H #include -#include - static inline int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, @@ -38,15 +36,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, - unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { @@ -114,4 +103,6 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } +#include + #endif /* __ASM_HUGETLB_H */ diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 58e0f4620426..28c23b68d38d 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -3,8 +3,6 @@ #define _ASM_PARISC64_HUGETLB_H #include -#include - void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); @@ -32,14 +30,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { @@ -71,4 +61,6 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } +#include + #endif /* _ASM_PARISC64_HUGETLB_H */ diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 2d00cc530083..2ab028b73a43 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -4,7 +4,6 @@ #ifdef CONFIG_HUGETLB_PAGE #include -#include extern struct kmem_cache *hugepte_cache; @@ -110,6 +109,7 @@ static inline void flush_hugetlb_page(struct vm_area_struct *vma, void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr); #endif +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); @@ -176,6 +176,8 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } +#include + #else /* ! CONFIG_HUGETLB_PAGE */ static inline void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr) diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index 735939c0f513..f6a51b609409 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -4,8 +4,6 @@ #include #include -#include - static inline int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, @@ -27,14 +25,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { @@ -85,4 +75,6 @@ static inline void arch_clear_hugepage_flags(struct page *page) clear_bit(PG_dcache_clean, &page->flags); } +#include + #endif /* _ASM_SH_HUGETLB_H */ diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 300557c66698..59d89b52ccb7 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -3,7 +3,6 @@ #define _ASM_SPARC64_HUGETLB_H #include -#include #ifdef CONFIG_HUGETLB_PAGE struct pud_huge_patch_entry { @@ -84,8 +83,11 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); +#include + #endif /* _ASM_SPARC64_HUGETLB_H */ diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index 5ed826da5e07..398da3b3414c 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -28,14 +28,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, - unsigned long addr, unsigned long end, - unsigned long floor, - unsigned long ceiling) -{ - free_pgd_range(tlb, addr, end, floor, ceiling); -} - static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 3da7cff52360..c697ca9dda18 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -40,4 +40,15 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, } #endif +#ifndef __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE +static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, + unsigned long addr, unsigned long end, + unsigned long floor, unsigned long ceiling) +{ + free_pgd_range(tlb, addr, end, floor, ceiling); +} + + +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606893 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 A4BAB1508 for ; Thu, 20 Sep 2018 06:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 948412D20B for ; Thu, 20 Sep 2018 06:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8822D2D20E; Thu, 20 Sep 2018 06:07:37 +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 C228C2D20B for ; Thu, 20 Sep 2018 06:07:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4A068E0005; Thu, 20 Sep 2018 02:07:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BFA7F8E0001; Thu, 20 Sep 2018 02:07:35 -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 A9C008E0005; Thu, 20 Sep 2018 02:07:35 -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 454AE8E0001 for ; Thu, 20 Sep 2018 02:07:35 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id g15-v6so3626570edm.11 for ; Wed, 19 Sep 2018 23:07:35 -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=Go4uc6lppjWyPgz0rmPjvz63lja9yLc0HwzAGJiA1cc=; b=UAYEkQBV4UPmDrVLnOCf+XBujPBuNpRRcBTWA8NZBndITc4AzaVp3Ozusi+htj4tq0 sNyprk+1uQjNkuXoVPqbTMe7xCqBtghHn5b+EYibDr+4kxR3JVCZ5E0jjAfeTfK0bIX6 Y0VwZwU4/CeVGoVRlPka8Hj/deeCTV5ECzg7aoJ1JHIVSMnIiTafXknOxH2/0pPNW/nl s/J5yYj0xLpxqjbYKYIBheeFXUpJJM0Qgktul7UczCi3frWlnRDDGZZsQf7NyV8rm9PO zsz2NVxjjsgbBO9AXhQTxyz9XJW0RQRglOPmxCdNK0X1mVCike+lkdI3R1NOTt4GM9t9 cWkw== 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: APzg51B++GiZCELXufyQkdDislK7TyTD8BxtAQUAewLBjvF7WtGZWyDC sDM5YYzPE8sIx47N0tyaERz/ek0gZpuzC95EGa3IDtdLzy47ce66SkqQaFl7Qrk8AKxNs4Fam3V n3HIhjMagEDPYggvT6e2JcfVKvy7Lw9UG8IqFnDi4MH2XS/gjCFL0dEkRjJClWME= X-Received: by 2002:aa7:c1ce:: with SMTP id d14-v6mr2118726edp.262.1537423654770; Wed, 19 Sep 2018 23:07:34 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb5W6TyoOBf/dsEIMq7bYWa/PkFg9qCbImZnR2wIlOJfe1FCe4IUQMAg819Pw2sFFVIZplC X-Received: by 2002:aa7:c1ce:: with SMTP id d14-v6mr2118638edp.262.1537423653905; Wed, 19 Sep 2018 23:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423653; cv=none; d=google.com; s=arc-20160816; b=nsGN4rHKODoXpIh9OQqfIqxrWp6h1xOh3240RgGhs6e4IgljAhPINBqdiDhYRFN5Zp pUnq+d9UT1OsK/BVBRkUQQhLAeVauNN7ZIoQsfRcBa3wLhQpP6gfr1GKVCJnRiD7s1ap GY+kOcuUw3INat+MyLKx6Z3wPMAt+/QtWs70+axKhEUk+DXVDP8rN9yvr2pryreiD7Fz Guvzh6oE2+SQRF5qiAkubAO3jxSebD5GfVgCf85F21UcUEFSnRyjvNwEk/5h4sge4qlc D3Lkkt0UjeJrt4NedN7xwTpHu/n11Df7fCiX87YTHppMpIi80R6DMpqi3mGMhhUf8zds 0Kjg== 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=Go4uc6lppjWyPgz0rmPjvz63lja9yLc0HwzAGJiA1cc=; b=ZXVmZREHTIOE1Q7M/TnY9VjA30IC0pt3Ab5aIfOnlKE5C6Xk0Ugz/o5mchvyZ74cqv dZ1Mg/ah5knYCsDT8rYAPbI6dapYdnkuGpMx0t4uX6ehV/a2UmbIadjmoiB/xowrqvpZ 3xBYRRHH6JFK5rryaO6/ZhJviBd1QsPOZx565L+8zzZe7PU9kbIMMQ+6NZCOctuBzRPm J2j4Xfmi3YdvE3MtIJfBBQkBjj14PRNpjR0BkqUFoqA16NFRylEKe3QwqpHbkAqrhmNo zrvSGXGgE3OeSn0w2mFhR0ClRg2GvXrJZnLMME+mTVD82B9+7tauVn6XCW/Km9qDaEVI qTbg== 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 62-v6si920744edf.370.2018.09.19.23.07.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:07:33 -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 DE4D64000C; Thu, 20 Sep 2018 06:07:27 +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 03/11] hugetlb: Introduce generic version of set_huge_pte_at Date: Thu, 20 Sep 2018 06:03:50 +0000 Message-Id: <20180920060358.16606-4-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, ia64, mips, powerpc, sh, x86 architectures use the same version of set_huge_pte_at, 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-3level.h | 6 ------ arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h | 6 ------ arch/mips/include/asm/hugetlb.h | 6 ------ arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/hugetlb.h | 6 ------ arch/sh/include/asm/hugetlb.h | 6 ------ arch/sparc/include/asm/hugetlb.h | 1 + arch/x86/include/asm/hugetlb.h | 6 ------ include/asm-generic/hugetlb.h | 8 +++++++- 10 files changed, 10 insertions(+), 37 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index d4014fbe5ea3..398fb06e8207 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return retval; } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 4af1a800a900..874661a1dff1 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -60,6 +60,7 @@ static inline void arch_clear_hugepage_flags(struct page *page) extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, struct page *page, int writable); #define arch_make_huge_pte arch_make_huge_pte +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index afe9fa4d969b..a235d6f60fb3 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -20,12 +20,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE); } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline pte_t huge_ptep_get_and_clear(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 53764050243e..8ea439041d5d 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -36,12 +36,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline pte_t huge_ptep_get_and_clear(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 28c23b68d38d..77c8adbac7c3 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -4,6 +4,7 @@ #include +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 2ab028b73a43..33b899624922 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -129,12 +129,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index f6a51b609409..bc552e37c1c9 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -25,12 +25,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline pte_t huge_ptep_get_and_clear(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 59d89b52ccb7..16b0c53ea6c9 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -12,6 +12,7 @@ struct pud_huge_patch_entry { extern struct pud_huge_patch_entry __pud_huge_patch, __pud_huge_patch_end; #endif +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index 398da3b3414c..8db9a761964d 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -28,12 +28,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - set_pte_at(mm, addr, ptep, pte); -} - static inline pte_t huge_ptep_get_and_clear(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 c697ca9dda18..ee010b756246 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -47,8 +47,14 @@ static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, { free_pgd_range(tlb, addr, end, floor, ceiling); } +#endif - +#ifndef __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT +static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, + pte_t *ptep, pte_t pte) +{ + set_pte_at(mm, addr, ptep, pte); +} #endif #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606903 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 F2B2C5A4 for ; Thu, 20 Sep 2018 06:08:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0DBC2D1FA for ; Thu, 20 Sep 2018 06:08:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D413B2D200; Thu, 20 Sep 2018 06:08:43 +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 1C2452D1FA for ; Thu, 20 Sep 2018 06:08:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 432438E0006; Thu, 20 Sep 2018 02:08:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3E2B88E0001; Thu, 20 Sep 2018 02:08:42 -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 283F78E0006; Thu, 20 Sep 2018 02:08:42 -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 BFF798E0001 for ; Thu, 20 Sep 2018 02:08:41 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id b4-v6so3682898ede.4 for ; Wed, 19 Sep 2018 23:08:41 -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=w6ekfLOlQT03XdLpMjhHLNbo63+NgedDLkJv8GgLaD4=; b=tTj0/4zzQYrL7Gha2PZmtsjpWj+XwGTQe6A+DPboKY007xyn0pOo/XENmnXr24ZF9j WcsxKLbBwCKeHVnrARWcg51LLDU5nW1+XciHfPNpdxKIA/NK9VQMNqqDYTwFl485rhlc lgpEbROyb4gbO+Bi1ho6xWt4eknL5azowbt5hN+lEI6vgSXE8iOi08Zi5Z2O3vQIhtg9 0fMZTaroEeDsJu1UUb9Y6kug2sEH902gxwVHARYhvHcc0o40c9i2qPEGPoUVgiSxWWvN MwTwTbNvLbWr8x6/ORTVuCTmeCCjJlcelPHSAzYQQZV0rbfxsbWqSpcNYUEV5bDUTzrN CQ/w== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APzg51DqoM4VFTxnPvJhBANUNNCPEsW+j7OMbGNlBFa3QjZEVd79Kz2s 5VaJQYydVEjHg4QvZJSldhuhb3Ly1QDxVfaYC84GS4aS77x2eK4uqW3ziwhzs9CzkVxZkPRhzL7 LKYwiFNdMchibMiCgv73/isjRRvzxU9/RtJLi7wlIDosl7nx3Hj2SkIkwSDbqgRY= X-Received: by 2002:a50:9421:: with SMTP id p30-v6mr2118553eda.150.1537423721254; Wed, 19 Sep 2018 23:08:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYZM9kNFQDR1MbkzAN7HwZgOPcaeaTOjBektfoWbPLyoTj2ZQyjmMW6fxNUnMmbj2dBVJYn X-Received: by 2002:a50:9421:: with SMTP id p30-v6mr2118419eda.150.1537423719761; Wed, 19 Sep 2018 23:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423719; cv=none; d=google.com; s=arc-20160816; b=ogcsmGxtCODb6/uQboAppEjpQBvGDVRSU8vo6WbjYzOR3nq7tzorn+hWcaQoedP4jp qem/IrwGfA0yb7tbYTXLM+V4EJm40cTPYzzQFAwzKXzAlWm2MlYMQ/rtPvOWc/zrMbtF cygitbVeVTa5lrPn7kGOGKiM0ZEG0OiUeKkLhKlACEsZNgOsIjfvLv4vt8zjXMSS7acj +V4gshHt5Mtp8e9oR1Be0tFb/uXdHhlQap8AEFf0pmurflB1Z/8s+M7SXmYeuJYoulRz 1flcWKvZf5WM3eRRf2iykczFzIAp0P8B/ks8CnAWQEE439JLSx+ltVXTmpaBehqPQi1E UwCQ== 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=w6ekfLOlQT03XdLpMjhHLNbo63+NgedDLkJv8GgLaD4=; b=ZEc0kKkHiCp5sozO2CVQBpSwyH9NYSvXmjXaY3HL+lZMmzmKRKTGSw3qtm9PwAOzFB 1A+3B4VV5Miv+c4V+yyRmD90ubWUn5/KfbgnZXsou8zJSGfaBYMEVnMWKvQuC5ikIt0a i81Nu9NfASH0D1/xnElCoM1oZBSwsEkdvIGFR6kPNxiA874giXpI1UFIbCqYRf0+4M2S T+kxW8pw24enZsrjLwtOCVjEf6hl6Sp3P0rXMC37uIKvjYE9HVW2GzBqcQLPylJBdxLT CG49G5k18q40JJ92qTvPxBXiuHzsq/xGOJqltwTR/N2imvd0WFQJxh7ga6wMeBO3yWar TJFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net. [217.70.183.199]) by mx.google.com with ESMTPS id y43-v6si911388edd.416.2018.09.19.23.08.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:08:39 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.199 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.199; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.199 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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 0C043FF808; Thu, 20 Sep 2018 06:08:33 +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 04/11] hugetlb: Introduce generic version of huge_ptep_get_and_clear Date: Thu, 20 Sep 2018 06:03:51 +0000 Message-Id: <20180920060358.16606-5-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, ia64, sh, x86 architectures use the same version of huge_ptep_get_and_clear, 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-3level.h | 6 ------ arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h | 6 ------ arch/mips/include/asm/hugetlb.h | 1 + arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/hugetlb.h | 1 + arch/sh/include/asm/hugetlb.h | 6 ------ arch/sparc/include/asm/hugetlb.h | 1 + arch/x86/include/asm/hugetlb.h | 6 ------ include/asm-generic/hugetlb.h | 8 ++++++++ 10 files changed, 13 insertions(+), 24 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index 398fb06e8207..ad36e84b819a 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -49,12 +49,6 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, ptep_set_wrprotect(mm, addr, ptep); } -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - return ptep_get_and_clear(mm, addr, ptep); -} - static inline 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/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 874661a1dff1..6ae0bcafe162 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -66,6 +66,7 @@ extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, int dirty); +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); extern void huge_ptep_set_wrprotect(struct mm_struct *mm, diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index a235d6f60fb3..6719c74da0de 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -20,12 +20,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE); } -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - return ptep_get_and_clear(mm, addr, ptep); -} - static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 8ea439041d5d..0959cc5a41fa 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -36,6 +36,7 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR static inline pte_t huge_ptep_get_and_clear(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 77c8adbac7c3..6e281e1bb336 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -8,6 +8,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR pte_t huge_ptep_get_and_clear(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 33b899624922..91bdc84b76ce 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -129,6 +129,7 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index bc552e37c1c9..08ee6c00b5e9 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -25,12 +25,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - return ptep_get_and_clear(mm, addr, ptep); -} - static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 16b0c53ea6c9..944e3a4bfaff 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -16,6 +16,7 @@ extern struct pud_huge_patch_entry __pud_huge_patch, __pud_huge_patch_end; void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR pte_t huge_ptep_get_and_clear(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 8db9a761964d..e9e7fef867ad 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -28,12 +28,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - return ptep_get_and_clear(mm, addr, ptep); -} - static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index ee010b756246..0f6f151780dd 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -57,4 +57,12 @@ static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, } #endif +#ifndef __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR +static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, + unsigned long addr, pte_t *ptep) +{ + return ptep_get_and_clear(mm, addr, ptep); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606907 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 D618714BD for ; Thu, 20 Sep 2018 06:09:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2F7B2D20B for ; Thu, 20 Sep 2018 06:09:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B45A12D20A; Thu, 20 Sep 2018 06:09:49 +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 021232D20A for ; Thu, 20 Sep 2018 06:09:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AB058E0007; Thu, 20 Sep 2018 02:09:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 25B398E0001; Thu, 20 Sep 2018 02:09:48 -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 124928E0007; Thu, 20 Sep 2018 02:09:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id A95CF8E0001 for ; Thu, 20 Sep 2018 02:09:47 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id q29-v6so3684873edd.0 for ; Wed, 19 Sep 2018 23:09:47 -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=etS0yRQS++r7ZUmYd+9WCsfz++Rnr/ev9NwMLEd0DoU=; b=cu5JB7PjKO3xL/u84kfsjZPivn+/jcDhgtlCnzRLk5j5ZeEIw2Gr0yalipMri4xxx1 VD2bmXmvdw4vxd3tv8C3z3FJ3WOBGrhBxRYDTUnHMbFwdi0dNHzdeX5Zdo3IBrFA27lZ Z8elHSfwCGtSGZl2vEtIzlF1SLkPMSvGTgK+PLwyw4I7pOCqGw2XCZmdsVT16aihYUcN ZxCbsjgHzpANZ881haOGg7vTmM/egINS6JV6HpAcUOUbQ8rM626ULKa7+cC3rHZCYso9 MMr0qTMJm9ZR5aQcM+B2+qN2JloSLUC0SQQhYQL1Qna1JTtU4EtZHH/u06vY0RTuZZZW QxeA== 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: APzg51AAZ8s984dOqI3mxPhd9qFb7UL8jg5X1nLZS7vWf+rvgh2VXchW sai6u0WAt3/PAtgXvBpSZP1xbfwu/WRgJIHxHf+pxDPbS6ZTFaiANpq17Tkw1m25GMoZsIBW9Su H7Ct/HLACqn/wZTA/t9GTq9hUwqeMsrV2aV+6M4o2nVPv2F5Cd2+XLxj9oZifGcg= X-Received: by 2002:a50:8b25:: with SMTP id l34-v6mr2020660edl.265.1537423787146; Wed, 19 Sep 2018 23:09:47 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbr81z8B9Ux/4otbDqtxM9E7lDriRPogmHq7fIWjPBBSyjq51yelJY7ricRvQqtLqozGKdN X-Received: by 2002:a50:8b25:: with SMTP id l34-v6mr2020556edl.265.1537423785965; Wed, 19 Sep 2018 23:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423785; cv=none; d=google.com; s=arc-20160816; b=EM8IKKGisFZDj/NkTIgvJSlS1irPQXAgwNszX760xSJLFSYFm2r5+2hvjGgLTeNdd4 wHxoJLfD0z2SG9KnYjntRKaW4zcS/68s0Dd5eqkLH3XhffPSz11i73SGAYS/WhEegsxV b8xAWFKJxN3e7yYFOsQY6YWm7U9N5HfsaXerS1uewmMPUbIDoqQnCm6i54+BK94RPYaW ZcImnBQ7T8dIOi8OCvTO4j/KbkIfjR14Qh+DpBor3M9wB0pNWFTGGwx/z0MjJPn9P4Nc pNpendFKkKK6QdVBsC1AGpv8cZGHHVgZy/wYb5IGibM5BGSOjM/FPttDYamZVTMRzVqL qy/w== 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=etS0yRQS++r7ZUmYd+9WCsfz++Rnr/ev9NwMLEd0DoU=; b=R0e7ZbGLF08KxZbkOZLpXj41N89S95Bljz+CFnlCOJ9ms+nHBVzWfrt5fLNmFMWfwe k65LmS3ZAYoG3xPPN7FPd4nVTPn2paMYSlTTFQQWtyFJci5OeOQJWwAc+mp1AUhC17MW 6Rhe7YAyecCOXrd6TIszJ5TT837qwvIiie46v5WDXjUn1GPR2l1YypOyGrQC/R3H02sp mWPbSh0oXLXxCGXLb3+9CsT6XGSPEk/bqibJtG/strbxQ23vgRIlEtQJlglI0LBhR0jl g6ZkVcG4/vSBL5rirl+wxkWPafwNHRX3hEfhhvrWAc25YSWbqDdOyA6l0MERhq9CkjDP Yqiw== 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 b16-v6si1056233edh.182.2018.09.19.23.09.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:09:45 -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 1A3AC40003; Thu, 20 Sep 2018 06:09:39 +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 05/11] hugetlb: Introduce generic version of huge_ptep_clear_flush Date: Thu, 20 Sep 2018 06:03:52 +0000 Message-Id: <20180920060358.16606-6-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, x86 architectures use the same version of huge_ptep_clear_flush, 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-3level.h | 6 ------ arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h | 1 + arch/mips/include/asm/hugetlb.h | 1 + arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/hugetlb.h | 1 + arch/sh/include/asm/hugetlb.h | 1 + arch/sparc/include/asm/hugetlb.h | 1 + arch/x86/include/asm/hugetlb.h | 6 ------ include/asm-generic/hugetlb.h | 8 ++++++++ 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index ad36e84b819a..b897541520ef 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return retval; } -static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep) -{ - ptep_clear_flush(vma, addr, ptep); -} - static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 6ae0bcafe162..4c8dd488554d 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -71,6 +71,7 @@ extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); extern void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH extern void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep); #define __HAVE_ARCH_HUGE_PTE_CLEAR diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index 6719c74da0de..41b5f6adeee4 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -20,6 +20,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE); } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 0959cc5a41fa..7df1f116a3cc 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -48,6 +48,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, return pte; } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 6e281e1bb336..9afff26747a1 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -32,6 +32,7 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 91bdc84b76ce..1eb3e131cab4 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -140,6 +140,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, #endif } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index 08ee6c00b5e9..9abf9c86b769 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -25,6 +25,7 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 944e3a4bfaff..651a9593fcee 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -42,6 +42,7 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index e9e7fef867ad..fd59673e7a0a 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -28,12 +28,6 @@ static inline int prepare_hugepage_range(struct file *file, return 0; } -static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep) -{ - ptep_clear_flush(vma, addr, ptep); -} - static inline int huge_pte_none(pte_t pte) { return pte_none(pte); diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 0f6f151780dd..ffa63fd8388d 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -65,4 +65,12 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, } #endif +#ifndef __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH +static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, + unsigned long addr, pte_t *ptep) +{ + ptep_clear_flush(vma, addr, ptep); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606917 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 A122E5A4 for ; Thu, 20 Sep 2018 06:10:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9230A2D241 for ; Thu, 20 Sep 2018 06:10:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F5052D240; Thu, 20 Sep 2018 06:10:57 +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=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 D4F062D24A for ; Thu, 20 Sep 2018 06:10:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6AD18E0008; Thu, 20 Sep 2018 02:10:55 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E1A758E0001; Thu, 20 Sep 2018 02:10:55 -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 CE3088E0008; Thu, 20 Sep 2018 02:10:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by kanga.kvack.org (Postfix) with ESMTP id 74BF98E0001 for ; Thu, 20 Sep 2018 02:10:55 -0400 (EDT) Received: by mail-wm1-f70.google.com with SMTP id s18-v6so5068459wmh.0 for ; Wed, 19 Sep 2018 23:10:55 -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=YMVwcdbAWgDM/LcFWcXJvWfo1bVwtSwiPVs2/m3CYZ8=; b=UdYSofrarMGRpUP6g2lWCeeQGTxhMN1fMuvtNZDBOdjVujeNoOXIH8d3n2NJ6IT7Ge s9NpkfVSeGxP23mF2BIZYtmaBfzgOAQhh6o8joGm59pATwT8AtEWKcYnjycOxWNzufXY ZkJlAk9pnN7Xe0YXNyYHq5R++jjigUW8DsBiYBIoUhsVgYPMrL1P0UBlhIEjxY5px7bg VtDuybXvTRSEyr10/RS5tG3tL8GCLK3Lr9hvEyI9YC0cO6XNIKG0GgL0Fi/O4MEJm+uV cSWx8C5tcURuZKBgeVPwYe7NZFmPPz0NTGbmSxZHGyMyo2wulMuQFy69HbzQ/jhjtAf0 NmTA== 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: APzg51CqZkQR+xQHQrOwNA/1/YKCsRfFH5tZbEb2f36j2f3xkQbUXy/t 4PEyEBuTzzlWapVTPICxS8lOlNO0McIJY1+51aOYtRSwZDeY620mcpGo6zGMrmcTnTUiGgLx17o 7ZGAQmToXZ9LmsV/LnNmMYhaJadWBSOrvxJrC41C+sxU+qJ0QWLKdqWguxq60+SQ= X-Received: by 2002:a05:6000:181:: with SMTP id p1mr29396813wrx.146.1537423854976; Wed, 19 Sep 2018 23:10:54 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdau5uU2u7scrm6Q7d/IdWPUslqxiBa79o5nqwXBd5hllKPU3LmXZIQx90kx1hwbkpVMPBTa X-Received: by 2002:a05:6000:181:: with SMTP id p1mr29396732wrx.146.1537423853609; Wed, 19 Sep 2018 23:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423853; cv=none; d=google.com; s=arc-20160816; b=WxsMvBbowH80mw57HTPUPcS1rOQJbiQ+lsoP5rdo1/d7mvptvvYdOdralhQZ9vKHtA uD1fwbhykjPgwBhtNerWsOKcZjYnuexwh/Ex18rYlDBSseAbDrh/Oa0wJCQ0KEJsARnt Wg6dpRHhrsH7nlCenxxGKQxPmeGQhA4InhEg/PcYEGg+kEXNd74H0fEovSOCPk6m99R9 dpUc0/cDRH+BPh7t1MO1VR0+Z/OC1ttQlUDtVRjWYFY/fCz70CCUws2AvUHBp3kmw7Xg AhRSsShAk858kMtpJrA89av0smyl+7rW1HbSYWjN6mfybWydipJOTFCwCGiEnj5Sc9Ux zstg== 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=YMVwcdbAWgDM/LcFWcXJvWfo1bVwtSwiPVs2/m3CYZ8=; b=kJG1NajC+SR9Ej6ky35egg4BTlOIB86rUXz+3GWoAC6rD75bFz9DNqZrV/L2C9n4VT MtaDtAGJmvAR7PQDKWLPgW4uy6Faxp4/gw7hmzIRTQ1QKMGaPa5YLS4vfNl7GwIfrTFl TG3RdfuM2YjR6fOD3Zy0D4hbLTlXRy7NTb2v04eeqy9+kE1IsKiDTQD7Cqohso4gD5VG TDz5UwPSYTnNLiQC3QugaTqq5jNV6LIxKGyWkhiMpj21eWizg0wXBxSd6ec/UoKGky// XYGjHIuejAd7PBW+TClS/wsBqLOGJpKU40TNNRsE5i64ZGk3cQgRrAOwKJhDq0Pb9Xx4 oEnw== 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 83-v6si923817wmb.180.2018.09.19.23.10.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:10:53 -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 1F44FC000A; Thu, 20 Sep 2018 06:10:45 +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 06/11] hugetlb: Introduce generic version of huge_pte_none Date: Thu, 20 Sep 2018 06:03:53 +0000 Message-Id: <20180920060358.16606-7-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_none, 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 | 1 + 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, 8 insertions(+), 40 deletions(-) diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h index 537660891f9f..c821b550d6a4 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 4c8dd488554d..49247c6f94db 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index 41b5f6adeee4..bf573500b3c4 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 7df1f116a3cc..1c9c4531376c 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -55,6 +55,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma))); } +#define __HAVE_ARCH_HUGE_PTE_NONE static inline int huge_pte_none(pte_t pte) { unsigned long val = pte_val(pte) & ~_PAGE_GLOBAL; diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 9afff26747a1..c09d8c74553c 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 1eb3e131cab4..6a534353c8eb 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index 9abf9c86b769..a9f8266f33cf 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 651a9593fcee..11115bbd712e 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index fd59673e7a0a..42d872054791 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 int huge_pte_none(pte_t pte) -{ - return pte_none(pte); -} - static inline pte_t huge_pte_wrprotect(pte_t pte) { return pte_wrprotect(pte); diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index ffa63fd8388d..2fc3d68424e9 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -73,4 +73,11 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, } #endif +#ifndef __HAVE_ARCH_HUGE_PTE_NONE +static inline int huge_pte_none(pte_t pte) +{ + return pte_none(pte); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ 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 */ From patchwork Thu Sep 20 06:03:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606937 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 AE9CF1508 for ; Thu, 20 Sep 2018 06:13:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CB9D28396 for ; Thu, 20 Sep 2018 06:13:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9086628C53; Thu, 20 Sep 2018 06:13:10 +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 BA8EC28396 for ; Thu, 20 Sep 2018 06:13:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1F6C8E000A; Thu, 20 Sep 2018 02:13:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BA74C8E0001; Thu, 20 Sep 2018 02:13:08 -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 A49638E000A; Thu, 20 Sep 2018 02:13:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by kanga.kvack.org (Postfix) with ESMTP id 4BD888E0001 for ; Thu, 20 Sep 2018 02:13:08 -0400 (EDT) Received: by mail-wm1-f72.google.com with SMTP id j129-v6so5043739wmj.3 for ; Wed, 19 Sep 2018 23:13:08 -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=qYtRDuwH47mm7VTO+0hgpzHhXOH+x99p0BsFt+TW7w4=; b=U3XG9y/3J1cdi+/IdFoI+YCxgCEgfJJuleIv+ieR8AIxoxHf9mbGV9typWFFVSTbvR Z60Fx+9fD9cMXcIsu2GL4a3t44HZsK1Yq4TZ+fnYDvSI+DWucDyaQwycixF/yEyp9mt+ G7g+1geaSvgO6X0LbZFptBalqNwcqp2b9g2oM4w3gYk4Vdb3C9iFV6BunX3mqcfhgCNy x4YrG6Mz9kV97nMU6Wi6/os42AJBd1zTLsKy4obyi+eke/WmRUZgynBCt+Pln1kcPM2M DYJ7AMKOhKTkuKzXBEkeBofgqouBh9iWrECLEm4Ay1HBxU6rZjzQmBS5ths3cxE2bb2o 4f8w== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.193 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APzg51ApxEtBFoWfzuZ5OfIKEuSL+lqDGaKtbnmYrB/Ta2IpOnTp7OGj 3QLgguU7gGySCwmB2GTYJ88L+4qI3ogbEcTSZHOHPv1ILy8JXqqcbcAm8QROPZaptT1JiMgHbRY S0WA8o+iArRu1V/Cj9g8Fips/DjO+6UBrwNxQcatAoUZdVVmM7vaKlcpjjMlHeU0= X-Received: by 2002:a1c:7f93:: with SMTP id a141-v6mr1021658wmd.45.1537423987732; Wed, 19 Sep 2018 23:13:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbM+ZlMg/arg4PBsQkyezwEudAdiCLMNXuiOVSJunAbYWSjXyhM+tH8uQ9/8vFZ/qeojTl/ X-Received: by 2002:a1c:7f93:: with SMTP id a141-v6mr1021582wmd.45.1537423986172; Wed, 19 Sep 2018 23:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537423986; cv=none; d=google.com; s=arc-20160816; b=vwR+NH9QFfwvCAqetuB/BGvAid8AZ4P9b3PuIlh4bLHeCbWn3nBUGAmdhdUkU9pu7J Db5SGlZvspnh3dSVJcz67VNYs26mRzXE2DLuaykQx6Jy4TFqjT0Jfpytf0b7Y/+GzzDq F53WDp2RzVtzEyaoTRPkOpyj+QjbckBMgXyKqrOF7Stip9O31ImBIwqPn0XfXyasnvh+ qzTizKMU9tlWdKqd77uG/em+FdVYfmx3ICNBm5kF4BX2ADCToXS+u9TcVsDdpBgPAerO R8lEAJFKreJ+VzoCjDPaaAKE5SoPkpvLejaL6R/n/YTYwUCTwvC23jKsMDz2h5KRSR3C kFFQ== 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=qYtRDuwH47mm7VTO+0hgpzHhXOH+x99p0BsFt+TW7w4=; b=r+zdJ/Hf+cE/RnrSs7ZF1tbxQfLLn+7Vq6hcfzPwpGB4eEwamH8+8qUTuwLklKSL8j bfhUTdvZKfXfGnzcBUKzHr6HX6AskZ6u3P/x5IP7WZRX0A+ZNyUd2x6DM7mZ1c8AHKVq +sylOVhU8/xljBxHjcSZCTxidxbNExIltqM54i6Wr/pwh1wJ16v1FknDSlJ6Xq/3AoYc pdjWjvfeWqMssn83sxnqUdJTKeHoITrANumsk3I3RmqXx/lPerzajdOJvmSVYI4+RN// A++euMs57muUsqN5iANKi1IUj4eOMf0GUN323SuI80npjnvQ9hUuHOVbKoRKOwQIjm+L xGng== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.193 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net. [217.70.183.193]) by mx.google.com with ESMTPS id v185-v6si1060191wmd.103.2018.09.19.23.13.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:13:06 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.193 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.193; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.193 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 relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A36C924000B; Thu, 20 Sep 2018 06:13:00 +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 08/11] hugetlb: Introduce generic version of prepare_hugepage_range Date: Thu, 20 Sep 2018 06:03:55 +0000 Message-Id: <20180920060358.16606-9-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, powerpc, sparc, x86 architectures use the same version of prepare_hugepage_range, 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 | 11 ----------- arch/arm64/include/asm/hugetlb.h | 11 ----------- arch/ia64/include/asm/hugetlb.h | 1 + arch/mips/include/asm/hugetlb.h | 1 + arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/hugetlb.h | 15 --------------- arch/sh/include/asm/hugetlb.h | 1 + arch/sparc/include/asm/hugetlb.h | 16 ---------------- arch/x86/include/asm/hugetlb.h | 15 --------------- include/asm-generic/hugetlb.h | 15 +++++++++++++++ 10 files changed, 19 insertions(+), 68 deletions(-) diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h index 9ca14227eeb7..3fcef21ff2c2 100644 --- a/arch/arm/include/asm/hugetlb.h +++ b/arch/arm/include/asm/hugetlb.h @@ -33,17 +33,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -static inline int prepare_hugepage_range(struct file *file, - unsigned long addr, unsigned long len) -{ - struct hstate *h = hstate_file(file); - if (len & ~huge_page_mask(h)) - return -EINVAL; - if (addr & ~huge_page_mask(h)) - return -EINVAL; - return 0; -} - 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 1fd64ebf0cd7..3e7f6e69b28d 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -31,17 +31,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -static inline int prepare_hugepage_range(struct file *file, - unsigned long addr, unsigned long len) -{ - struct hstate *h = hstate_file(file); - if (len & ~huge_page_mask(h)) - return -EINVAL; - if (addr & ~huge_page_mask(h)) - return -EINVAL; - return 0; -} - 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 82fe3d7a38d9..cbe296271030 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -9,6 +9,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len); diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index b3d6bb53ee6e..6ff2531cfb1d 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -18,6 +18,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE static inline int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len) diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 5a102d7251e4..fb7e0fd858a3 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -22,6 +22,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, * If the arch doesn't supply something else, assume that hugepage * size aligned regions are ok without further preparation. */ +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE static inline int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len) { diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index b5b57b309564..2a90f387880a 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -114,21 +114,6 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); -/* - * If the arch doesn't supply something else, assume that hugepage - * size aligned regions are ok without further preparation. - */ -static inline int prepare_hugepage_range(struct file *file, - unsigned long addr, unsigned long len) -{ - struct hstate *h = hstate_file(file); - if (len & ~huge_page_mask(h)) - return -EINVAL; - if (addr & ~huge_page_mask(h)) - return -EINVAL; - return 0; -} - #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index 54f65094efe6..f1bbd255ee43 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -15,6 +15,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, * If the arch doesn't supply something else, assume that hugepage * size aligned regions are ok without further preparation. */ +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE static inline int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len) { diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index f661362376e0..2101ea217f33 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -26,22 +26,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -/* - * If the arch doesn't supply something else, assume that hugepage - * size aligned regions are ok without further preparation. - */ -static inline int prepare_hugepage_range(struct file *file, - unsigned long addr, unsigned long len) -{ - struct hstate *h = hstate_file(file); - - if (len & ~huge_page_mask(h)) - return -EINVAL; - if (addr & ~huge_page_mask(h)) - return -EINVAL; - return 0; -} - #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index 3cd3a2c9840e..59c056adb3c9 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -13,21 +13,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -/* - * If the arch doesn't supply something else, assume that hugepage - * size aligned regions are ok without further preparation. - */ -static inline int prepare_hugepage_range(struct file *file, - unsigned long addr, unsigned long len) -{ - struct hstate *h = hstate_file(file); - if (len & ~huge_page_mask(h)) - return -EINVAL; - if (addr & ~huge_page_mask(h)) - return -EINVAL; - return 0; -} - 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 cd9697672b79..6c0c8b0c71e0 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -87,4 +87,19 @@ static inline pte_t huge_pte_wrprotect(pte_t pte) } #endif +#ifndef __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE +static inline int prepare_hugepage_range(struct file *file, + unsigned long addr, unsigned long len) +{ + struct hstate *h = hstate_file(file); + + if (len & ~huge_page_mask(h)) + return -EINVAL; + if (addr & ~huge_page_mask(h)) + return -EINVAL; + + return 0; +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606943 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 52CD01390 for ; Thu, 20 Sep 2018 06:14:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41A1228396 for ; Thu, 20 Sep 2018 06:14:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 348BD2D255; Thu, 20 Sep 2018 06:14:17 +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 F086928396 for ; Thu, 20 Sep 2018 06:14:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 234F68E000B; Thu, 20 Sep 2018 02:14:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1BC3B8E0001; Thu, 20 Sep 2018 02:14:15 -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 05DC98E000B; Thu, 20 Sep 2018 02:14:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id 995808E0001 for ; Thu, 20 Sep 2018 02:14:14 -0400 (EDT) Received: by mail-wr1-f70.google.com with SMTP id 51-v6so7981749wra.18 for ; Wed, 19 Sep 2018 23:14:14 -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=ZZLGrN0T2FWlbujozCmuUYSlWC5xI3VeAT4LjZ6hsvA=; b=Lpwp03EvKttYRvgbilxzMOhqAVbhEu4K8+yJjpKLpYlWcxcTCd55X7rZNgohcqrMZJ qwrLb+mxarDmlyGDwl/elHBrhUGhUc91RVtNAkpp+5EdcbEzOsK2i+EEBsvy3rtd2vgI 3t/bu2mwxzCz73Q4TlbZzOjXQb8UJ/Nc/3uDo7z6/9EJkIjxVx9HWMEwRDYtL/RxANJo uNBGvE9vk+o23gY+DghWHPPy18uj/kA8O0AEog+17upfHDnM52xCcRY4Sj2F151Sf+5d 28jwL//rMqyucMIOJPkeYp+Kq0hE+LutTaN0vjtRmodjfRgL9NZ+4ZhljirqIFr0tjqt CCWA== 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: APzg51BoKalL0SXyhiwysMMv5Wskseue2om4tAmYtBhspodldgIn+gWh 4fjv4beqc/NTEpLterflY70OIXwwFO8xsrzQKeW6maRYMrEH1JtH/d3YWbVWbQdmmo0L3LYI/Y5 TZKjwb5Dtqp2g51xGxUkh23h1FPwm1CKjoYOCAMfRHsYSVbHUCR/FaFaSWQTqqa4= X-Received: by 2002:a1c:dd05:: with SMTP id u5-v6mr973804wmg.107.1537424054072; Wed, 19 Sep 2018 23:14:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV629Rus+wowRC8u7D4Cc+3+iSXc1/LTcOQAr/9kICtDHQwPL/a6wnf9gQifw8JVt4UVCiiQq X-Received: by 2002:a1c:dd05:: with SMTP id u5-v6mr973720wmg.107.1537424052563; Wed, 19 Sep 2018 23:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537424052; cv=none; d=google.com; s=arc-20160816; b=qHZmL01PaU9cnxpeQtKumX7HRaAJCtsJcwRYa2SyXuaJESH9JkLHWcz3/O/vVB5lCB B4LJT8LQwd6G3ljXbvCKf7Pk9n8YCZ8eQFB4BF1PkJrAXiSgE3bP1iIQ9/WJj0v2JcH+ vXm0IqaEEdK7cYQV4I7037f7MVg7Skhpc1CZgkdKjN6Rmtac1zRvrCdwc5Boq2DVU+eA 6p2iv2FiC9qpihSgMQE2bw7Lq4BwIDdCpfWKfEWGn18doHQf1p4IgbZjn3SRNLH/XB/O LaPm8ASSqK4LeH86Ci/HDsaA+8yW8iJ4okckO3wbxS+ihljAh+JQ4+he72btaS2XGSfk BNPw== 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=ZZLGrN0T2FWlbujozCmuUYSlWC5xI3VeAT4LjZ6hsvA=; b=O9lkJZ+SRRSSRWXKvpufBKcLyffDgLQfFCS2K0itRRG5/qKIWFiY913n8Tey/TsEUg amysDBtGZ29z8p9ev/azE1XAHtdJ+QA7SiTHqXqNAqeh70qhBwMn1hNsoa/ghge70ga1 /6quV6yR+1DWxdmjdQwB+DPARXaD4wV8bcpFh72btvY3vvgjKWlQ77ldNGnHzljQX2oA bqyKAoMg0Bjqag19M9qnaJSsZGC6vMnO5GPJrbxSe+z4//VTja9HynNAuD/+XhBDdAQp waJD6GwdPBSrdZ4T2W+VSMEO+Qem/iLk1pSxouZrrSR85KlXS3zF2nZVl+Q5o3ShgqPQ 1Uxw== 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 l17-v6si22914465wrv.4.2018.09.19.23.14.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:14:12 -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 7F276C000D; Thu, 20 Sep 2018 06:14:06 +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 09/11] hugetlb: Introduce generic version of huge_ptep_set_wrprotect Date: Thu, 20 Sep 2018 06:03:56 +0000 Message-Id: <20180920060358.16606-10-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, ia64, mips, powerpc, sh, x86 architectures use the same version of huge_ptep_set_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-3level.h | 6 ------ arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h | 6 ------ arch/mips/include/asm/hugetlb.h | 6 ------ arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/book3s/32/pgtable.h | 6 ------ arch/powerpc/include/asm/book3s/64/pgtable.h | 1 + arch/powerpc/include/asm/nohash/32/pgtable.h | 6 ------ arch/powerpc/include/asm/nohash/64/pgtable.h | 1 + arch/sh/include/asm/hugetlb.h | 6 ------ arch/sparc/include/asm/hugetlb.h | 1 + arch/x86/include/asm/hugetlb.h | 6 ------ include/asm-generic/hugetlb.h | 8 ++++++++ 13 files changed, 13 insertions(+), 42 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index b897541520ef..8247cd6a2ac6 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return retval; } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline 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/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 3e7f6e69b28d..f4f69ae5466e 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -48,6 +48,7 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT extern void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index cbe296271030..49d1f7949f3a 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -27,12 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline 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/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 6ff2531cfb1d..3dcf5debf8c4 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -63,12 +63,6 @@ static inline int huge_pte_none(pte_t pte) return !val || (val == (unsigned long)invalid_pte_table); } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index fb7e0fd858a3..9c3950ca2974 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -39,6 +39,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h index 751cf931bb3f..796d026da37e 100644 --- a/arch/powerpc/include/asm/book3s/32/pgtable.h +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h @@ -221,12 +221,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, { pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), _PAGE_RO); } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline void __ptep_set_access_flags(struct vm_area_struct *vma, pte_t *ptep, pte_t entry, diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 13a688fc8cd0..badb56963885 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -461,6 +461,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_update(mm, addr, ptep, 0, _PAGE_PRIVILEGED, 0); } +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h index a507a65b0866..6c82b9660c55 100644 --- a/arch/powerpc/include/asm/nohash/32/pgtable.h +++ b/arch/powerpc/include/asm/nohash/32/pgtable.h @@ -246,12 +246,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, { pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), _PAGE_RO); } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline void __ptep_set_access_flags(struct vm_area_struct *vma, pte_t *ptep, pte_t entry, diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h index 7cd6809f4d33..68283e632f04 100644 --- a/arch/powerpc/include/asm/nohash/64/pgtable.h +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h @@ -239,6 +239,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_update(mm, addr, ptep, _PAGE_RW, 0, 0); } +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index f1bbd255ee43..8df4004977b9 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -32,12 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline 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/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 2101ea217f33..c41754a113f3 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -32,6 +32,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT 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 59c056adb3c9..a3f781f7a264 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -13,12 +13,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - ptep_set_wrprotect(mm, addr, ptep); -} - static inline 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/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 6c0c8b0c71e0..9b9039845278 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -102,4 +102,12 @@ static inline int prepare_hugepage_range(struct file *file, } #endif +#ifndef __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT +static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, + unsigned long addr, pte_t *ptep) +{ + ptep_set_wrprotect(mm, addr, ptep); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606951 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 21565913 for ; Thu, 20 Sep 2018 06:15:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 102AE28396 for ; Thu, 20 Sep 2018 06:15:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0376F2D210; Thu, 20 Sep 2018 06:15: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=-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 474BD28396 for ; Thu, 20 Sep 2018 06:15:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47C998E000C; Thu, 20 Sep 2018 02:15:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4054E8E0001; Thu, 20 Sep 2018 02:15:24 -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 2A7138E000C; Thu, 20 Sep 2018 02:15:24 -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 BC01F8E0001 for ; Thu, 20 Sep 2018 02:15:23 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id x20-v6so3611630eda.22 for ; Wed, 19 Sep 2018 23:15:23 -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=TNAx4VNBtxEnteG5DW567czbNHUmDeQ47yiQkAcCfa8=; b=AOqfD8KvG4UwRQoYXfA4HNme+ukRINabN6IcyEMYzl6lVcKNWMXYLpuzl7ksiLuT3N upxOU9PD4mTwKuitxO/jmNxc35F2yLP+zSktR+zzPeao259MggUp0fs6kEv0BJjKmwnX MQ1EuBwM9ZvknJNP4o0LKR5PHU2wqrEuQKId+ANpxrW4pT7Ivu59RBZCvrbMbeBkbDHl ZC06eGSeqyC+Rjzk1YZKTUZANq8eOp79+fP9EcQ518VT2WoqjMC4nK6FXk0hN4UiOur/ 3ZzgmKg586VGnR+bD9Bf2einRaF+NZnYdjUgSgHLS5bNrt3aGNhBz8Rf1+NXJ/2BDs0a nehA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.178.230 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APzg51BodAwPSTM6cfHSMZ7oApTRy800iBjMAVGY6BaQ74oKuKzKreQg 2K67l/8j+htpQvrNTPX7hlo8xF/OtyLAB07Wtao+hJWtKUbKDUCrI+UjcW/Fl2x0VgYWtandfXn fPipRoLt5m4qR8B1Pa17mrFx9NyEfiv7af+/ve5LUjl7vo3HLkgzB49KRk+ql7dw= X-Received: by 2002:a50:f1c2:: with SMTP id y2-v6mr2139078edl.21.1537424123234; Wed, 19 Sep 2018 23:15:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaoGOnjASdxPMK4lfno6CELM6xKf79WCJeT2VCQ79tH2vd5LQyiEHUjVZdnkmlhnPIl2zFp X-Received: by 2002:a50:f1c2:: with SMTP id y2-v6mr2138964edl.21.1537424121895; Wed, 19 Sep 2018 23:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537424121; cv=none; d=google.com; s=arc-20160816; b=F2yb2asqdgNb29fqONBjPUGvu9CBA0HZS3h7D7Bu9mQGnWj1uWxzNU++CGLTK+RIuS NGKYFoZYLZ6mCyjmjUXpEH95ObG1ciNjNK2S+vLayFFmXAM7PLEBBQ0VvdtEk0gbHJ+n MCPkTqVc2tozuQzDFsojOT+GC6wN7cgp7qjp6LpWa/ZIX+vc0A24CnqOFke9JK3VicMX ZbFPoDKx4H/IadK5orzKUq9m0FpUvbfcjb6QxjwYukKDq2B/pDnpFERBOKxl1Nwpl+9b 4drKhA3o9Hg14VNTBGHDvC+sB+pQ+01dQvm0aZPw9ulL4j0XApdXZFvA+OVHkKdVxCo2 7u1Q== 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=TNAx4VNBtxEnteG5DW567czbNHUmDeQ47yiQkAcCfa8=; b=N3vemdDQ9/hPOUylsoFiz9FLUFnhjDoUiG8TVlPWzMpaReOYh9uAy3rHSt2nIYvYJj h1IIP38VREDi81r78sTOoqy4dNRf8pkHY9kQiv87SAl/oaX1Z7cdlbS4M/c6DyelnXoJ wMWExmscCAFaglfsIKXn7gXzk6DhxJynv+PLmUIv3wNgucNCMU6xYbnhzZuXBJ/g/0cu EwGko3NGbGOI43qXVxC6Q4vW8GWsQ3XQJDtRte4Z2wy55g9t84pr7DNQiCHTCqZO+KT1 LOU5GeD+t/dIF4CZ3aC4M8g66QGX9sa61SFz/qmmwiXUKVJ+dXSBfvzqwA1u/GcvlMS4 zahA== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.178.230 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay10.mail.gandi.net (relay10.mail.gandi.net. [217.70.178.230]) by mx.google.com with ESMTPS id w33-v6si562089edd.30.2018.09.19.23.15.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:15:21 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.178.230 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.178.230; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.178.230 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 053F5240007; Thu, 20 Sep 2018 06:15:12 +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 10/11] hugetlb: Introduce generic version of huge_ptep_set_access_flags Date: Thu, 20 Sep 2018 06:03:57 +0000 Message-Id: <20180920060358.16606-11-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, ia64, sh, x86 architectures use the same version of huge_ptep_set_access_flags, 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-3level.h | 7 ------- arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h | 7 ------- arch/mips/include/asm/hugetlb.h | 1 + arch/parisc/include/asm/hugetlb.h | 1 + arch/powerpc/include/asm/hugetlb.h | 1 + arch/sh/include/asm/hugetlb.h | 7 ------- arch/sparc/include/asm/hugetlb.h | 1 + arch/x86/include/asm/hugetlb.h | 7 ------- include/asm-generic/hugetlb.h | 9 +++++++++ 10 files changed, 14 insertions(+), 28 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index 8247cd6a2ac6..54e4b097b1f5 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -37,11 +37,4 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return retval; } -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep, - pte_t pte, int dirty) -{ - return ptep_set_access_flags(vma, addr, ptep, pte, dirty); -} - #endif /* _ASM_ARM_HUGETLB_3LEVEL_H */ diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index f4f69ae5466e..80887abcef7f 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -42,6 +42,7 @@ extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS 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/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index 49d1f7949f3a..e9b42750fdf5 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -27,13 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep, - pte_t pte, int dirty) -{ - return ptep_set_access_flags(vma, addr, ptep, pte, dirty); -} - static inline pte_t huge_ptep_get(pte_t *ptep) { return *ptep; diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 3dcf5debf8c4..120adc3b2ffd 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -63,6 +63,7 @@ static inline int huge_pte_none(pte_t pte) return !val || (val == (unsigned long)invalid_pte_table); } +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 9c3950ca2974..165b4e5a6f32 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -43,6 +43,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS 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/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 2a90f387880a..d4d9cf6cb846 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -134,6 +134,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, flush_hugetlb_page(vma, addr); } +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS 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 8df4004977b9..c87195ae0cfa 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -32,13 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep, - pte_t pte, int dirty) -{ - return ptep_set_access_flags(vma, addr, ptep, pte, dirty); -} - static inline pte_t huge_ptep_get(pte_t *ptep) { return *ptep; diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index c41754a113f3..028a1465fbe7 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -40,6 +40,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); } +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS static inline 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/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index a3f781f7a264..574d42eb081e 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -13,13 +13,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep, - pte_t pte, int dirty) -{ - return ptep_set_access_flags(vma, addr, ptep, pte, dirty); -} - static inline pte_t huge_ptep_get(pte_t *ptep) { return *ptep; diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 9b9039845278..f3c99a03ee83 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -110,4 +110,13 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, } #endif +#ifndef __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS +static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, + unsigned long addr, pte_t *ptep, + pte_t pte, int dirty) +{ + return ptep_set_access_flags(vma, addr, ptep, pte, dirty); +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */ From patchwork Thu Sep 20 06:03:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 10606955 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 AA5891390 for ; Thu, 20 Sep 2018 06:16:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98AA128396 for ; Thu, 20 Sep 2018 06:16:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AF3B2D210; Thu, 20 Sep 2018 06:16:33 +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 DA01828396 for ; Thu, 20 Sep 2018 06:16:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2B338E000D; Thu, 20 Sep 2018 02:16:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ED9BC8E0001; Thu, 20 Sep 2018 02:16:31 -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 DA2B68E000D; Thu, 20 Sep 2018 02:16:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 7C58D8E0001 for ; Thu, 20 Sep 2018 02:16:31 -0400 (EDT) Received: by mail-wr1-f71.google.com with SMTP id l15-v6so7972565wrp.8 for ; Wed, 19 Sep 2018 23:16:31 -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=V3kLWP6/R/YGg7tkfCBTKN8gdy8iWA65bLEA1Wn7O/8=; b=f3Uo7m0A4DrzwHb40w/fgV/W0C7imYzoh3nJ48+exKBIG0gOCCCPId+dQ0z/EJGF43 w15Rg0bovSNlxlG8zU1Xsj0vqOcbDfJGGCXyrhMX7+Bp70+nP0TYH2rJELXD5GVl9bO6 GClDUl/MrS1kLTfMz/FqBpNzbX/dkc62cj2sm6aJRN0m7gZ5lxbBmb0gGeMLVzfZxRE3 XmXaKYe/6QuBrrosEJBy5oMLmyWmKLAETGK5NkrSUXFGXBcPVZ9IkvPT3S6Vs/BOTerr Z8QVwYdxfyyLjPSJVev2Xr7l4bQuog54IM0/GaqnSa2u1siADr7QCicJfyjKMWsSq+ak Z9Xw== 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: APzg51DzvzBDwLLmNABJgG3IHR7gUEr2zNoDp2qnkVWZB16DxrhCnpwK vTA5qM4NBjxlpavekqflM85SxhqDLMTT1OWfNGFO3UBwmBl2y/t8M9mlaq+uHtUGC2tJWD76nkW 0ASOlkZCscmohGyXpzScIf6w+bEwpSswIYrcYLSms7BWUYSVEhWyTOV0pKY0lhVg= X-Received: by 2002:a1c:6457:: with SMTP id y84-v6mr975816wmb.100.1537424190989; Wed, 19 Sep 2018 23:16:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZH3Tb3ePGNEEX8vcbcfpm1MWAhkseBCP7QzTOZzNBL77BkpP7xyJHKQsHEb1tiim/sDX6R X-Received: by 2002:a1c:6457:: with SMTP id y84-v6mr975779wmb.100.1537424190147; Wed, 19 Sep 2018 23:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537424190; cv=none; d=google.com; s=arc-20160816; b=wlAFPjEv0ekL710U3OKsrVrCgZUTM21DydzSkjYMHGfSvIdxsGNuQGsD0YC5J90x+4 YIMe8wriHpDFh9XjS/qLMSsHHR/IkQ132htxpw0xW9vT7yDhCiNyZgx4KOg+jn7vwJQD Lv0ZpDIBy9x00SabHne3RWijXOAoRPwirxmPFoP1LHl3daS10xb129lzhlad5/yXYDZw agg+IwmVPb5RIOmcK5+6A0w+8GHZGYPBarMHhbF9vcEqin85h1BOFhrFhuHl/1iyXy84 yHz3rQS3A9QWGBigHrZKZF5XPopm5ZDeJeYy8/jjtLbw/0AraU86tJ3G9DshPXQrdkbB BiYw== 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=V3kLWP6/R/YGg7tkfCBTKN8gdy8iWA65bLEA1Wn7O/8=; b=qzYcQLXakWV7uLuxZsfJTwSrJmRabdJwufFb9u+t41OPY83Q2y+YBON5JcPKTJgB0o qfmGM5ZWot9g2uW1iQOM3poueB3WSjA52uhCxGoX4VHFzCIW4R3UwnyNRjeon04oDdcV euO4YznoO8Y/XbE+9gmgXcgGrGhw1R8Rbt0TBIZG7/S1V/zzxwdqJqaKKt+3YT3r9ddj DLWQc3Quw6oDBM/xGoET+czNWJN8Zxgdt25i8yMp1TdLrf3L4HdH9E/JIzAv4fl8weo1 fN6CCKjuZaQu303RKLYop+9YkMhRIL+vGr4CvNbrOkyxilp5NqjC8uE3lsEfB3lyJlsF Bg4g== 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 z5-v6si997769wmg.191.2018.09.19.23.16.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 23:16:30 -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 2F896C000D; Thu, 20 Sep 2018 06:16:22 +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 11/11] hugetlb: Introduce generic version of huge_ptep_get Date: Thu, 20 Sep 2018 06:03:58 +0000 Message-Id: <20180920060358.16606-12-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 ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the same version of huge_ptep_get, 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-3level.h | 1 + arch/arm64/include/asm/hugetlb.h | 1 + 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, 9 insertions(+), 35 deletions(-) diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h index 54e4b097b1f5..0d9f3918fa7e 100644 --- a/arch/arm/include/asm/hugetlb-3level.h +++ b/arch/arm/include/asm/hugetlb-3level.h @@ -29,6 +29,7 @@ * ptes. * (The valid bit is automatically cleared by set_pte_at for PROT_NONE ptes). */ +#define __HAVE_ARCH_HUGE_PTEP_GET static inline pte_t huge_ptep_get(pte_t *ptep) { pte_t retval = *ptep; diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 80887abcef7f..fb6609875455 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -20,6 +20,7 @@ #include +#define __HAVE_ARCH_HUGE_PTEP_GET static inline pte_t huge_ptep_get(pte_t *ptep) { return READ_ONCE(*ptep); diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h index e9b42750fdf5..36cc0396b214 100644 --- a/arch/ia64/include/asm/hugetlb.h +++ b/arch/ia64/include/asm/hugetlb.h @@ -27,11 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h index 120adc3b2ffd..425bb6fc3bda 100644 --- a/arch/mips/include/asm/hugetlb.h +++ b/arch/mips/include/asm/hugetlb.h @@ -82,11 +82,6 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, return changed; } -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index 165b4e5a6f32..7cb595dcb7d7 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -48,11 +48,6 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, int dirty); -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index d4d9cf6cb846..383da1ab9e23 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -139,11 +139,6 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte, int dirty); -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index c87195ae0cfa..6f025fe18146 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h @@ -32,11 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, { } -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { clear_bit(PG_dcache_clean, &page->flags); diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 028a1465fbe7..3963f80d1cb3 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -53,11 +53,6 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, return changed; } -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index 574d42eb081e..7469d321f072 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -13,11 +13,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, return 0; } -static inline pte_t huge_ptep_get(pte_t *ptep) -{ - return *ptep; -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index f3c99a03ee83..71d7b77eea50 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -119,4 +119,11 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, } #endif +#ifndef __HAVE_ARCH_HUGE_PTEP_GET +static inline pte_t huge_ptep_get(pte_t *ptep) +{ + return *ptep; +} +#endif + #endif /* _ASM_GENERIC_HUGETLB_H */