nvmm: Fix issues of porting 'curcpu()' as 'mycpu'
authorAaron LI <aly@aaronly.me>
Sun, 13 Jun 2021 07:00:51 +0000 (15:00 +0800)
committerAaron LI <aly@aaronly.me>
Tue, 15 Jun 2021 23:22:07 +0000 (07:22 +0800)
commit7b19785a0a59c2d82bbf771ab326ad4d0cb68f37
tree1d81595766075cba33ee6e721e8e7402c85c95f8
parent6f52ef83df5b6a6c259b9e6b85f3d702729ce325
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.
sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c