From patchwork Fri Aug 2 15:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 13751628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F1C4C52D6F for ; Fri, 2 Aug 2024 15:20:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB0476B0096; Fri, 2 Aug 2024 11:20:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A619A6B0098; Fri, 2 Aug 2024 11:20:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 901FA6B0099; Fri, 2 Aug 2024 11:20:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 731726B0096 for ; Fri, 2 Aug 2024 11:20:46 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 189974129F for ; Fri, 2 Aug 2024 15:20:46 +0000 (UTC) X-FDA: 82407667692.05.9A73749 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by imf28.hostedemail.com (Postfix) with ESMTP id 2A096C0024 for ; Fri, 2 Aug 2024 15:20:43 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=QKXsyBZ3; spf=pass (imf28.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722611967; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fMaYL2MnyzMLNeppKABE7xd1gAuHqwYBgzfb7XbILdY=; b=0pB+kch4RdVyxLFdOkWbsfIXdMaF98igT2fZP/H6FQbjtVU7cjc9B+9Me408PmnvpFU9dI D5KqOOGlRFQlRorzqt3evT0JquTyxACe3YrXbmQkv/WgkorraeTMqIZzxp1fvP24NDmKwb yRXyC7MilgGypea8ioor+nENyP5RF7I= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=QKXsyBZ3; spf=pass (imf28.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722611967; a=rsa-sha256; cv=none; b=lDEUQgJssPtqijvg33e5Gozf7goOw4HVUFFwUPhWXkZm70YDjQA1Ghg6NQr8ugDeC+qbI1 76IopLLaVeSznfC6AWilEjVcgZS6p+2kjlAT2nEopTBKzJHR1D+JNvdZ2gn2v1+o6FOAU+ XYx5s8o3Lr+4I54Va81SgmtUiSwyJVE= Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-36887ca3da2so3849490f8f.2 for ; Fri, 02 Aug 2024 08:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1722612043; x=1723216843; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fMaYL2MnyzMLNeppKABE7xd1gAuHqwYBgzfb7XbILdY=; b=QKXsyBZ3NPGLrJ941lxhCwrCDncCc20X5tGGTbmehcB7IPMvd5vGqXlQz6tPZemi7W 2Ge07nmMhnvJnh1pxupFq99bvBUZXLsVRODE0q9bC7cnkgiMA6FwxgdEssIxvNPRIztL v/IoOnWYPKK9miYhesL1DOUCNlm+580UjTMggDVoornn29RT/YewpWxYMEamVX5fs4IB zsUeezrC/6bAuQuinrzOTJEvHn+bdDtgcbhWeZWdyuGB0E4rQ6LmiISUs/lbURC1NduW cGPpBRtsNsHU/IpbMObdraYhIl6YH2bGKLcTqXE0I5d1RjibSn6F2sd9bxz2vqPCcF7H lZEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722612043; x=1723216843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fMaYL2MnyzMLNeppKABE7xd1gAuHqwYBgzfb7XbILdY=; b=SdNt4qqRPOJC2Y5DzQQXuCU4ZofmeQ6ZDVZ7T2hfx5vIrr4Iv5egyNllUyeOtI/yZn LNQ6q4xLr/oJvhM/9DhXj6wXqcMNUPuLXBJFymcuRT6EpqEkedjv3SecaRTEhNyqaa4C fXMtEoEBKE1By0NKG1OrxLURLG0nGsSCINZEn2eoiUyLL7eW23/W1Htr4ACMfVq7ksgX EHRl189I/aHEIvRhb4bHJTPijm+HZdiI2i1cbSTVvtIxdShroWPuSzUHYffSRyZ+mHUd SHvGOYc3olheLCCfOcWBdOmyxbL8/v6VIff8m7vvO+LUMq4m4uaBoazwPzx8t+CtNFA6 el1w== X-Forwarded-Encrypted: i=1; AJvYcCWbpCVxFWQqwAaTbRuK9yAN7JLtxbQc/JJ6lil1v8Qk9UBYFxeO621oy6AaucqeJtlgKxHfVkcvLxbIBClwDZbSYcU= X-Gm-Message-State: AOJu0YxWkmLaCtJhT/1ECTQgs1brXMgKTqDduOVRlsm88hNWNq0eIKDs f7M8BYud6PN8mYrmhbPIUTH3nCSm4dF6xxEN25GToO40NAk/bTL/1Jnn9dP3YUo= X-Google-Smtp-Source: AGHT+IGTa0t3MKbLVg4kZPwSxPiJXdJvhDxgkhF/gxXss7ykdb1ycHNk2hMqIUX7HnfDufjyI9Oq4w== X-Received: by 2002:adf:fc03:0:b0:368:37ac:3f95 with SMTP id ffacd0b85a97d-36bbc11bb28mr2076124f8f.31.1722612042502; Fri, 02 Aug 2024 08:20:42 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd06d078sm2177020f8f.94.2024.08.02.08.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 08:20:42 -0700 (PDT) From: Alexandre Ghiti To: Catalin Marinas , Will Deacon , Ryan Roberts , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mm@kvack.org Cc: Alexandre Ghiti Subject: [PATCH v3 6/9] mm: Use common huge_ptep_get_and_clear() function for riscv/arm64 Date: Fri, 2 Aug 2024 17:14:27 +0200 Message-Id: <20240802151430.99114-7-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240802151430.99114-1-alexghiti@rivosinc.com> References: <20240802151430.99114-1-alexghiti@rivosinc.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2A096C0024 X-Stat-Signature: ogqkxq6puy186tantag3rwtqxxj6zig6 X-Rspam-User: X-HE-Tag: 1722612043-795369 X-HE-Meta: U2FsdGVkX19UbFYG+ad40sRcUfNPAOwkvJUncYlkQtL1T8iDrBK6lra6yohoMZVxox6Jxxy84D2nERqvh3U2/o7rh6amjpzC3rO6B38/uR+wXdmgwYwuCwKbyes+Tjhs4nrnNhi9oljdHVrw4edtwNIXWsEFDbo2O2AuHAx4hJqxSww7AKQI4MuUB/rhpi8CxJhtNjp6qZ6GkcSu6Y9+uMS+OLIPbZvvETmj+QkyTaAyzvFSL6Gjsq7Kg2mFULe+nhQLNS2wKEjLfXFS/17V96I2umjg5d4TQ0sTU3PeuukXPZYfIFYL4HjtvLjVKN7x1AdI42AKs55BtgejUy1cccsKDiv7lJVJ21uVhwRm/Pd4kyPdnaqqDoG7jkmh3dMTZKVuv8oW+ntsFVDge8HcirxLWjxyyEqyk8eSdYj2xM/vRmPtCotkbNwg6c9WlN8I1g1+kPVrDlD7hJj5GF0qEia7b3SZM/21GcAS6UY39E31zDxjPhwKgQfMjG2M7Ma9aFGOQeZ+SaYEVwaXiZPtRIa/uiTgouHFQqtQUC7XglfdCJmS95I/U7860EJC/3vMZm9j3YAZWRf6kX6QyAcXsvLZdRfNK2ROkrdT/MiQjnjBNVOYIXxL6t6+EdygO6RElM46wKJQ1dTBK9u1pgg+4o4antsv4s5NDSnqJNUcer7+T+BGyzN4h5dCquFwolR9mKmNEQHSBU8Cf8Zj2+Ae9MDxSVscDb8DsAB0FoU7h88DECMWg9tDKpxZd21FGgb2Df4E6wUob5M6XzUcwYkc8xgo/yaWFQW0GUJy4SCi6DnuCsktLc+Pzqd3KNkIYc4pCLKElLEELfaS1Fb9naQ/x+U7jPF3z83wniTX9FAbYPb3hRxIphdC7mfCqC5h1uLChkijNmLkQsALoUZnnU3BJ/NOyms5/sq4BWGGpwUMRBdDMiBIgkjZAQeaULm9AC2xtz8TipoWSYeG6PRU4um k75fwU0d Bj1e50uagsrj0P9Wup9ZHUvm0ZocvvI64q39tooHW4YS6aMj8wSdwSnvetuKuRQiKXIhXQgaK5/qnRxYK5yeQe2DXtxaUN2Bgp2h52eLxUxU0VsqCpGktlMnN+1lgBpmu1OxFQFkjUPaOFhkotpulSU7BrvB2JZ461f1JFXi0xn7KGfKC90R8NhhtmHOcdQJSbYkue8u4a6GCsJ67/9dmf3MfH07ufym5XtS7QIcqBt3v8m/x2OnOrITgGYo7wE28ubyOtdSemT0ngis9irP9tXgPmHJofWngzwUcvZL4UuKGDCCpxE/ZYY0bxiG7064/y9USYQ2p4SzzxKBgmctK3bksgDPsZUIFe21q6Vzd5djXqHtta3QFl/88Xy4AfKmO+Y247mbDE3zmlhCFYYuaN6250g== 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: List-Subscribe: List-Unsubscribe: After some adjustments, both architectures have the same implementation so move it to the generic code. Note that get_clear_contig() function is duplicated in the generic and the arm64 code because it is still used by some arm64 functions that will, in the next commits, be moved to the generic code. Once all have been moved, the arm64 version will be removed. Signed-off-by: Alexandre Ghiti --- arch/arm64/include/asm/hugetlb.h | 3 -- arch/arm64/include/asm/pgtable.h | 15 ++++++++-- arch/arm64/mm/hugetlbpage.c | 19 ++----------- arch/riscv/include/asm/hugetlb.h | 4 --- arch/riscv/include/asm/pgtable.h | 4 ++- arch/riscv/mm/hugetlbpage.c | 23 ++++----------- include/linux/hugetlb_contpte.h | 4 +++ mm/hugetlb_contpte.c | 48 ++++++++++++++++++++++++++++++-- 8 files changed, 72 insertions(+), 48 deletions(-) diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index fab0afbe4eea..04117a84dc04 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -31,9 +31,6 @@ pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags); 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); #define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT extern void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep); diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 2a6a01b447df..4b277ff9810d 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1766,12 +1766,23 @@ static inline void clear_young_dirty_ptes(struct vm_area_struct *vma, #endif /* CONFIG_ARM64_CONTPTE */ -static inline int arch_contpte_get_num_contig(pte_t *ptep, - unsigned long size, +extern int find_num_contig(struct mm_struct *mm, unsigned long addr, + pte_t *ptep, size_t *pgsize); + +static inline int arch_contpte_get_num_contig(struct mm_struct *mm, + unsigned long addr, + pte_t *ptep, unsigned long size, size_t *pgsize) { int contig_ptes = 0; + /* + * If the size is not passed, we need to go through the page table to + * find out the number of contiguous ptes. + */ + if (size == 0) + return find_num_contig(mm, addr, ptep, pgsize); + if (pgsize) *pgsize = size; diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 495f706e0170..2f3753c10c1f 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -79,8 +79,8 @@ bool arch_hugetlb_migration_supported(struct hstate *h) } #endif -static int find_num_contig(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, size_t *pgsize) +int find_num_contig(struct mm_struct *mm, unsigned long addr, + pte_t *ptep, size_t *pgsize) { pgd_t *pgdp = pgd_offset(mm, addr); p4d_t *p4dp; @@ -266,21 +266,6 @@ pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags) return entry; } -pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, pte_t *ptep) -{ - int ncontig; - size_t pgsize; - pte_t orig_pte = __ptep_get(ptep); - - if (!pte_cont(orig_pte)) - return __ptep_get_and_clear(mm, addr, ptep); - - ncontig = find_num_contig(mm, addr, ptep, &pgsize); - - return get_clear_contig(mm, addr, ptep, pgsize, ncontig); -} - /* * huge_ptep_set_access_flags will update access flags (dirty, accesssed) * and write permission. diff --git a/arch/riscv/include/asm/hugetlb.h b/arch/riscv/include/asm/hugetlb.h index ca9930cdf2e6..0fbb6b19df79 100644 --- a/arch/riscv/include/asm/hugetlb.h +++ b/arch/riscv/include/asm/hugetlb.h @@ -20,10 +20,6 @@ bool arch_hugetlb_migration_supported(struct hstate *h); #endif #ifdef CONFIG_RISCV_ISA_SVNAPOT -#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); - #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep); diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 5ab0559b0bd2..13e89348a46a 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -584,7 +584,9 @@ static inline void __set_ptes(struct mm_struct *mm, unsigned long addr, } #ifdef CONFIG_RISCV_ISA_SVNAPOT -static inline int arch_contpte_get_num_contig(pte_t *ptep, unsigned long size, +static inline int arch_contpte_get_num_contig(struct mm_struct *mm, + unsigned long addr, + pte_t *ptep, unsigned long size, size_t *pgsize) { unsigned long hugepage_shift; diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index e2093e7266a5..b44023336fd9 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -186,7 +186,8 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, if (!pte_napot(pte)) return ptep_set_access_flags(vma, addr, ptep, pte, dirty); - pte_num = arch_contpte_get_num_contig(ptep, 0, NULL); + pte_num = arch_contpte_get_num_contig(vma->vm_mm, addr, ptep, 0, NULL); + orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num); if (pte_dirty(orig_pte)) @@ -200,21 +201,6 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, return true; } -pte_t huge_ptep_get_and_clear(struct mm_struct *mm, - unsigned long addr, - pte_t *ptep) -{ - pte_t orig_pte = ptep_get(ptep); - int pte_num; - - if (!pte_napot(orig_pte)) - return ptep_get_and_clear(mm, addr, ptep); - - pte_num = arch_contpte_get_num_contig(ptep, 0, NULL); - - return get_clear_contig(mm, addr, ptep, pte_num); -} - void huge_ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) @@ -228,7 +214,8 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm, return; } - pte_num = arch_contpte_get_num_contig(ptep, 0, NULL); + pte_num = arch_contpte_get_num_contig(mm, addr, ptep, 0, NULL); + orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num); orig_pte = pte_wrprotect(orig_pte); @@ -246,7 +233,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, if (!pte_napot(pte)) return ptep_clear_flush(vma, addr, ptep); - pte_num = arch_contpte_get_num_contig(ptep, 0, NULL); + pte_num = arch_contpte_get_num_contig(vma->vm_mm, addr, ptep, 0, NULL); return get_clear_contig_flush(vma->vm_mm, addr, ptep, pte_num); } diff --git a/include/linux/hugetlb_contpte.h b/include/linux/hugetlb_contpte.h index d9892a047b2b..20d3a3e14e14 100644 --- a/include/linux/hugetlb_contpte.h +++ b/include/linux/hugetlb_contpte.h @@ -18,4 +18,8 @@ extern void set_huge_pte_at(struct mm_struct *mm, extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz); +#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); + #endif /* _LINUX_HUGETLB_CONTPTE_H */ diff --git a/mm/hugetlb_contpte.c b/mm/hugetlb_contpte.c index b9634ffa1bad..9df98d1a59a1 100644 --- a/mm/hugetlb_contpte.c +++ b/mm/hugetlb_contpte.c @@ -22,6 +22,7 @@ * - huge_ptep_get() * - set_huge_pte_at() * - huge_pte_clear() + * - huge_ptep_get_and_clear() */ pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep) @@ -32,7 +33,7 @@ pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep) if (!pte_present(orig_pte) || !pte_cont(orig_pte)) return orig_pte; - ncontig = arch_contpte_get_num_contig(ptep, + ncontig = arch_contpte_get_num_contig(mm, addr, ptep, page_size(pte_page(orig_pte)), NULL); @@ -86,7 +87,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, int i; int ncontig; - ncontig = arch_contpte_get_num_contig(ptep, sz, &pgsize); + ncontig = arch_contpte_get_num_contig(mm, addr, ptep, sz, &pgsize); if (!pte_present(pte)) { for (i = 0; i < ncontig; i++, ptep++, addr += pgsize) @@ -110,8 +111,49 @@ void huge_pte_clear(struct mm_struct *mm, unsigned long addr, int i, ncontig; size_t pgsize; - ncontig = arch_contpte_get_num_contig(ptep, sz, &pgsize); + ncontig = arch_contpte_get_num_contig(mm, addr, ptep, sz, &pgsize); for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) __pte_clear(mm, addr, ptep); } + +static pte_t get_clear_contig(struct mm_struct *mm, + unsigned long addr, + pte_t *ptep, + unsigned long pgsize, + unsigned long ncontig) +{ + pte_t orig_pte = __ptep_get(ptep); + unsigned long i; + + for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) { + pte_t pte = __ptep_get_and_clear(mm, addr, ptep); + + /* + * If HW_AFDBM (arm64) or Svadu (riscv) is enabled, then the HW + * could turn on the dirty or accessed bit for any page in the + * set, so check them all. + */ + if (pte_dirty(pte)) + orig_pte = pte_mkdirty(orig_pte); + + if (pte_young(pte)) + orig_pte = pte_mkyoung(orig_pte); + } + return orig_pte; +} + +pte_t huge_ptep_get_and_clear(struct mm_struct *mm, + unsigned long addr, pte_t *ptep) +{ + int ncontig; + size_t pgsize; + pte_t orig_pte = __ptep_get(ptep); + + if (!pte_cont(orig_pte)) + return __ptep_get_and_clear(mm, addr, ptep); + + ncontig = arch_contpte_get_num_contig(mm, addr, ptep, 0, &pgsize); + + return get_clear_contig(mm, addr, ptep, pgsize, ncontig); +}