Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F4DA78C7C for ; Fri, 26 Apr 2024 03:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714103857; cv=none; b=ZmQZdM1YPnpwoAszbgUlfGK9fHFZdW+b5ak/DuiTw+L9xGCVhxCq//MSVgVCjm2PweEMsoVQAIuSN/EudfDt/8t/WgCG0YBvNGCU7F15Gs+pBAwKMwHjkZq1+a3+vpmnZg0XQusrza5qJvXzWbizOEd6G8eoFqZLuor33a1kSqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714103857; c=relaxed/simple; bh=Y7ENxpRll1t8yzCO+vi9z/ULb5PcMWN5QcXXdXgh7kA=; h=Date:To:From:Subject:Message-Id; b=HsABCXvsdLFSZYIT+QbG2JmRL+M1CvfeyRfEu/ZJMrBN88m5g9mX4K2Z4u2BeDjHBqpObJFS6igp0UPoDKlNv5M61tFjkR61cpv8AUFpPZyfDi2diat2BhUVRF4qvBpM/nMEOU35pd87GEdVU+PsBhpqOum6AfyRXpmu1kZL9fw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=jCaXI3RX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="jCaXI3RX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D5A6C113CD; Fri, 26 Apr 2024 03:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1714103857; bh=Y7ENxpRll1t8yzCO+vi9z/ULb5PcMWN5QcXXdXgh7kA=; h=Date:To:From:Subject:From; b=jCaXI3RXqIahgIxewdYrx/VK27A6TwjsutNLePeJ8rxvCgDwhkyOpQkexTA353rRD etLj/ENaguDSj3Z2TbzyfzvXcJcme9RyyCT4kFbqPXE0racQr1h7nNoDLnSzs6Ymw4 nXAoVgjfUCx3ncaFwBTs+XSRkkI9b2PWS2Ii8eY4= Date: Thu, 25 Apr 2024 20:57:36 -0700 To: mm-commits@vger.kernel.org,willy@infradead.org,will@kernel.org,tglx@linutronix.de,shawnguo@kernel.org,rppt@kernel.org,npiggin@gmail.com,naveen.n.rao@linux.ibm.com,nao.horiguchi@gmail.com,muchun.song@linux.dev,msalter@redhat.com,mpe@ellerman.id.au,mingo@redhat.com,l.stach@pengutronix.de,linux@armlinux.org.uk,krzysztof.kozlowski@linaro.org,konrad.dybcio@linaro.org,jgg@nvidia.com,festevam@denx.de,davem@davemloft.net,dave.hansen@linux.intel.com,christophe.leroy@csgroup.eu,catalin.marinas@arm.com,bp@alien8.de,arnd@arndb.de,apopple@nvidia.com,aneesh.kumar@kernel.org,andreas@gaisler.com,andersson@kernel.org,peterx@redhat.com,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] mm-arm64-merge-pxd_huge-and-pxd_leaf-definitions.patch removed from -mm tree Message-Id: <20240426035737.4D5A6C113CD@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: mm/arm64: merge pXd_huge() and pXd_leaf() definitions has been removed from the -mm tree. Its filename was mm-arm64-merge-pxd_huge-and-pxd_leaf-definitions.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Peter Xu Subject: mm/arm64: merge pXd_huge() and pXd_leaf() definitions Date: Mon, 18 Mar 2024 16:03:58 -0400 Unlike most archs, aarch64 defines pXd_huge() and pXd_leaf() slightly differently. Redefine the pXd_huge() with pXd_leaf(). There used to be two traps for old aarch64 definitions over these APIs that I found when reading the code around, they're: (1) 4797ec2dc83a ("arm64: fix pud_huge() for 2-level pagetables") (2) 23bc8f69f0ec ("arm64: mm: fix p?d_leaf()") Define pXd_huge() with the current pXd_leaf() will make sure (2) isn't a problem (on PROT_NONE checks). To make sure it also works for (1), we move over the __PAGETABLE_PMD_FOLDED check to pud_leaf(), allowing it to constantly returning "false" for 2-level pgtables, which looks even safer to cover both now. Link: https://lkml.kernel.org/r/20240318200404.448346-9-peterx@redhat.com Signed-off-by: Peter Xu Cc: Muchun Song Cc: Mark Salter Cc: Catalin Marinas Cc: Will Deacon Cc: Alistair Popple Cc: Andreas Larsson Cc: "Aneesh Kumar K.V" Cc: Arnd Bergmann Cc: Bjorn Andersson Cc: Borislav Petkov Cc: Christophe Leroy Cc: Dave Hansen Cc: David S. Miller Cc: Fabio Estevam Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Konrad Dybcio Cc: Krzysztof Kozlowski Cc: Lucas Stach Cc: "Matthew Wilcox (Oracle)" Cc: Michael Ellerman Cc: Mike Rapoport (IBM) Cc: Naoya Horiguchi Cc: "Naveen N. Rao" Cc: Nicholas Piggin Cc: Russell King Cc: Shawn Guo Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- arch/arm64/include/asm/pgtable.h | 4 ++++ arch/arm64/mm/hugetlbpage.c | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) --- a/arch/arm64/include/asm/pgtable.h~mm-arm64-merge-pxd_huge-and-pxd_leaf-definitions +++ a/arch/arm64/include/asm/pgtable.h @@ -709,7 +709,11 @@ static inline unsigned long pmd_page_vad #define pud_none(pud) (!pud_val(pud)) #define pud_bad(pud) (!pud_table(pud)) #define pud_present(pud) pte_present(pud_pte(pud)) +#ifndef __PAGETABLE_PMD_FOLDED #define pud_leaf(pud) (pud_present(pud) && !pud_table(pud)) +#else +#define pud_leaf(pud) false +#endif #define pud_valid(pud) pte_valid(pud_pte(pud)) #define pud_user(pud) pte_user(pud_pte(pud)) #define pud_user_exec(pud) pte_user_exec(pud_pte(pud)) --- a/arch/arm64/mm/hugetlbpage.c~mm-arm64-merge-pxd_huge-and-pxd_leaf-definitions +++ a/arch/arm64/mm/hugetlbpage.c @@ -81,16 +81,12 @@ bool arch_hugetlb_migration_supported(st int pmd_huge(pmd_t pmd) { - return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT); + return pmd_leaf(pmd); } int pud_huge(pud_t pud) { -#ifndef __PAGETABLE_PMD_FOLDED - return pud_val(pud) && !(pud_val(pud) & PUD_TABLE_BIT); -#else - return 0; -#endif + return pud_leaf(pud); } static int find_num_contig(struct mm_struct *mm, unsigned long addr, _ Patches currently in -mm which might be from peterx@redhat.com are mm-userfaultfd-reset-ptes-when-close-for-wr-protected-ones.patch mm-hugetlb-assert-hugetlb_lock-in-__hugetlb_cgroup_commit_charge.patch mm-page_table_check-support-userfault-wr-protect-entries.patch