diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2024-10-02 18:18:28 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2024-10-02 18:18:28 +0000 |
commit | 52bb7dd099681bb09cf3c7c7dc8eb1d47c24470f (patch) | |
tree | 7d53998e80d00a8310a1066427e4eb42d4fdde82 /sys | |
parent | 92aa267209948cfa6b92eed71c150e9cfe741775 (diff) |
amd64: implement a pmap_shootept() for non-MP kernels.
Simplifies some of the recent INVEPT changes and mirrors the design
of other pmap tlb shootdown functions that provide simplified non-MP
implementations.
ok mlarkin@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index ceef0b25bbd..35af9d10cdc 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.176 2024/09/26 21:55:42 dv Exp $ */ +/* $OpenBSD: pmap.c,v 1.177 2024/10/02 18:18:27 dv Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -2468,9 +2468,7 @@ pmap_remove_ept(struct pmap *pmap, vaddr_t sgpa, vaddr_t egpa) for (v = sgpa; v < egpa + PAGE_SIZE; v += PAGE_SIZE) pmap_do_remove_ept(pmap, v); -#ifdef MULTIPROCESSOR pmap_shootept(pmap, 1); -#endif /* MULTIPROCESSOR */ mtx_leave(&pmap->pm_mtx); @@ -3518,4 +3516,22 @@ pmap_tlb_shoottlb(struct pmap *pm, int shootself) } } } + +#if NVMM > 0 +void +pmap_shootept(struct pmap *pm, int shootself) +{ + struct cpu_info *self = curcpu(); + struct vmx_invept_descriptor vid; + + KASSERT(pmap_is_ept(pm)); + + if (shootself && (self->ci_flags & CPUF_VMM)) { + vid.vid_eptp = pm->eptp; + vid.vid_reserved = 0; + invept(self->ci_vmm_cap.vcc_vmx.vmx_invept_mode, &vid); + } +} +#endif /* NVMM > 0 */ + #endif /* MULTIPROCESSOR */ |