modulization: vmx on/off should not use vcpu param

vmx.c should only take care host vmx operations, which should not
contain vcpu reference, so refine vmx on/off APIs, move out use
of vcpu by adding one per cpu vmcs_run pointer.

as now each pcpu only run on one vcpu, so just keep running vmcs
in per cpu vmcs_run pointer is enough.

Changes to be committed:
	modified:   arch/x86/cpu.c
	modified:   arch/x86/init.c
	modified:   arch/x86/pm.c
	modified:   arch/x86/vmcs.c
	modified:   arch/x86/vmx.c
	modified:   include/arch/x86/per_cpu.h
	modified:   include/arch/x86/vmx.h

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ
2018-12-12 20:48:57 +08:00
committed by wenlingz
parent bed82dd3f8
commit 36863a0b54
7 changed files with 37 additions and 32 deletions

View File

@@ -22,6 +22,7 @@
struct per_cpu_region {
/* vmxon_region MUST be 4KB-aligned */
uint8_t vmxon_region[PAGE_SIZE];
void *vmcs_run;
#ifdef HV_DEBUG
uint64_t *sbuf[ACRN_SBUF_ID_MAX];
char logbuf[LOG_MESSAGE_MAX_SIZE];

View File

@@ -378,9 +378,8 @@
#define VMX_INT_TYPE_SW_EXP 6U
/* External Interfaces */
void exec_vmxon_instr(uint16_t pcpu_id);
void vmx_off(uint16_t pcpu_id);
void vmx_on(void);
void vmx_off(void);
/**
* Read field from VMCS.