[PATCH 06/22] loongarch: mm: use mm_is_kernel() in switch_mm_irqs_off()
Kevin Brodsky <[email protected]> Tue, 14 Jul 2026 15:03:55 +0100
| Newsgroups | gmane.linux.uml.devel,gmane.linux.kernel.mm,gmane.linux.ports.arm.kernel,gmane.linux.ports.parisc,gmane.linux.ports.ppc64.devel,gmane.linux.ports.riscv,gmane.linux.ports.sparc,gmane.comp.boot-loaders.tboot.devel,gmane.linux.kernel.efi,gmane.linux.kernel,gmane.linux.kernel.cross-arch |
|---|---|
| Message-ID | <[email protected]> |
The new MMF_KERNEL flag identifies kernel-owned mm's. Checking the flag with mm_is_kernel() is preferred over comparing directly against &init_mm. No functional change, as only init_mm has MMF_KERNEL set for now. Assisted-by: Codex:GPT-5.5 Signed-off-by: Kevin Brodsky <[email protected]> --- arch/loongarch/include/asm/mmu_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/mmu_context.h b/arch/loongarch/include/asm/mmu_context.h index 304363bd3935..6d51f11427b4 100644 --- a/arch/loongarch/include/asm/mmu_context.h +++ b/arch/loongarch/include/asm/mmu_context.h @@ -95,7 +95,7 @@ static inline void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct * if (!asid_valid(next, cpu)) get_new_mmu_context(next, cpu, &need_flush); - if (next != &init_mm) + if (!mm_is_kernel(next)) atomic_update_pgd_asid(cpu_asid(cpu, next), (unsigned long)next->pgd); else atomic_update_pgd_asid(cpu_asid(cpu, next), (unsigned long)invalid_pg_dir); -- 2.51.2