Skip to contentSkip to conversation

riscv: mm: fix regression due to update_mmu_cache change

PATCH Applied Sergey Matyukevich 3 participants 3 messages Jan 29, 2023 – Feb 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: mm: fix regression due to update_mmu_cache change

From: Sergey Matyukevich <[email protected]>

This is a partial revert of the commit 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates"). Original commit included two loosely related changes serving the same purpose of fixing stale TLB entries causing user-space application crash:
- introduce deferred per-ASID TLB flush for CPUs not running the task
- switch to per-ASID TLB flush on all CPUs running the task in update_mmu_cache

According to report and discussion in [1], the second part caused a regression on Renesas RZ/Five SoC. For now restore the old behavior of the update_mmu_cache.

[1] https://lore.kernel.org/linux-riscv/[email protected]/

Fixes 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates")
---
 arch/riscv/include/asm/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
index 4eba9a98d0e3..4c3c130ee328 100644
@@ -415,7 +415,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
 	 * Relying on flush_tlb_fix_spurious_fault would suffice, but
 	 * the extra traps reduce performance.  So, eagerly SFENCE.VMA.
 	 */
-	flush_tlb_page(vma, address);
+	local_flush_tlb_page(address);
 }
 
 #define __HAVE_ARCH_UPDATE_MMU_TLB
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Sergey Matyukevich

From: Sergey Matyukevich <[email protected]>

This is a partial revert of the commit 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates"). Original commit included two loosely related changes serving the same purpose of fixing stale TLB entries causing user-space application crash:
- introduce deferred per-ASID TLB flush for CPUs not running the task
- switch to per-ASID TLB flush on all CPUs running the task in update_mmu_cache

Quoted 5 lines

According to report and discussion in [1], the second part caused a regression on Renesas RZ/Five SoC. For now restore the old behavior of the update_mmu_cache.

[1] https://lore.kernel.org/linux-riscv/[email protected]/

If you respin for another reason, can you convert this into a "regular"
Link: trailer, so that it can be parsed with git's trailer functionality? IOW, like so:

Otherwise, glad to see you two get this sorted out, even if it is just a revert.

Thanks,
Conor.

Quoted 23 lines
Fixes 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates")
---
 arch/riscv/include/asm/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
index 4eba9a98d0e3..4c3c130ee328 100644
@@ -415,7 +415,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
 	 * Relying on flush_tlb_fix_spurious_fault would suffice, but
 	 * the extra traps reduce performance.  So, eagerly SFENCE.VMA.
 	 */
-	flush_tlb_page(vma, address);
+	local_flush_tlb_page(address);
 }
 
 #define __HAVE_ARCH_UPDATE_MMU_TLB
Signature · 1 line
2.39.0
#2 lore raw
In reply to Sergey Matyukevich
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 10 lines · On Mon, 30 Jan 2023 00:18:18 +0300 you wrote:

From: Sergey Matyukevich <[email protected]>

This is a partial revert of the commit 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates"). Original commit included two loosely related changes serving the same purpose of fixing stale TLB entries causing user-space application crash:
- introduce deferred per-ASID TLB flush for CPUs not running the task
- switch to per-ASID TLB flush on all CPUs running the task in update_mmu_cache

[...]

Here is the summary with links:
- riscv: mm: fix regression due to update_mmu_cache change

    https://git.kernel.org/riscv/c/b49f700668ff

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html