git: nvmm: Save host DB regs in per-cpu structure

Aaron LI aly at crater.dragonflybsd.org
Tue Jul 20 16:30:33 PDT 2021


commit f6c0185203d8a0e5955a47e12e0efad053b88532
Author: Aaron LI <aly at aaronly.me>
Date:   Fri Jul 9 12:50:33 2021 +0800

    nvmm: Save host DB regs in per-cpu structure
    
    * The host DB regs save/restore operations are performed outside the
      hard interrupt disablement.  If the DB regs were saved in curthread's
      PCB, an interrupt thread running just after hard interrupts are
      enabled again could overwrite the DB regs in the PCB with the guest DB
      regs.  Saving the host DB regs in the per-cpu structure avoid such
      issues.
    
    * This change also makes the code a bit more OS-independent.
    
    Credit-to: Matt Dillon
    Referred-to: FreeBSD bhyve

Summary of changes:
 sys/dev/virtual/nvmm/x86/nvmm_x86.h     | 63 ++++++++++++---------------------
 sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c |  5 +--
 sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c |  5 +--
 3 files changed, 28 insertions(+), 45 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f6c0185203d8a0e5955a47e12e0efad053b88532


-- 
DragonFly BSD source repository



More information about the Commits mailing list