| 2943 | } |
| 2944 | |
| 2945 | static __inline void |
| 2946 | vmx_pmap_activate(struct vmx *vmx, pmap_t pmap) |
| 2947 | { |
| 2948 | long eptgen; |
| 2949 | int cpu; |
| 2950 | |
| 2951 | cpu = curcpu; |
| 2952 | |
| 2953 | CPU_SET_ATOMIC(cpu, &pmap->pm_active); |
| 2954 | smr_enter(pmap->pm_eptsmr); |
| 2955 | eptgen = atomic_load_long(&pmap->pm_eptgen); |
| 2956 | if (eptgen != vmx->eptgen[cpu]) { |
| 2957 | vmx->eptgen[cpu] = eptgen; |
| 2958 | invept(INVEPT_TYPE_SINGLE_CONTEXT, |
| 2959 | (struct invept_desc){ .eptp = vmx->eptp, ._res = 0 }); |
| 2960 | } |
| 2961 | } |
| 2962 | |
| 2963 | static __inline void |
| 2964 | vmx_pmap_deactivate(struct vmx *vmx, pmap_t pmap) |