void BX_CPU_C::init_vmexit_ctrls(void) { struct bx_VMX_Cap *cap = &BX_CPU_THIS_PTR vmx_cap; @@ -905,42 +924,46 @@ void BX_CPU_C::init_vmexit_ctrls(void) // [28] Save host CET state on VMEXIT // [29] Save host MSR_IA32_PKRS on VMEXIT // [30] Save guest MSR...
下图是VMCS Region的所有字段,大体上分为了GUEST STATE AREA和HOST STATE AREA两部分: Peach VM中对VMCS Region读的代码: 代码语言:javascript 复制 // 读取VMCS中VM_EXIT_REASON域的值vmcs_field=0x00004402;asmvolatile("vmread %1, %0\n\t"//:"=r"(vmcs_field_value):"r"(vmcs_field));printk("E...
bool masked) static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) { if (is_guest_mode(vcpu)) { - struct vmcs12 *vmcs12 = get_vmcs12(vcpu); - if (to_vmx(vcpu)->nested.nested_run_pending) return 0; if (nested_exit_on_nmi(vcpu)) { - nested_vmx_vmexit(vcpu); -...
vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, 0); + vmcs_write64(VM_EXIT_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.host)); vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, 0); + vmcs_write64(VM_ENTRY_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.guest)); rdmsr(MSR_IA32_SYSENTER_CS, host_sysenter_cs, ...