* 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. */
| 3275 | * hardware error. |
| 3276 | */ |
| 3277 | static void |
| 3278 | pmap_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. |
no test coverage detected