trusty: init & switch world fix

- when init, cr0 & cr4 should read from VMCS
- when world switch, cr0/cr4 read shadow should also be save/restore

v2:
- use context->vmx_cr0/cr4 to save/restore VMX_GUEST_CR0/CR4
- use context->cr0/cr4 to save/restore VMX_CR0/CR4_READ_SHADOW

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ
2018-06-16 14:46:51 +08:00
committed by lijinxia
parent 75c1573aff
commit e84d4dee19
3 changed files with 27 additions and 6 deletions

View File

@@ -138,6 +138,9 @@ struct run_context {
uint64_t ia32_sysenter_eip;
uint64_t ia32_debugctl;
uint64_t vmx_cr0;
uint64_t vmx_cr4;
/* segment registers */
struct segment cs;
struct segment ss;