Message ID | mhng-e4523e07-f5ae-4f8b-9eec-8422b05700f4@palmer-ri-x1c9 (mailing list archive) |
---|---|
State | Accepted |
Commit | 4a1d8ababde685a77fd4fd61e58f973cbdf29f8c |
Headers | show |
Series | [GIT,PULL] RISC-V Patches for the 6.15 Merge Window, Part 1 | expand |
On Fri, 4 Apr 2025 at 08:58, Palmer Dabbelt <palmer@rivosinc.com> wrote: > > --- a/arch/riscv/mm/tlbflush.c > +++ b/arch/riscv/mm/tlbflush.c > @@ -192,10 +192,9 @@ bool arch_tlbbatch_should_defer(struct mm_struct *mm) > void arch_tlbbatch_add_pending(struct arch_tlbflush_unmap_batch *batch, > struct mm_struct *mm, unsigned long start, unsigned long end) > { > - unsigned long start = uaddr & PAGE_MASK; > - > cpumask_or(&batch->cpumask, &batch->cpumask, mm_cpumask(mm)); > - mmu_notifier_arch_invalidate_secondary_tlbs(mm, start, start + PAGE_SIZE); > + mmu_notifier_arch_invalidate_secondary_tlbs(mm, start & PAGE_MASK, > + (end & PAGE_MASK) + PAGE_SIZE); > } That just seems wrong. All the PAGE_MASK and PAGE_SIZE games look entirely wrong and pointless. As far as I can tell, the code should just call mmu_notifier_arch_invalidate_secondary_tlbs() with the completely unmodified start and end values. They should already be page-aligned, and 'end' is already the 'one past' thing, not the final byte. And maybe I'm missing something and my resolution is wrong, but that's what I did. Somebody should obviously test it. Linus
The pull request you sent on Fri, 04 Apr 2025 08:58:06 -0700 (PDT):
> git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-6.15-mw1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4a1d8ababde685a77fd4fd61e58f973cbdf29f8c
Thank you!
Hello: This pull request was applied to riscv/linux.git (fixes) by Linus Torvalds <torvalds@linux-foundation.org>: On Fri, 04 Apr 2025 08:58:06 -0700 (PDT) you wrote: > The following changes since commit 4701f33a10702d5fc577c32434eb62adde0a1ae1: > > Linux 6.14-rc7 (2025-03-16 12:55:17 -1000) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-6.15-mw1 > > [...] Here is the summary with links: - [GIT,PULL] RISC-V Patches for the 6.15 Merge Window, Part 1 https://git.kernel.org/riscv/c/4a1d8ababde6 You are awesome, thank you!
Hello: This pull request was applied to riscv/linux.git (for-next) by Linus Torvalds <torvalds@linux-foundation.org>: On Fri, 04 Apr 2025 08:58:06 -0700 (PDT) you wrote: > The following changes since commit 4701f33a10702d5fc577c32434eb62adde0a1ae1: > > Linux 6.14-rc7 (2025-03-16 12:55:17 -1000) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-6.15-mw1 > > [...] Here is the summary with links: - [GIT,PULL] RISC-V Patches for the 6.15 Merge Window, Part 1 https://git.kernel.org/riscv/c/4a1d8ababde6 You are awesome, thank you!
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index c25a40aa2fe0..c22d5eb2b185 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -192,10 +192,9 @@ bool arch_tlbbatch_should_defer(struct mm_struct *mm) void arch_tlbbatch_add_pending(struct arch_tlbflush_unmap_batch *batch, struct mm_struct *mm, unsigned long start, unsigned long end) { - unsigned long start = uaddr & PAGE_MASK; - cpumask_or(&batch->cpumask, &batch->cpumask, mm_cpumask(mm)); - mmu_notifier_arch_invalidate_secondary_tlbs(mm, start, start + PAGE_SIZE); + mmu_notifier_arch_invalidate_secondary_tlbs(mm, start & PAGE_MASK, + (end & PAGE_MASK) + PAGE_SIZE); } void arch_flush_tlb_batched_pending(struct mm_struct *mm)