Changeset View
Changeset View
Standalone View
Standalone View
head/sys/i386/i386/pmap.c
Show First 20 Lines • Show All 1,039 Lines • ▼ Show 20 Lines | if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { | ||||
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); | ||||
if (CPU_ISSET(cpuid, &pmap->pm_active)) | if (CPU_ISSET(cpuid, &pmap->pm_active)) | ||||
invlpg(va); | invlpg(va); | ||||
CPU_AND(&other_cpus, &pmap->pm_active); | CPU_AND(&other_cpus, &pmap->pm_active); | ||||
mask = &other_cpus; | mask = &other_cpus; | ||||
} | } | ||||
smp_masked_invlpg(*mask, va); | smp_masked_invlpg(*mask, va, pmap); | ||||
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) | ||||
void | void | ||||
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) | pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) | ||||
Show All 17 Lines | if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { | ||||
other_cpus = all_cpus; | other_cpus = all_cpus; | ||||
CPU_CLR(cpuid, &other_cpus); | CPU_CLR(cpuid, &other_cpus); | ||||
if (CPU_ISSET(cpuid, &pmap->pm_active)) | if (CPU_ISSET(cpuid, &pmap->pm_active)) | ||||
for (addr = sva; addr < eva; addr += PAGE_SIZE) | for (addr = sva; addr < eva; addr += PAGE_SIZE) | ||||
invlpg(addr); | invlpg(addr); | ||||
CPU_AND(&other_cpus, &pmap->pm_active); | CPU_AND(&other_cpus, &pmap->pm_active); | ||||
mask = &other_cpus; | mask = &other_cpus; | ||||
} | } | ||||
smp_masked_invlpg_range(*mask, sva, eva); | smp_masked_invlpg_range(*mask, sva, eva, pmap); | ||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
void | void | ||||
pmap_invalidate_all(pmap_t pmap) | pmap_invalidate_all(pmap_t pmap) | ||||
{ | { | ||||
cpuset_t *mask, other_cpus; | cpuset_t *mask, other_cpus; | ||||
u_int cpuid; | u_int cpuid; | ||||
▲ Show 20 Lines • Show All 4,596 Lines • Show Last 20 Lines |