From 32fefda9c61dd8e6c1a0f9d94aa2d162c22a102f Mon Sep 17 00:00:00 2001 From: visa Date: Mon, 29 May 2017 14:03:46 +0000 Subject: [PATCH] Reduce code duplication. The local-CPU-only case is now handled without a lock in smp_rendezvous_cpus(). --- sys/arch/mips64/mips64/pmap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c index 3044c96bc24..16e59d35ecc 100644 --- a/sys/arch/mips64/mips64/pmap.c +++ b/sys/arch/mips64/mips64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.102 2017/05/27 06:23:49 visa Exp $ */ +/* $OpenBSD: pmap.c,v 1.103 2017/05/29 14:03:46 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -228,7 +228,6 @@ void pmap_invalidate_icache(pmap_t pmap, vaddr_t va, pt_entry_t entry) { struct pmap_invalidate_icache_arg ii_args; - unsigned long cpuid = cpu_number(); unsigned long cpumask = 0; struct cpu_info *ci; CPU_INFO_ITERATOR cii; @@ -238,12 +237,7 @@ pmap_invalidate_icache(pmap_t pmap, vaddr_t va, pt_entry_t entry) pmap->pm_asid[ci->ci_cpuid].pma_asidgen != 0) cpumask |= 1ul << ci->ci_cpuid; } - - if (cpumask == 1ul << cpuid) { - ci = curcpu(); - Mips_SyncDCachePage(ci, va, pfn_to_pad(entry)); - Mips_InvalidateICache(ci, va, PAGE_SIZE); - } else if (cpumask != 0) { + if (cpumask != 0) { ii_args.va = va; ii_args.entry = entry; smp_rendezvous_cpus(cpumask, pmap_invalidate_icache_action, -- 2.20.1