public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, ryan.roberts@arm.com
Cc: Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.6.y] arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes
Date: Thu,  6 Mar 2025 14:11:16 -0500	[thread overview]
Message-ID: <20250306120703-d2316e4be6b8a37f@stable.kernel.org> (raw)
In-Reply-To: <20250306150250.154641-1-ryan.roberts@arm.com>

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
❌ Build failures detected
⚠️ Found matching upstream commit but patch is missing proper reference to it

Found matching upstream commit: 49c87f7677746f3c5bd16c81b23700bb6b88bfd4

Note: The patch differs from the upstream commit:
---
1:  49c87f7677746 ! 1:  180bfe1de8d8a arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes
    @@ Commit message
         Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
         Link: https://lore.kernel.org/r/20250226120656.2400136-3-ryan.roberts@arm.com
         Signed-off-by: Will Deacon <will@kernel.org>
    +    (cherry picked from commit 49c87f7677746f3c5bd16c81b23700bb6b88bfd4)
    +    Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
     
      ## arch/arm64/mm/hugetlbpage.c ##
     @@ arch/arm64/mm/hugetlbpage.c: static int find_num_contig(struct mm_struct *mm, unsigned long addr,
    @@ arch/arm64/mm/hugetlbpage.c: static pte_t get_clear_contig(struct mm_struct *mm,
      			     unsigned long pgsize,
      			     unsigned long ncontig)
      {
    --	pte_t orig_pte = __ptep_get(ptep);
    +-	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);
    +-		pte_t pte = ptep_get_and_clear(mm, addr, ptep);
     -
     -		/*
     -		 * If HW_AFDBM is enabled, then the HW could turn on
    @@ arch/arm64/mm/hugetlbpage.c: static pte_t get_clear_contig(struct mm_struct *mm,
     +	pte_t pte, tmp_pte;
     +	bool present;
     +
    -+	pte = __ptep_get_and_clear(mm, addr, ptep);
    ++	pte = ptep_get_and_clear(mm, addr, ptep);
     +	present = pte_present(pte);
     +	while (--ncontig) {
     +		ptep++;
     +		addr += pgsize;
    -+		tmp_pte = __ptep_get_and_clear(mm, addr, ptep);
    ++		tmp_pte = ptep_get_and_clear(mm, addr, ptep);
     +		if (present) {
     +			if (pte_dirty(tmp_pte))
     +				pte = pte_mkdirty(pte);
    @@ arch/arm64/mm/hugetlbpage.c: static pte_t get_clear_contig(struct mm_struct *mm,
      }
      
      static pte_t get_clear_contig_flush(struct mm_struct *mm,
    -@@ arch/arm64/mm/hugetlbpage.c: pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
    +@@ arch/arm64/mm/hugetlbpage.c: pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
      {
      	int ncontig;
      	size_t pgsize;
    --	pte_t orig_pte = __ptep_get(ptep);
    +-	pte_t orig_pte = ptep_get(ptep);
     -
     -	if (!pte_cont(orig_pte))
    --		return __ptep_get_and_clear(mm, addr, ptep);
    +-		return ptep_get_and_clear(mm, addr, ptep);
     -
     -	ncontig = find_num_contig(mm, addr, ptep, &pgsize);
      
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.6.y        |  Success    |  Failed    |

Build Errors:
Build error for stable/linux-6.6.y:
    arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_get_and_clear':
    arch/arm64/mm/hugetlbpage.c:404:35: error: 'sz' undeclared (first use in this function); did you mean 's8'?
      404 |         ncontig = num_contig_ptes(sz, &pgsize);
          |                                   ^~
          |                                   s8
    arch/arm64/mm/hugetlbpage.c:404:35: note: each undeclared identifier is reported only once for each function it appears in
    make[4]: *** [scripts/Makefile.build:243: arch/arm64/mm/hugetlbpage.o] Error 1
    make[4]: Target 'arch/arm64/mm/' not remade because of errors.
    make[3]: *** [scripts/Makefile.build:480: arch/arm64/mm] Error 2
    make[3]: Target 'arch/arm64/' not remade because of errors.
    make[2]: *** [scripts/Makefile.build:480: arch/arm64] Error 2
    make[2]: Target './' not remade because of errors.
    make[1]: *** [/home/sasha/build/linus-next/Makefile:1916: .] Error 2
    make[1]: Target '__all' not remade because of errors.
    make: *** [Makefile:234: __sub-make] Error 2
    make: Target '__all' not remade because of errors.

  reply	other threads:[~2025-03-06 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 16:41 FAILED: patch "[PATCH] mm: hugetlb: Add huge page size param to" failed to apply to 6.6-stable tree gregkh
2025-03-06 14:47 ` [PATCH 6.6.y] mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() Ryan Roberts
2025-03-06 15:02   ` [PATCH 6.6.y] arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes Ryan Roberts
2025-03-06 19:11     ` Sasha Levin [this message]
2025-03-07  9:14       ` Ryan Roberts
2025-03-06 19:11   ` [PATCH 6.6.y] mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() Sasha Levin
2025-03-07  9:11     ` Ryan Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250306120703-d2316e4be6b8a37f@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox