From 4414871fba5b271470fa8c40799165f2924ecf1d Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 21 Jul 2020 17:18:38 +0000 Subject: [PATCH] Avoid code duplicaiton by using ipi_selected(). MFC after: 2 weeks --- sys/amd64/amd64/mp_machdep.c | 8 +------- sys/i386/i386/mp_machdep.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index ca95013d9c0..b4cc7ab829a 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -696,13 +696,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, CPU_CLR(PCPU_GET(cpuid), &other_cpus); } else { other_cpus = mask; - while ((cpu = CPU_FFS(&mask)) != 0) { - cpu--; - CPU_CLR(cpu, &mask); - CTR3(KTR_SMP, "%s: cpu: %d invl ipi op: %x", __func__, - cpu, op); - ipi_send_cpu(cpu, IPI_INVLOP); - } + ipi_selected(mask, IPI_INVLOP); } curcpu_cb(pmap, addr1, addr2); while ((cpu = CPU_FFS(&other_cpus)) != 0) { diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 8ab16d12953..acdb4019743 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -536,13 +536,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, CPU_CLR(PCPU_GET(cpuid), &other_cpus); } else { other_cpus = mask; - while ((cpu = CPU_FFS(&mask)) != 0) { - cpu--; - CPU_CLR(cpu, &mask); - CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, - cpu, vector); - ipi_send_cpu(cpu, vector); - } + ipi_selected(mask, vector); } curcpu_cb(pmap, addr1, addr2); while ((cpu = CPU_FFS(&other_cpus)) != 0) { -- 2.45.0