Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/pmap.c
Show First 20 Lines • Show All 1,237 Lines • ▼ Show 20 Lines | if (pmap == kernel_pmap) { | ||||
invlpg(va); | invlpg(va); | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | } else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else { | } else { | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
other_cpus = all_cpus; | other_cpus = all_cpus; | ||||
CPU_CLR(cpuid, &other_cpus); | CPU_CLR(cpuid, &other_cpus); | ||||
CPU_AND(&other_cpus, &pmap->pm_active); | CPU_AND(&other_cpus, &other_cpus, &pmap->pm_active); | ||||
mask = &other_cpus; | mask = &other_cpus; | ||||
} | } | ||||
smp_masked_invlpg(*mask, va, pmap, pmap_curcpu_cb_dummy); | smp_masked_invlpg(*mask, va, pmap, pmap_curcpu_cb_dummy); | ||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
/* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */ | /* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */ | ||||
#define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE) | #define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE) | ||||
Show All 16 Lines | for (addr = sva; addr < eva; addr += PAGE_SIZE) | ||||
invlpg(addr); | invlpg(addr); | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | } else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else { | } else { | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
other_cpus = all_cpus; | other_cpus = all_cpus; | ||||
CPU_CLR(cpuid, &other_cpus); | CPU_CLR(cpuid, &other_cpus); | ||||
CPU_AND(&other_cpus, &pmap->pm_active); | CPU_AND(&other_cpus, &other_cpus, &pmap->pm_active); | ||||
mask = &other_cpus; | mask = &other_cpus; | ||||
} | } | ||||
smp_masked_invlpg_range(*mask, sva, eva, pmap, pmap_curcpu_cb_dummy); | smp_masked_invlpg_range(*mask, sva, eva, pmap, pmap_curcpu_cb_dummy); | ||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
static void | static void | ||||
pmap_invalidate_all_int(pmap_t pmap) | pmap_invalidate_all_int(pmap_t pmap) | ||||
{ | { | ||||
cpuset_t *mask, other_cpus; | cpuset_t *mask, other_cpus; | ||||
u_int cpuid; | u_int cpuid; | ||||
sched_pin(); | sched_pin(); | ||||
if (pmap == kernel_pmap) { | if (pmap == kernel_pmap) { | ||||
invltlb(); | invltlb(); | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | } else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) { | ||||
mask = &all_cpus; | mask = &all_cpus; | ||||
} else { | } else { | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
other_cpus = all_cpus; | other_cpus = all_cpus; | ||||
CPU_CLR(cpuid, &other_cpus); | CPU_CLR(cpuid, &other_cpus); | ||||
CPU_AND(&other_cpus, &pmap->pm_active); | CPU_AND(&other_cpus, &other_cpus, &pmap->pm_active); | ||||
mask = &other_cpus; | mask = &other_cpus; | ||||
} | } | ||||
smp_masked_invltlb(*mask, pmap, pmap_curcpu_cb_dummy); | smp_masked_invltlb(*mask, pmap, pmap_curcpu_cb_dummy); | ||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
static void | static void | ||||
pmap_invalidate_cache_curcpu_cb(pmap_t pmap __unused, | pmap_invalidate_cache_curcpu_cb(pmap_t pmap __unused, | ||||
▲ Show 20 Lines • Show All 5,087 Lines • Show Last 20 Lines |