git: libnvmm: Improve the correctness of page table walks
Aaron LI
aly at crater.dragonflybsd.org
Sat Oct 3 07:05:12 PDT 2026
commit 6f52ef555fbe1c6d723cc36b34d2eb8ed08f45c9
Author: Aaron LI <aly at aaronly.me>
Date: Sat Oct 3 18:46:32 2026 +0800
libnvmm: Improve the correctness of page table walks
* Fix 32bit PAE: the top-level pdir doesn't have NX.
* Fix 32bit non-PAE: PTE_PS is ignored if CR4.PSE=0.
* Stop the walks early on if a required permission is not met.
* Take CR0.WP and EFER.NXE into account when evaluating permissions.
* Enforce SMEP/SMAP protections.
* Document the semantics of nvmm_gva_to_gpa() more clearly.
* Add unit-tests.
Note that the '64bit walk - present' test is failing, which will be
fixed in a later commit.
Obtained-from: NVMM Reference Implementation
Summary of changes:
lib/libnvmm/libnvmm.3 | 14 ++-
lib/libnvmm/libnvmm_x86.c | 230 ++++++++++++++++++++--------------
test/testcases/libnvmm/h_mem_assist.c | 125 +++++++++++++++++-
test/testcases/libnvmm/h_os.h | 3 +
4 files changed, 271 insertions(+), 101 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6f52ef555fbe1c6d723cc36b34d2eb8ed08f45c9
--
DragonFly BSD source repository
More information about the Commits
mailing list