Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Jinjiang Tu <tujinjiang@huawei.com>,
	sashiko-reviews@lists.linux.dev, akpm@linux-foundation.org,
	ljs@kernel.org, catalin.marinas@arm.com, will@kernel.org,
	mark.rutland@arm.com, ryan.roberts@arm.com, peterx@redhat.com,
	dave.jiang@intel.com, linux-mm@kvack.org
Cc: wangkefeng.wang@huawei.com, sunnanyong@huawei.com
Subject: Re: [PATCH v2 3/4] mm: add spurious fault fixing support for huge pud
Date: Thu, 3 Dec 2026 09:35:02 +0100	[thread overview]
Message-ID: <25f55909-5b67-4561-871f-a921077cd1ae@kernel.org> (raw)
In-Reply-To: <0ca5bbc1-2101-4a13-971d-b5a14e56e5ef@huawei.com>

On 11/18/26 09:45, Jinjiang Tu wrote:
> 
> 在 2026/11/18 10:03, sashiko-bot@kernel.org 写道:
>> Thank you for your contribution! Sashiko AI review found 1 potential
>> issue to consider:
>> - [Low] arm64: mm: unaligned address in
>>    flush_tlb_fix_spurious_fault_pud() flushes 2 PUDs
>> --
>>
>> commit 89132c364112921acce9427dab367c258f86db04
>> Author: Jinjiang Tu <tujinjiang@huawei.com>
>>
>> mm: add spurious fault fixing support for huge pud
>>
>> This commit adds spurious page fault TLB flushing support for huge PUD
>> mappings and implements flush_tlb_fix_spurious_fault_pud() on arm64.
>>
>>> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
>>> index a06b0f5c34111..3c1c000cc5dd1 100644
>>> --- a/arch/arm64/include/asm/pgtable.h
>>> +++ b/arch/arm64/include/asm/pgtable.h
>>> @@ -107,6 +107,10 @@ static inline void arch_leave_lazy_mmu_mode(void)
>>>   	__flush_tlb_range(vma, address, address + PMD_SIZE, PMD_SIZE, 2,	\
>>>   			  TLBF_NOBROADCAST | TLBF_NONOTIFY | TLBF_NOWALKCACHE)
>>>   
>>> +#define flush_tlb_fix_spurious_fault_pud(vma, address, pudp)			\
>>> +	__flush_tlb_range(vma, address, address + PUD_SIZE, PUD_SIZE, 1,	\
>>> +			  TLBF_NOBROADCAST | TLBF_NONOTIFY | TLBF_NOWALKCACHE)
>>> +
>> [Severity: Low]
>> Does flush_tlb_fix_spurious_fault_pud() flush two PUDs instead of one
>> when the fault occurs at a non-zero page offset within the huge PUD?
>>
>> fix_spurious_fault() passes vmf->address, which is only aligned to
>> PAGE_MASK.  __flush_tlb_range() then aligns start and end to stride
>> (PUD_SIZE):
>>
>> arch/arm64/include/asm/tlbflush.h:__flush_tlb_range() {
>>      ...
>> 	start = round_down(start, stride);
>> 	end = round_up(end, stride);
>> 	__do_flush_tlb_range(vma, start, end, stride, tlb_level, flags);
>> }
>>
>> Whenever address is not PUD_SIZE-aligned, round_down(address, PUD_SIZE)
>> and round_up(address + PUD_SIZE, PUD_SIZE) span 2 * PUD_SIZE,
>> invalidating the adjacent PUD range on the local CPU as well.
> 
> Yes, confirmed. flush_tlb_fix_spurious_fault_pmd() has the same issue, which
> is pre-exist. I will fix both in v3.

Thanks, separate fix. It's really low priority.

-- 
Cheers,

David


  reply	other threads:[~2026-12-03  8:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  2:02 [PATCH v2 0/4] arm64: Add PUD THP support for DAX and pfnmap Jinjiang Tu
2026-11-17  2:02 ` [PATCH v2 1/4] mm: define generic pudp_invalidate() implementation Jinjiang Tu
2026-11-17 21:32   ` David Hildenbrand (Arm)
2026-11-17  2:02 ` [PATCH v2 2/4] arm64: simplify pmd_special and pmd_mkspecial Jinjiang Tu
2026-11-17  2:02 ` [PATCH v2 3/4] mm: add spurious fault fixing support for huge pud Jinjiang Tu
2026-11-18  2:03   ` sashiko-bot
2026-11-18  8:45     ` Jinjiang Tu
2026-12-03  8:35       ` David Hildenbrand (Arm) [this message]
2026-11-17  2:02 ` [PATCH v2 4/4] arm64: Add PUD THP support for DAX and pfnmap Jinjiang Tu
2026-12-02 12:23 ` [PATCH v2 0/4] " Abhishek Shinde
2026-12-03  1:16   ` Jinjiang Tu

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=25f55909-5b67-4561-871f-a921077cd1ae@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterx@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sunnanyong@huawei.com \
    --cc=tujinjiang@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@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