git: nvmm: Fix issues of porting 'curcpu()' as 'mycpu'

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


commit 3296e7a7b0339483974e3a701c193852f49cb4da
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Jun 13 15:00:51 2021 +0800

    nvmm: Fix issues of porting 'curcpu()' as 'mycpu'
    
    In NVMM porting step #10, I ported NetBSD's 'curcpu()' as our 'mycpu'.
    This was incorrect, because the 'struct globaldata *' pointer returned
    by 'mycpu' is NOT stable and can change. (see the comments in
    'pc64/include/thread.h')
    
    Use 'mycpuid' to implement 'curcpu()' and adjust the code accordingly.

Summary of changes:
 sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3296e7a7b0339483974e3a701c193852f49cb4da


-- 
DragonFly BSD source repository


More information about the Commits mailing list