git: nvmm: Change the meaning of TPR_CHANGED

Aaron LI aly at crater.dragonflybsd.org
Wed Nov 18 05:12:56 PST 2026


commit 02283a7a71ab07f1bea27b4f4b924e0ae444fa4a
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Nov 18 19:40:11 2026 +0800

    nvmm: Change the meaning of TPR_CHANGED
    
    Currently we return TPR_CHANGED if the guest changes its TPR. But the only
    change the emulator is interested in is if the TPR is lowered, as that
    unblocks certain classes of interrupts; the emulator doesn't care if the
    TPR is increased.
    
    Change the behavior to return TPR_CHANGED only if the TPR is lowered.
    Then, implement an optimization on SVM: instead of intercepting all
    writes to CR8 and returning to userland, use a TPR trap to get VMEXITs
    only when the guest lowers its TPR.
    
    This effectively eliminates VMEXITs on TPR increases, which significantly
    improves the performance of Windows guests (because they frequently
    increase and decrease the TPR).
    
    Update the libnvmm.3 man page and the test cases as well.
    
    Obtained-from: NVMM Reference Implementation

Summary of changes:
 lib/libnvmm/libnvmm.3                   |  4 +-
 sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c | 96 +++++++++++++++------------------
 sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c |  9 ++--
 test/testcases/libnvmm/h_misc.c         |  6 +--
 test/testcases/libnvmm/h_os.h           |  1 +
 5 files changed, 55 insertions(+), 61 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/02283a7a71ab07f1bea27b4f4b924e0ae444fa4a


-- 
DragonFly BSD source repository


More information about the Commits mailing list