nvmm: Revert to use os_curcpu() in vmx_vmcs_enter()
authorAaron LI <aly@aaronly.me>
Sun, 11 Jul 2021 08:08:23 +0000 (16:08 +0800)
committerAaron LI <aly@aaronly.me>
Tue, 20 Jul 2021 23:28:27 +0000 (07:28 +0800)
commitac42d1dfa1b03a85a780470425488466a76ae96b
treea7027eea86463b5539aa2ce007d0dc4d885f7916
parent5d445d4ccd1cd9a6c8af2fed063bdb0b30bbff86
nvmm: Revert to use os_curcpu() in vmx_vmcs_enter()

os_curcpu() returns a pointer to the current per-cpu data, which is used
in vmx_vmcs_enter() to clear a VMCS from a remote CPU.  So it's more
efficient and clean than using the os_curcpu_number(), which requires
another lookup to obtain the per-cpu data pointer from the CPU id.

This effectively reverts the commit:
nvmm: Fix issues of porting 'curcpu()' as 'mycpu'

The "VMX fail valid" panics I had then were actually caused by the
missing wait for the asynchronous IPI request to clear VMCS from a
remote CPU, which had been fixed in a later commit.
sys/dev/virtual/nvmm/nvmm_os.h
sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c