git: nvmm: Fix SVM TSS restore on DragonFly

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


commit aeee078a87aa2ccde9b4ee5c7a9c827eb2b925b1
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Jun 15 07:26:03 2021 +0800

    nvmm: Fix SVM TSS restore on DragonFly
    
    In DragonFly, PCPU(tss_gdt) points directly to the gdt[] entry for the
    current CPU's TSS descriptor; while NetBSD's CPUVAR(GDT) points to the
    gdtstore[] table.  Fix that 'and' instruction so it works on DragonFly.
    (Credit to Matt Dillon for debugging and fixing this.)
    
    The 'and' instruction clears the busy bit (bit 41) so the TSS descriptor
    becomes "available" for the reloading, as required by 'ltr' instruction.
    (The TSS descriptor was in use prior to launching the guest so it has
    been marked busy.)
    
    Credit:
    * Illumos: Bug #13029: AMD bhyve should reload TSS ASAP
      https://www.illumos.org/issues/13029
    * Illumos: 13029 AMD bhyve should reload TSS ASAP
      https://github.com/illumos/illumos-gate/commit/4d3fdeb14779bb6b0838521971d9ac99d65b0572

Summary of changes:
 sys/dev/virtual/nvmm/x86/nvmm_x86_svmfunc.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list