hv: add vmx_off and update exec_vmxon_instr

To handle cpu down/up dynamically, arcn needs to support vmx off/on
dynamically. Following changes is introduced:
  vmx_off will be used when down AP. It does:
    - vmclear the mapped vcpu
    - off vmx.

  exec_vmxon_instr is updated to handle start and up AP both. It does
    - if vmx was on on AP, load the vmxon_region saved. Otherwise,
      allocate vmxon_region.
    - if there is mapped vcpu, vmptrld mapped vcpu.

Signed-off-by: Zheng Gen <gen.zheng@intel.com>
Signed-off-by: Yin Fegnwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
Yin Fegnwei
2018-06-02 11:19:30 +08:00
committed by lijinxia
parent fbeafd500a
commit 08139c34f7
4 changed files with 43 additions and 8 deletions

View File

@@ -125,7 +125,7 @@ int hv_main(int cpu_id)
}
/* Enable virtualization extensions */
ret = exec_vmxon_instr();
ret = exec_vmxon_instr(cpu_id);
if (ret != 0)
return ret;