MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_update_pde

Function pmap_update_pde

freebsd/amd64/amd64/pmap.c:3277–3310  ·  view source on GitHub ↗

* Change the page size for the specified virtual address in a way that * prevents any possibility of the TLB ever having two entries that map the * same virtual address using different page sizes. This is the recommended * workaround for Erratum 383 on AMD Family 10h processors. It prevents a * machine check exception for a TLB state that is improperly diagnosed as a * hardware error. */

Source from the content-addressed store, hash-verified

3275 * hardware error.
3276 */
3277static void
3278pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
3279{
3280 struct pde_action act;
3281 cpuset_t active, other_cpus;
3282 u_int cpuid;
3283
3284 sched_pin();
3285 cpuid = PCPU_GET(cpuid);
3286 other_cpus = all_cpus;
3287 CPU_CLR(cpuid, &other_cpus);
3288 if (pmap == kernel_pmap || pmap_type_guest(pmap))
3289 active = all_cpus;
3290 else {
3291 active = pmap->pm_active;
3292 }
3293 if (CPU_OVERLAP(&active, &other_cpus)) {
3294 act.store = cpuid;
3295 act.invalidate = active;
3296 act.va = va;
3297 act.pmap = pmap;
3298 act.pde = pde;
3299 act.newpde = newpde;
3300 CPU_SET(cpuid, &active);
3301 smp_rendezvous_cpus(active,
3302 smp_no_rendezvous_barrier, pmap_update_pde_action,
3303 pmap_update_pde_teardown, &act);
3304 } else {
3305 pmap_update_pde_store(pmap, pde, newpde);
3306 if (CPU_ISSET(cpuid, &active))
3307 pmap_update_pde_invalidate(pmap, va, newpde);
3308 }
3309 sched_unpin();
3310}
3311#else /* !SMP */
3312/*
3313 * Normal, non-SMP, invalidation functions.

Callers 3

pmap_demote_pde_lockedFunction · 0.70
pmap_remove_kernel_pdeFunction · 0.70
pmap_promote_pdeFunction · 0.70

Calls 6

sched_pinFunction · 0.85
pmap_type_guestFunction · 0.85
smp_rendezvous_cpusFunction · 0.85
pmap_update_pde_storeFunction · 0.85
sched_unpinFunction · 0.85

Tested by

no test coverage detected