From 4f6557697b116d794c6dd471a8dc8cbe2987509f Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Thu, 13 Sep 2012 05:33:05 +0000 Subject: [PATCH] small comments updates in vmx code --- bochs/cpu/vmcs.cc | 4 ++-- bochs/cpu/vmx.cc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bochs/cpu/vmcs.cc b/bochs/cpu/vmcs.cc index 87d44377f..2034d9d00 100644 --- a/bochs/cpu/vmcs.cc +++ b/bochs/cpu/vmcs.cc @@ -481,8 +481,8 @@ void BX_CPU_C::init_vmx_capabilities(void) // [05] VPID Enable // [06] WBINVD Exiting // [07] Unrestricted Guest (require EPT) - // [08] Reserved - // [09] Reserved + // [08] Virtualize Apic Registers + // [09] Virtualize Interrupt Delivery // [10] PAUSE Loop Exiting // [11] RDRAND Exiting (require RDRAND instruction support) // [12] Enable INVPCID instruction (require INVPCID instruction support) diff --git a/bochs/cpu/vmx.cc b/bochs/cpu/vmx.cc index bfa6c2213..7d8cd517b 100644 --- a/bochs/cpu/vmx.cc +++ b/bochs/cpu/vmx.cc @@ -1511,6 +1511,12 @@ Bit32u BX_CPU_C::VMenterLoadCheckGuestState(Bit64u *qualification) #if BX_SUPPORT_X86_64 #if BX_SUPPORT_VMX >= 2 // modify EFER.LMA / EFER.LME before setting CR4 + + // It is recommended that 64-bit VMM software use the 1-settings of the "load IA32_EFER" + // VM entry control and the "save IA32_EFER" VM-exit control. If VMentry is establishing + // CR0.PG=0 and if the "IA-32e mode guest" and "load IA32_EFER" VM entry controls are + // both 0, VM entry leaves IA32_EFER.LME unmodified (i.e., the host value will persist + // in the guest) -- Quote from Intel SDM if (vmentry_ctrls & VMX_VMENTRY_CTRL1_LOAD_EFER_MSR) { BX_CPU_THIS_PTR efer.set32((Bit32u) guest.efer_msr); }