Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/efirt_machdep.c
| Show First 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | if (pmap_pcid_enabled) | ||||
| cr3 |= pmap_get_pcid(curpmap); | cr3 |= pmap_get_pcid(curpmap); | ||||
| load_cr3(cr3); | load_cr3(cr3); | ||||
| /* | /* | ||||
| * If PCID is enabled, the clear CR3_PCID_SAVE bit in the loaded %cr3 | * If PCID is enabled, the clear CR3_PCID_SAVE bit in the loaded %cr3 | ||||
| * causes TLB invalidation. | * causes TLB invalidation. | ||||
| */ | */ | ||||
| if (!pmap_pcid_enabled) | if (!pmap_pcid_enabled) | ||||
| invltlb(); | invltlb(); | ||||
| if (lass_enabled) | |||||
| load_cr4(rcr4() & ~CR4_LASS); | |||||
| return (0); | return (0); | ||||
| } | } | ||||
| void | void | ||||
| efi_arch_leave(void) | efi_arch_leave(void) | ||||
| { | { | ||||
| pmap_t curpmap; | pmap_t curpmap; | ||||
| uint64_t cr3; | uint64_t cr3; | ||||
| if (lass_enabled) | |||||
| load_cr4(rcr4() | CR4_LASS); | |||||
| curpmap = &curproc->p_vmspace->vm_pmap; | curpmap = &curproc->p_vmspace->vm_pmap; | ||||
| cr3 = curpmap->pm_cr3; | cr3 = curpmap->pm_cr3; | ||||
| if (pmap_pcid_enabled) { | if (pmap_pcid_enabled) { | ||||
| cr3 |= pmap_get_pcid(curpmap); | cr3 |= pmap_get_pcid(curpmap); | ||||
| if (!invpcid_works) | if (!invpcid_works) | ||||
| PCPU_SET(curpmap, curpmap); | PCPU_SET(curpmap, curpmap); | ||||
| } | } | ||||
| load_cr3(cr3); | load_cr3(cr3); | ||||
| Show All 29 Lines | |||||