Changeset 45947 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 8, 2013 12:27:58 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r45863 r45947 528 528 * Timer Does Not Count Down at the Rate Specified" erratum. 529 529 */ 530 if (g_HvmR0.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_PREEMPT_TIMER)530 if (g_HvmR0.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER) 531 531 { 532 532 g_HvmR0.vmx.fUsePreemptTimer = true; -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45946 r45947 761 761 #endif 762 762 763 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)763 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 764 764 hmR0VmxPageFree(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap, &pVCpu->hm.s.vmx.HCPhysMsrBitmap); 765 765 … … 852 852 853 853 /* Allocate the Virtual-APIC page for transparent TPR accesses. */ 854 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)854 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 855 855 { 856 856 rc = hmR0VmxPageAllocZ(&pVCpu->hm.s.vmx.hMemObjVirtApic, (PRTR0PTR)&pVCpu->hm.s.vmx.pbVirtApic, … … 861 861 862 862 /* Allocate the MSR-bitmap if supported by the CPU. The MSR-bitmap is for transparent accesses of specific MSRs. */ 863 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)863 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 864 864 { 865 865 rc = hmR0VmxPageAllocZ(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap, … … 1604 1604 uint32_t zap = pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1; /* Bits cleared here must always be cleared. */ 1605 1605 1606 val |= VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_EXT_INT_EXIT /* External interrupts causes a VM-exits. */1607 | VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_NMI_EXIT; /* Non-maskable interrupts causes a VM-exit. */1608 Assert(!(val & VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_VIRTUAL_NMI));1606 val |= VMX_VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT /* External interrupts causes a VM-exits. */ 1607 | VMX_VMCS_CTRL_PIN_EXEC_NMI_EXIT; /* Non-maskable interrupts causes a VM-exit. */ 1608 Assert(!(val & VMX_VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI)); 1609 1609 1610 1610 /* Enable the VMX preemption timer. */ 1611 1611 if (pVM->hm.s.vmx.fUsePreemptTimer) 1612 1612 { 1613 Assert(pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_PREEMPT_TIMER);1614 val |= VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_PREEMPT_TIMER;1613 Assert(pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER); 1614 val |= VMX_VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER; 1615 1615 } 1616 1616 … … 1622 1622 } 1623 1623 1624 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS, val);1624 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PIN_EXEC, val); 1625 1625 AssertRCReturn(rc, rc); 1626 1626 … … 1647 1647 uint32_t zap = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1; /* Bits cleared here must be cleared in the VMCS. */ 1648 1648 1649 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_HLT_EXIT /* HLT causes a VM-exit. */1650 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TSC_OFFSETTING /* Use TSC-offsetting. */1651 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT /* MOV DRx causes a VM-exit. */1652 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_UNCOND_IO_EXIT /* All IO instructions cause a VM-exit. */1653 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDPMC_EXIT /* RDPMC causes a VM-exit. */1654 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_EXIT /* MONITOR causes a VM-exit. */1655 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MWAIT_EXIT; /* MWAIT causes a VM-exit. */1656 1657 /* We toggle VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT later, check if it's not -always- needed to be set or clear. */1658 if ( !(pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT)1659 || (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT))1660 { 1661 LogRel(("hmR0VmxSetupProcCtls: unsupported VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT combo!"));1649 val |= VMX_VMCS_CTRL_PROC_EXEC_HLT_EXIT /* HLT causes a VM-exit. */ 1650 | VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING /* Use TSC-offsetting. */ 1651 | VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT /* MOV DRx causes a VM-exit. */ 1652 | VMX_VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT /* All IO instructions cause a VM-exit. */ 1653 | VMX_VMCS_CTRL_PROC_EXEC_RDPMC_EXIT /* RDPMC causes a VM-exit. */ 1654 | VMX_VMCS_CTRL_PROC_EXEC_MONITOR_EXIT /* MONITOR causes a VM-exit. */ 1655 | VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT; /* MWAIT causes a VM-exit. */ 1656 1657 /* We toggle VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT later, check if it's not -always- needed to be set or clear. */ 1658 if ( !(pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT) 1659 || (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0 & VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT)) 1660 { 1661 LogRel(("hmR0VmxSetupProcCtls: unsupported VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT combo!")); 1662 1662 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 1663 1663 } … … 1667 1667 { 1668 1668 Assert(!pVM->hm.s.vmx.fUnrestrictedGuest); /* Paranoia. */ 1669 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INVLPG_EXIT1670 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT1671 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT;1669 val |= VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT 1670 | VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 1671 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT; 1672 1672 } 1673 1673 1674 1674 /* Use TPR shadowing if supported by the CPU. */ 1675 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)1675 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 1676 1676 { 1677 1677 Assert(pVCpu->hm.s.vmx.HCPhysVirtApic); … … 1681 1681 AssertRCReturn(rc, rc); 1682 1682 1683 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW; /* CR8 reads from the Virtual-APIC page. */1683 val |= VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW; /* CR8 reads from the Virtual-APIC page. */ 1684 1684 /* CR8 writes causes a VM-exit based on TPR threshold. */ 1685 Assert(!(val & VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_STORE_EXIT));1686 Assert(!(val & VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_LOAD_EXIT));1685 Assert(!(val & VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT)); 1686 Assert(!(val & VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT)); 1687 1687 } 1688 1688 else 1689 1689 { 1690 val |= VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_STORE_EXIT /* CR8 reads causes a VM-exit. */1691 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_LOAD_EXIT; /* CR8 writes causes a VM-exit. */1690 val |= VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT /* CR8 reads causes a VM-exit. */ 1691 | VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT; /* CR8 writes causes a VM-exit. */ 1692 1692 } 1693 1693 1694 1694 /* Use MSR-bitmaps if supported by the CPU. */ 1695 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)1696 { 1697 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS;1695 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 1696 { 1697 val |= VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS; 1698 1698 1699 1699 Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap); … … 1728 1728 } 1729 1729 1730 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, val);1730 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, val); 1731 1731 AssertRCReturn(rc, rc); 1732 1732 … … 1751 1751 /* 1752 1752 * Without Nested Paging, INVPCID should cause a VM-exit. Enabling this bit causes the CPU to refer to 1753 * VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INVLPG_EXIT when INVPCID is executed by the guest.1753 * VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT when INVPCID is executed by the guest. 1754 1754 * See Intel spec. 25.4 "Changes to instruction behaviour in VMX non-root operation". 1755 1755 */ … … 1779 1779 { 1780 1780 val |= VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP; /* Enable RDTSCP support. */ 1781 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)1781 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 1782 1782 hmR0VmxSetMsrPermission(pVCpu, MSR_K8_TSC_AUX, VMXMSREXIT_PASSTHRU_READ, VMXMSREXIT_PASSTHRU_WRITE); 1783 1783 } … … 1790 1790 } 1791 1791 1792 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS2, val);1792 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, val); 1793 1793 AssertRCReturn(rc, rc); 1794 1794 … … 2138 2138 /* Assertion is right but we would not have updated u32ExitCtls yet. */ 2139 2139 #if 0 2140 if (!(pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE))2140 if (!(pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE)) 2141 2141 Assert(uSelSS != 0); 2142 2142 #endif … … 2362 2362 2363 2363 /* Load debug controls (DR7 & IA32_DEBUGCTL_MSR). The first VT-x capable CPUs only supports the 1-setting of this bit. */ 2364 val |= VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_DEBUG;2364 val |= VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG; 2365 2365 2366 2366 /* Set if the guest is in long mode. This will set/clear the EFER.LMA bit on VM-entry. */ 2367 2367 if (CPUMIsGuestInLongModeEx(pMixedCtx)) 2368 val |= VMX_VMCS_CTRL_ENTRY_ CONTROLS_IA32E_MODE_GUEST;2368 val |= VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST; 2369 2369 else 2370 Assert(!(val & VMX_VMCS_CTRL_ENTRY_ CONTROLS_IA32E_MODE_GUEST));2370 Assert(!(val & VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST)); 2371 2371 2372 2372 /* 2373 2373 * The following should not be set (since we're not in SMM mode): 2374 * - VMX_VMCS_CTRL_ENTRY_ CONTROLS_ENTRY_SMM2375 * - VMX_VMCS_CTRL_ENTRY_ CONTROLS_DEACTIVATE_DUALMON2374 * - VMX_VMCS_CTRL_ENTRY_ENTRY_SMM 2375 * - VMX_VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON 2376 2376 */ 2377 2377 2378 /** @todo VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_PERF_MSR,2379 * VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_PAT_MSR,2380 * VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_EFER_MSR */2378 /** @todo VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR, 2379 * VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR, 2380 * VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR */ 2381 2381 2382 2382 if ((val & zap) != val) … … 2387 2387 } 2388 2388 2389 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY _CONTROLS, val);2389 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY, val); 2390 2390 AssertRCReturn(rc, rc); 2391 2391 … … 2420 2420 2421 2421 /* Save debug controls (DR7 & IA32_DEBUGCTL_MSR). The first VT-x CPUs only supported the 1-setting of this bit. */ 2422 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_DEBUG;2422 val |= VMX_VMCS_CTRL_EXIT_SAVE_DEBUG; 2423 2423 2424 2424 /* Set the host long mode active (EFER.LMA) bit (which Intel calls "Host address-space size") if necessary. */ 2425 2425 #if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 2426 2426 if (HMVMX_IS_64BIT_HOST_MODE()) 2427 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE;2427 val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE; 2428 2428 else 2429 Assert(!(val & VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE));2429 Assert(!(val & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE)); 2430 2430 #elif HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) 2431 2431 if (CPUMIsGuestInLongModeEx(pMixedCtx)) 2432 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE; /* The switcher goes to long mode. */2432 val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE; /* The switcher goes to long mode. */ 2433 2433 else 2434 Assert(!(val & VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE));2434 Assert(!(val & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE)); 2435 2435 #endif 2436 2436 2437 2437 /* Don't acknowledge external interrupts on VM-exit. We want to let the host do that. */ 2438 Assert(!(val & VMX_VMCS_CTRL_EXIT_ CONTROLS_ACK_EXT_INT));2439 2440 /** @todo VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_PERF_MSR,2441 * VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_GUEST_PAT_MSR,2442 * VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_HOST_PAT_MSR,2443 * VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_GUEST_EFER_MSR,2444 * VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_HOST_EFER_MSR. */2445 2446 if (pVM->hm.s.vmx.msr.vmx_exit.n.allowed1 & VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_VMX_PREEMPT_TIMER)2447 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_VMX_PREEMPT_TIMER;2438 Assert(!(val & VMX_VMCS_CTRL_EXIT_ACK_EXT_INT)); 2439 2440 /** @todo VMX_VMCS_CTRL_EXIT_LOAD_PERF_MSR, 2441 * VMX_VMCS_CTRL_EXIT_SAVE_GUEST_PAT_MSR, 2442 * VMX_VMCS_CTRL_EXIT_LOAD_HOST_PAT_MSR, 2443 * VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR, 2444 * VMX_VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR. */ 2445 2446 if (pVM->hm.s.vmx.msr.vmx_exit.n.allowed1 & VMX_VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER) 2447 val |= VMX_VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER; 2448 2448 2449 2449 if ((val & zap) != val) … … 2454 2454 } 2455 2455 2456 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_EXIT _CONTROLS, val);2456 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_EXIT, val); 2457 2457 AssertRCReturn(rc, rc); 2458 2458 … … 2481 2481 { 2482 2482 /* Setup TPR shadowing. Also setup TPR patching for 32-bit guests. */ 2483 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)2483 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 2484 2484 { 2485 2485 Assert(pVCpu->hm.s.vmx.HCPhysVirtApic); … … 2509 2509 Assert(!CPUMIsGuestInLongModeEx(pMixedCtx)); /* EFER always up-to-date. */ 2510 2510 pMixedCtx->msrLSTAR = u8GuestTpr; 2511 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)2511 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 2512 2512 { 2513 2513 /* If there are interrupts pending, intercept CR8 writes, otherwise don't intercept CR8 reads or writes. */ … … 2742 2742 { 2743 2743 /* The guest has paging enabled, let it access CR3 without causing a VM exit if supported. */ 2744 pVCpu->hm.s.vmx.u32ProcCtls &= ~( VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT2745 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT);2744 pVCpu->hm.s.vmx.u32ProcCtls &= ~( VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 2745 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT); 2746 2746 } 2747 2747 else 2748 2748 { 2749 2749 /* The guest doesn't have paging enabled, make CR3 access to cause VM exits to update our shadow. */ 2750 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT2751 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT;2750 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 2751 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT; 2752 2752 } 2753 2753 2754 2754 /* If we have unrestricted guest execution, we never have to intercept CR3 reads. */ 2755 2755 if (pVM->hm.s.vmx.fUnrestrictedGuest) 2756 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT;2757 2758 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);2756 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT; 2757 2758 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 2759 2759 AssertRCReturn(rc, rc); 2760 2760 } … … 3082 3082 #ifdef VBOX_STRICT 3083 3083 /* Validate. Intel spec. 26.3.1.1 "Checks on Guest Controls Registers, Debug Registers, MSRs" */ 3084 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_DEBUG)3084 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG) 3085 3085 { 3086 3086 Assert(!(pMixedCtx->dr[7] >> 32)); /* upper 32 bits are reserved (MBZ). */ … … 3098 3098 { 3099 3099 /* If the CPU supports the monitor trap flag, use it for single stepping in DBGF and avoid intercepting #DB. */ 3100 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG)3101 { 3102 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG;3103 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);3100 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG) 3101 { 3102 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG; 3103 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 3104 3104 AssertRCReturn(rc, rc); 3105 3105 Assert(fInterceptDB == false); … … 3148 3148 /* Update the processor-based VM-execution controls regarding intercepting MOV DRx instructions. */ 3149 3149 if (fInterceptMovDRx) 3150 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;3150 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 3151 3151 else 3152 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;3152 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 3153 3153 3154 3154 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_EXCEPTION_BITMAP, pVCpu->hm.s.vmx.u32XcptBitmap); 3155 3155 AssertRCReturn(rc, rc); 3156 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);3156 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 3157 3157 AssertRCReturn(rc, rc); 3158 3158 … … 3638 3638 { 3639 3639 /** @todo support save IA32_EFER, i.e. 3640 * VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_GUEST_EFER_MSR, in which case the3640 * VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR, in which case the 3641 3641 * guest EFER need not be part of the VM-entry MSR-load area. */ 3642 3642 pGuestMsr->u32IndexMSR = MSR_K6_EFER; … … 3857 3857 uint64_t u64Val; 3858 3858 HMVMXHCUINTREG uHCReg; 3859 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS, &u32Val);AssertRC(rc);3860 Log(("VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS%#RX32\n", u32Val));3861 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, &u32Val);AssertRC(rc);3862 Log(("VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS%#RX32\n", u32Val));3863 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS2, &u32Val); AssertRC(rc);3864 Log(("VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS2%#RX32\n", u32Val));3865 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_ENTRY _CONTROLS, &u32Val); AssertRC(rc);3866 Log(("VMX_VMCS32_CTRL_ENTRY _CONTROLS%#RX32\n", u32Val));3867 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_EXIT _CONTROLS, &u32Val); AssertRC(rc);3868 Log(("VMX_VMCS32_CTRL_EXIT _CONTROLS%#RX32\n", u32Val));3859 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PIN_EXEC, &u32Val); AssertRC(rc); 3860 Log(("VMX_VMCS32_CTRL_PIN_EXEC %#RX32\n", u32Val)); 3861 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, &u32Val); AssertRC(rc); 3862 Log(("VMX_VMCS32_CTRL_PROC_EXEC %#RX32\n", u32Val)); 3863 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val); AssertRC(rc); 3864 Log(("VMX_VMCS32_CTRL_PROC_EXEC2 %#RX32\n", u32Val)); 3865 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_ENTRY, &u32Val); AssertRC(rc); 3866 Log(("VMX_VMCS32_CTRL_ENTRY %#RX32\n", u32Val)); 3867 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_EXIT, &u32Val); AssertRC(rc); 3868 Log(("VMX_VMCS32_CTRL_EXIT %#RX32\n", u32Val)); 3869 3869 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_CR3_TARGET_COUNT, &u32Val); AssertRC(rc); 3870 3870 Log(("VMX_VMCS32_CTRL_CR3_TARGET_COUNT %#RX32\n", u32Val)); … … 4511 4511 4512 4512 uint32_t cPreemptionTickCount = (uint32_t)RT_MIN(cTicksToDeadline, UINT32_MAX - 16); 4513 rc = VMXWriteVmcs32(VMX_VMCS32_GUEST_PREEMPT_TIMER_VALUE, cPreemptionTickCount); 4513 rc = VMXWriteVmcs32(VMX_VMCS32_GUEST_PREEMPT_TIMER_VALUE, cPreemptionTickCount); AssertRC(rc); 4514 4514 } 4515 4515 else … … 4521 4521 if (u64CurTSC + pVCpu->hm.s.vmx.u64TSCOffset >= TMCpuTickGetLastSeen(pVCpu)) 4522 4522 { 4523 /* Note: VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */4524 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, pVCpu->hm.s.vmx.u64TSCOffset); 4525 4526 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;4527 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);AssertRC(rc);4523 /* Note: VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */ 4524 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, pVCpu->hm.s.vmx.u64TSCOffset); AssertRC(rc); 4525 4526 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 4527 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); AssertRC(rc); 4528 4528 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset); 4529 4529 } … … 4531 4531 { 4532 4532 /* VM-exit on RDTSC(P) as we would otherwise pass decreasing TSC values to the guest. */ 4533 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;4534 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);AssertRC(rc);4533 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 4534 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); AssertRC(rc); 4535 4535 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscInterceptOverFlow); 4536 4536 } … … 4539 4539 { 4540 4540 /* We can't use TSC-offsetting (non-fixed TSC, warp drive active etc.), VM-exit on RDTSC(P). */ 4541 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;4542 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);AssertRC(rc);4541 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 4542 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); AssertRC(rc); 4543 4543 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); 4544 4544 } … … 5170 5170 * -> continue with VM-exit handling -> hmR0VmxSaveGuestControlRegs() and here we are. 5171 5171 * 5172 * The longjmp exit path can't check these CR3 force-flags and call code that takes a lock again. 5173 * We cover for it here. 5172 * The longjmp exit path can't check these CR3 force-flags and call code that takes a lock again. We cover for it here. 5174 5173 */ 5175 5174 if (VMMRZCallRing3IsEnabled(pVCpu)) … … 5525 5524 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3)); 5526 5525 } 5526 5527 /* Pending HM PAE PDPEs. */ 5527 5528 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_PAE_PDPES)) 5528 5529 { … … 5757 5758 CPUMR0LoadHostDebugState(pVM, pVCpu); 5758 5759 Assert(!CPUMIsHyperDebugStateActive(pVCpu)); 5759 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT);5760 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT); 5760 5761 } 5761 5762 … … 5875 5876 DECLINLINE(void) hmR0VmxSetIntWindowExitVmcs(PVMCPU pVCpu) 5876 5877 { 5877 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT))5878 { 5879 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT))5880 { 5881 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT;5882 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);5878 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)) 5879 { 5880 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)) 5881 { 5882 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT; 5883 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 5883 5884 AssertRC(rc); 5884 5885 } … … 6676 6677 6677 6678 /* Cache the TPR-shadow for checking on every VM-exit if it might have changed. */ 6678 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)6679 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 6679 6680 pVmxTransient->u8GuestTpr = pVCpu->hm.s.vmx.pbVirtApic[0x80]; 6680 6681 … … 6714 6715 */ 6715 6716 if ( (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP) 6716 && !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT))6717 && !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)) 6717 6718 { 6718 6719 pVCpu->hm.s.u64HostTscAux = ASMRdMsr(MSR_K8_TSC_AUX); … … 6757 6758 pVmxTransient->fVectoringPF = false; /* Vectoring page-fault needs to be determined later. */ 6758 6759 6759 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT))6760 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)) 6760 6761 { 6761 6762 #ifndef VBOX_WITH_AUTO_MSR_LOAD_RESTORE … … 6817 6818 * cope with longjmps safely (see VMCPU_FF_HM_UPDATE_CR3 handling). 6818 6819 */ 6819 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)6820 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 6820 6821 && pVmxTransient->u8GuestTpr != pVCpu->hm.s.vmx.pbVirtApic[0x80]) 6821 6822 { … … 7081 7082 7082 7083 uint32_t uIntrType = VMX_EXIT_INTERRUPTION_INFO_TYPE(pVmxTransient->uExitIntrInfo); 7083 Assert( !(pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_ CONTROLS_ACK_EXT_INT)7084 Assert( !(pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_ACK_EXT_INT) 7084 7085 && uIntrType != VMX_EXIT_INTERRUPTION_INFO_TYPE_EXT_INT); 7085 7086 … … 7182 7183 7183 7184 /* Indicate that we no longer need to VM-exit when the guest is ready to receive interrupts, it is now ready. */ 7184 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT);7185 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT;7186 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);7185 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT); 7186 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT; 7187 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 7187 7188 AssertRCReturn(rc, rc); 7188 7189 … … 7282 7283 Assert(pVmxTransient->cbInstr == 2); 7283 7284 /* If we get a spurious VM-exit when offsetting is enabled, we must reset offsetting on VM-reentry. See @bugref{6634}. */ 7284 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TSC_OFFSETTING)7285 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING) 7285 7286 pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true; 7286 7287 } … … 7312 7313 Assert(pVmxTransient->cbInstr == 3); 7313 7314 /* If we get a spurious VM-exit when offsetting is enabled, we must reset offsetting on VM-reentry. See @bugref{6634}. */ 7314 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TSC_OFFSETTING)7315 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING) 7315 7316 pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true; 7316 7317 } … … 7532 7533 { 7533 7534 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 7534 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_HLT_EXIT);7535 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_HLT_EXIT); 7535 7536 int rc = hmR0VmxSaveGuestRip(pVCpu, pMixedCtx); 7536 7537 rc |= hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx); … … 7797 7798 7798 7799 /* Update MSRs that are part of the VMCS when MSR-bitmaps are not supported. */ 7799 if (RT_UNLIKELY(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)))7800 if (RT_UNLIKELY(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS))) 7800 7801 { 7801 7802 switch (pMixedCtx->ecx) … … 7849 7850 { 7850 7851 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 7851 /* By default, we don't enable VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_PAUSE_EXIT. */7852 /* By default, we don't enable VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT. */ 7852 7853 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPause); 7853 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_PAUSE_EXIT)7854 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT) 7854 7855 return VERR_EM_INTERPRETER; 7855 7856 AssertMsgFailed(("Unexpected PAUSE exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx)); … … 7865 7866 { 7866 7867 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 7867 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW);7868 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW); 7868 7869 7869 7870 /* … … 7936 7937 break; 7937 7938 case 8: /* CR8 */ 7938 Assert(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW));7939 Assert(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)); 7939 7940 /* CR8 contains the APIC TPR. Was updated by EMInterpretCRxWrite(). */ 7940 7941 /* We don't need to update HM_CHANGED_VMX_GUEST_APIC_STATE here as this -cannot- happen with TPR shadowing. */ … … 7960 7961 /* CR8 reads only cause a VM-exit when the TPR shadow feature isn't enabled. */ 7961 7962 Assert( VMX_EXIT_QUALIFICATION_CRX_REGISTER(uExitQualification) != 8 7962 || !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW));7963 || !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)); 7963 7964 7964 7965 rc = EMInterpretCRxRead(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), … … 8246 8247 { 8247 8248 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 8248 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG);8249 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG;8250 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);8249 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG); 8250 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG; 8251 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 8251 8252 AssertRCReturn(rc, rc); 8252 8253 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitMtf); … … 8289 8290 case VMX_APIC_ACCESS_TYPE_LINEAR_READ: 8290 8291 { 8291 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)8292 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 8292 8293 && VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification) == 0x80) 8293 8294 { … … 8349 8350 { 8350 8351 /* Don't intercept MOV DRx. */ 8351 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;8352 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);8352 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 8353 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 8353 8354 AssertRCReturn(rc, rc); 8354 8355 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r45894 r45947 318 318 pVM->hm.s.vmx.hMemObjApicAccess = NIL_RTR0MEMOBJ; 319 319 320 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)320 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 321 321 { 322 322 /* Allocate one page for the APIC physical page (serves for filtering accesses). */ … … 384 384 385 385 /* Allocate the MSR bitmap if this feature is supported. */ 386 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)386 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 387 387 { 388 388 rc = RTR0MemObjAllocCont(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, PAGE_SIZE, false /* fExecutable */); … … 606 606 607 607 /* 608 * VMX_VMCS_CTRL_PIN_EXEC _CONTROLS608 * VMX_VMCS_CTRL_PIN_EXEC 609 609 * Set required bits to one and zero according to the MSR capabilities. 610 610 */ 611 611 val = pVM->hm.s.vmx.msr.vmx_pin_ctls.n.disallowed0; 612 val |= VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_EXT_INT_EXIT /* External interrupts */613 | VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_NMI_EXIT; /* Non-maskable interrupts */612 val |= VMX_VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT /* External interrupts */ 613 | VMX_VMCS_CTRL_PIN_EXEC_NMI_EXIT; /* Non-maskable interrupts */ 614 614 615 615 /* … … 617 617 */ 618 618 if (pVM->hm.s.vmx.fUsePreemptTimer) 619 val |= VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_PREEMPT_TIMER;619 val |= VMX_VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER; 620 620 val &= pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1; 621 621 622 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS, val);622 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PIN_EXEC, val); 623 623 AssertRC(rc); 624 624 pVCpu->hm.s.vmx.u32PinCtls = val; 625 625 626 626 /* 627 * VMX_VMCS_CTRL_PROC_EXEC _CONTROLS627 * VMX_VMCS_CTRL_PROC_EXEC 628 628 * Set required bits to one and zero according to the MSR capabilities. 629 629 */ 630 630 val = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0; 631 631 /* Program which event cause VM-exits and which features we want to use. */ 632 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_HLT_EXIT633 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TSC_OFFSETTING634 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT635 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_UNCOND_IO_EXIT636 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDPMC_EXIT637 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_EXIT638 | VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MWAIT_EXIT; /* don't execute mwait or else we'll idle inside632 val |= VMX_VMCS_CTRL_PROC_EXEC_HLT_EXIT 633 | VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING 634 | VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT 635 | VMX_VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT 636 | VMX_VMCS_CTRL_PROC_EXEC_RDPMC_EXIT 637 | VMX_VMCS_CTRL_PROC_EXEC_MONITOR_EXIT 638 | VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT; /* don't execute mwait or else we'll idle inside 639 639 the guest (host thinks the cpu load is high) */ 640 640 … … 642 642 if (!pVM->hm.s.fNestedPaging) 643 643 { 644 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INVLPG_EXIT645 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT646 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT;644 val |= VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT 645 | VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 646 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT; 647 647 } 648 648 649 649 /* 650 * VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MWAIT_EXIT might cause a vmlaunch650 * VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT might cause a vmlaunch 651 651 * failure with an invalid control fields error. (combined with some other exit reasons) 652 652 */ 653 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)653 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 654 654 { 655 655 /* CR8 reads from the APIC shadow page; writes cause an exit is they lower the TPR below the threshold */ 656 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW;656 val |= VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW; 657 657 Assert(pVM->hm.s.vmx.pbApicAccess); 658 658 } 659 659 else 660 660 /* Exit on CR8 reads & writes in case the TPR shadow feature isn't present. */ 661 val |= VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT;662 663 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)661 val |= VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT; 662 663 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 664 664 { 665 665 Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap); 666 val |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS;666 val |= VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS; 667 667 } 668 668 … … 675 675 pVCpu->hm.s.vmx.u32ProcCtls = val; 676 676 677 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, val);677 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, val); 678 678 AssertRC(rc); 679 679 … … 681 681 { 682 682 /* 683 * VMX_VMCS_CTRL_PROC_EXEC _CONTROLS2683 * VMX_VMCS_CTRL_PROC_EXEC2 684 684 * Set required bits to one and zero according to the MSR capabilities. 685 685 */ … … 706 706 val &= pVM->hm.s.vmx.msr.vmx_proc_ctls2.n.allowed1; 707 707 pVCpu->hm.s.vmx.u32ProcCtls2 = val; 708 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS2, val);708 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC2, val); 709 709 AssertRC(rc); 710 710 } … … 749 749 * Set the MSR bitmap address. 750 750 */ 751 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS)751 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 752 752 { 753 753 Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap); … … 794 794 AssertRC(rc); 795 795 796 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW)796 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) 797 797 { 798 798 Assert(pVM->hm.s.vmx.hMemObjApicAccess); … … 1133 1133 if (!(pCtx->eflags.u32 & X86_EFL_IF)) 1134 1134 { 1135 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT))1135 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)) 1136 1136 { 1137 1137 LogFlow(("Enable irq window exit!\n")); 1138 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT;1139 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);1138 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT; 1139 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 1140 1140 AssertRC(rc); 1141 1141 } … … 1781 1781 if (u64CurTSC + pVCpu->hm.s.vmx.u64TSCOffset > TMCpuTickGetLastSeen(pVCpu)) 1782 1782 { 1783 /* Note: VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */1783 /* Note: VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */ 1784 1784 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, pVCpu->hm.s.vmx.u64TSCOffset); 1785 1785 AssertRC(rc); 1786 1786 1787 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;1788 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);1787 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 1788 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 1789 1789 AssertRC(rc); 1790 1790 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset); … … 1797 1797 TMCpuTickGetLastSeen(pVCpu), TMCpuTickGetLastSeen(pVCpu) - u64CurTSC - pVCpu->hm.s.vmx.u64TSCOffset, 1798 1798 TMCpuTickGet(pVCpu))); 1799 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;1800 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);1799 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 1800 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 1801 1801 AssertRC(rc); 1802 1802 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscInterceptOverFlow); … … 1805 1805 else 1806 1806 { 1807 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT;1808 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);1807 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT; 1808 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 1809 1809 AssertRC(rc); 1810 1810 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); … … 1831 1831 1832 1832 /* 1833 * VMX_VMCS_CTRL_ENTRY _CONTROLS1833 * VMX_VMCS_CTRL_ENTRY 1834 1834 * Set required bits to one and zero according to the MSR capabilities. 1835 1835 */ … … 1840 1840 * Forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs 1841 1841 */ 1842 val |= VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_DEBUG;1842 val |= VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG; 1843 1843 1844 1844 if (CPUMIsGuestInLongModeEx(pCtx)) 1845 val |= VMX_VMCS_CTRL_ENTRY_ CONTROLS_IA32E_MODE_GUEST;1845 val |= VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST; 1846 1846 /* else Must be zero when AMD64 is not available. */ 1847 1847 … … 1850 1850 */ 1851 1851 val &= pVM->hm.s.vmx.msr.vmx_entry.n.allowed1; 1852 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY _CONTROLS, val);1852 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY, val); 1853 1853 AssertRC(rc); 1854 1854 1855 1855 /* 1856 * VMX_VMCS_CTRL_EXIT _CONTROLS1856 * VMX_VMCS_CTRL_EXIT 1857 1857 * Set required bits to one and zero according to the MSR capabilities. 1858 1858 */ … … 1863 1863 * Forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs 1864 1864 */ 1865 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_DEBUG;1865 val |= VMX_VMCS_CTRL_EXIT_SAVE_DEBUG; 1866 1866 1867 1867 #if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 1868 1868 if (VMX_IS_64BIT_HOST_MODE()) 1869 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE;1869 val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE; 1870 1870 /* else Must be zero when AMD64 is not available. */ 1871 1871 #elif HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) 1872 1872 if (CPUMIsGuestInLongModeEx(pCtx)) 1873 val |= VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE; /* our switcher goes to long mode */1873 val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE; /* our switcher goes to long mode */ 1874 1874 else 1875 Assert(!(val & VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE));1875 Assert(!(val & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE)); 1876 1876 #endif 1877 1877 val &= pVM->hm.s.vmx.msr.vmx_exit.n.allowed1; … … 1880 1880 * Don't acknowledge external interrupts on VM-exit. 1881 1881 */ 1882 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT _CONTROLS, val);1882 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT, val); 1883 1883 AssertRC(rc); 1884 1884 … … 2079 2079 { 2080 2080 /* Disable CR3 read/write monitoring as we don't need it for EPT. */ 2081 pVCpu->hm.s.vmx.u32ProcCtls &= ~( VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT2082 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT);2081 pVCpu->hm.s.vmx.u32ProcCtls &= ~( VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 2082 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT); 2083 2083 } 2084 2084 else 2085 2085 { 2086 2086 /* Reenable CR3 read/write monitoring as our identity mapped page table is active. */ 2087 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT2088 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT;2087 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 2088 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT; 2089 2089 } 2090 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);2090 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 2091 2091 AssertRC(rc); 2092 2092 } … … 2201 2201 #if 0 2202 2202 /* Enable single stepping if requested and CPU supports it. */ 2203 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG)2203 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG) 2204 2204 if (DBGFIsStepping(pVCpu)) 2205 2205 { 2206 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG;2207 rc = VMXWriteVmcs(VMX_VMCS_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);2206 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG; 2207 rc = VMXWriteVmcs(VMX_VMCS_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 2208 2208 AssertRC(rc); 2209 2209 } … … 2301 2301 2302 2302 /* Disable DRx move intercepts. */ 2303 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;2304 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);2303 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 2304 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 2305 2305 AssertRC(rc); 2306 2306 … … 2951 2951 RTCCUINTREG val2; 2952 2952 2953 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS, &val2);2953 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC, &val2); 2954 2954 AssertRC(rc2); 2955 Log2(("VMX_VMCS_CTRL_PIN_EXEC _CONTROLS= %08x\n", val2));2955 Log2(("VMX_VMCS_CTRL_PIN_EXEC = %08x\n", val2)); 2956 2956 2957 2957 /* allowed zero */ 2958 2958 if ((val2 & pVM->hm.s.vmx.msr.vmx_pin_ctls.n.disallowed0) != pVM->hm.s.vmx.msr.vmx_pin_ctls.n.disallowed0) 2959 Log(("Invalid VMX_VMCS_CTRL_PIN_EXEC _CONTROLS: zero\n"));2959 Log(("Invalid VMX_VMCS_CTRL_PIN_EXEC: zero\n")); 2960 2960 2961 2961 /* allowed one */ 2962 2962 if ((val2 & ~pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1) != 0) 2963 Log(("Invalid VMX_VMCS_CTRL_PIN_EXEC _CONTROLS: one\n"));2964 2965 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, &val2);2963 Log(("Invalid VMX_VMCS_CTRL_PIN_EXEC: one\n")); 2964 2965 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC, &val2); 2966 2966 AssertRC(rc2); 2967 Log2(("VMX_VMCS_CTRL_PROC_EXEC _CONTROLS= %08x\n", val2));2967 Log2(("VMX_VMCS_CTRL_PROC_EXEC = %08x\n", val2)); 2968 2968 2969 2969 /* … … 2972 2972 if (pVM->hm.s.fNestedPaging) 2973 2973 { 2974 val2 |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INVLPG_EXIT2975 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT2976 | VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT;2974 val2 |= VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT 2975 | VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT 2976 | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT; 2977 2977 } 2978 2978 2979 2979 /* allowed zero */ 2980 2980 if ((val2 & pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0) != pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0) 2981 Log(("Invalid VMX_VMCS_CTRL_PROC_EXEC _CONTROLS: zero\n"));2981 Log(("Invalid VMX_VMCS_CTRL_PROC_EXEC: zero\n")); 2982 2982 2983 2983 /* allowed one */ 2984 2984 if ((val2 & ~pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1) != 0) 2985 Log(("Invalid VMX_VMCS_CTRL_PROC_EXEC _CONTROLS: one\n"));2986 2987 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY _CONTROLS, &val2);2985 Log(("Invalid VMX_VMCS_CTRL_PROC_EXEC: one\n")); 2986 2987 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY, &val2); 2988 2988 AssertRC(rc2); 2989 Log2(("VMX_VMCS_CTRL_ENTRY _CONTROLS= %08x\n", val2));2989 Log2(("VMX_VMCS_CTRL_ENTRY = %08x\n", val2)); 2990 2990 2991 2991 /* allowed zero */ 2992 2992 if ((val2 & pVM->hm.s.vmx.msr.vmx_entry.n.disallowed0) != pVM->hm.s.vmx.msr.vmx_entry.n.disallowed0) 2993 Log(("Invalid VMX_VMCS_CTRL_ENTRY _CONTROLS: zero\n"));2993 Log(("Invalid VMX_VMCS_CTRL_ENTRY: zero\n")); 2994 2994 2995 2995 /* allowed one */ 2996 2996 if ((val2 & ~pVM->hm.s.vmx.msr.vmx_entry.n.allowed1) != 0) 2997 Log(("Invalid VMX_VMCS_CTRL_ENTRY _CONTROLS: one\n"));2998 2999 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_EXIT _CONTROLS, &val2);2997 Log(("Invalid VMX_VMCS_CTRL_ENTRY: one\n")); 2998 2999 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_EXIT, &val2); 3000 3000 AssertRC(rc2); 3001 Log2(("VMX_VMCS_CTRL_EXIT _CONTROLS= %08x\n", val2));3001 Log2(("VMX_VMCS_CTRL_EXIT = %08x\n", val2)); 3002 3002 3003 3003 /* allowed zero */ 3004 3004 if ((val2 & pVM->hm.s.vmx.msr.vmx_exit.n.disallowed0) != pVM->hm.s.vmx.msr.vmx_exit.n.disallowed0) 3005 Log(("Invalid VMX_VMCS_CTRL_EXIT _CONTROLS: zero\n"));3005 Log(("Invalid VMX_VMCS_CTRL_EXIT: zero\n")); 3006 3006 3007 3007 /* allowed one */ 3008 3008 if ((val2 & ~pVM->hm.s.vmx.msr.vmx_exit.n.allowed1) != 0) 3009 Log(("Invalid VMX_VMCS_CTRL_EXIT _CONTROLS: one\n"));3009 Log(("Invalid VMX_VMCS_CTRL_EXIT: one\n")); 3010 3010 } 3011 3011 fWasInLongMode = CPUMIsGuestInLongModeEx(pCtx); … … 3347 3347 */ 3348 3348 if ( (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP) 3349 && !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT))3349 && !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)) 3350 3350 { 3351 3351 pVCpu->hm.s.u64HostTscAux = ASMRdMsr(MSR_K8_TSC_AUX); … … 3366 3366 3367 3367 /* Possibly the last TSC value seen by the guest (too high) (only when we're in TSC offset mode). */ 3368 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT))3368 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)) 3369 3369 { 3370 3370 #ifndef VBOX_WITH_AUTO_MSR_LOAD_RESTORE … … 4258 4258 LogFlow(("VMX_EXIT_INT_WINDOW %RGv pending=%d IF=%d\n", (RTGCPTR)pCtx->rip, 4259 4259 VMCPU_FF_ISPENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC|VMCPU_FF_INTERRUPT_PIC)), pCtx->eflags.Bits.u1IF)); 4260 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT;4261 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);4260 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT; 4261 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 4262 4262 AssertRC(rc2); 4263 4263 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIntWindow); … … 4442 4442 /* CR8 contains the APIC TPR */ 4443 4443 Assert(!(pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 4444 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW));4444 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)); 4445 4445 break; 4446 4446 … … 4463 4463 /* CR8 reads only cause an exit when the TPR shadow feature isn't present. */ 4464 4464 Assert( VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != 8 4465 || !(pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW));4465 || !(pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)); 4466 4466 4467 4467 rc = EMInterpretCRxRead(pVM, pVCpu, CPUMCTX2CORE(pCtx), … … 4511 4511 { 4512 4512 /* Disable DRx move intercepts. */ 4513 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;4514 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);4513 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 4514 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 4515 4515 AssertRC(rc2); 4516 4516 … … 4540 4540 } 4541 4541 4542 /** @todo clear VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT after the first4542 /** @todo clear VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT after the first 4543 4543 * time and restore DRx registers afterwards */ 4544 4544 if (VMX_EXIT_QUALIFICATION_DRX_DIRECTION(exitQualification) == VMX_EXIT_QUALIFICATION_DRX_DIRECTION_WRITE) … … 4880 4880 case VMX_EXIT_MTF: /* 37 Exit due to Monitor Trap Flag. */ 4881 4881 LogFlow(("VMX_EXIT_MTF at %RGv\n", (RTGCPTR)pCtx->rip)); 4882 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG;4883 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);4882 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG; 4883 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 4884 4884 AssertRC(rc2); 4885 4885 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitMtf); … … 5103 5103 { 5104 5104 CPUMR0LoadHostDebugState(pVM, pVCpu); 5105 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT);5105 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT); 5106 5106 } 5107 5107 else … … 5116 5116 5117 5117 /* Enable DRx move intercepts again. */ 5118 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT;5119 int rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);5118 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; 5119 int rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 5120 5120 AssertRC(rc); 5121 5121 … … 5124 5124 } 5125 5125 else 5126 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT);5126 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT); 5127 5127 5128 5128 /* … … 5313 5313 VMXReadVmcs(VMX_VMCS_GUEST_RIP, &val); 5314 5314 Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val)); 5315 VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS, &val);5316 Log(("VMX_VMCS_CTRL_PIN_EXEC _CONTROLS%08x\n", val));5317 VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS, &val);5318 Log(("VMX_VMCS_CTRL_PROC_EXEC _CONTROLS%08x\n", val));5319 VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY _CONTROLS, &val);5320 Log(("VMX_VMCS_CTRL_ENTRY _CONTROLS%08x\n", val));5321 VMXReadVmcs(VMX_VMCS32_CTRL_EXIT _CONTROLS, &val);5322 Log(("VMX_VMCS_CTRL_EXIT _CONTROLS%08x\n", val));5315 VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC, &val); 5316 Log(("VMX_VMCS_CTRL_PIN_EXEC %08x\n", val)); 5317 VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC, &val); 5318 Log(("VMX_VMCS_CTRL_PROC_EXEC %08x\n", val)); 5319 VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY, &val); 5320 Log(("VMX_VMCS_CTRL_ENTRY %08x\n", val)); 5321 VMXReadVmcs(VMX_VMCS32_CTRL_EXIT, &val); 5322 Log(("VMX_VMCS_CTRL_EXIT %08x\n", val)); 5323 5323 5324 5324 VMXReadVmcs(VMX_VMCS_HOST_CR0, &val); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r45919 r45947 992 992 val = pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1; 993 993 zap = pVM->hm.s.vmx.msr.vmx_pin_ctls.n.disallowed0; 994 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_EXT_INT_EXIT);995 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_NMI_EXIT);996 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_VIRTUAL_NMI);997 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_ CONTROLS_PREEMPT_TIMER);994 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT); 995 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_NMI_EXIT); 996 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI); 997 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER); 998 998 999 999 LogRel(("HM: MSR_IA32_VMX_PROCBASED_CTLS = %RX64\n", pVM->hm.s.vmx.msr.vmx_proc_ctls.u)); 1000 1000 val = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1; 1001 1001 zap = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0; 1002 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INT_WINDOW_EXIT);1003 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TSC_OFFSETTING);1004 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_HLT_EXIT);1005 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_INVLPG_EXIT);1006 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MWAIT_EXIT);1007 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDPMC_EXIT);1008 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_RDTSC_EXIT);1009 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_LOAD_EXIT);1010 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR3_STORE_EXIT);1011 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_LOAD_EXIT);1012 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_C ONTROLS_CR8_STORE_EXIT);1013 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_TPR_SHADOW);1014 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_NMI_WINDOW_EXIT);1015 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MOV_DR_EXIT);1016 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_UNCOND_IO_EXIT);1017 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_IO_BITMAPS);1018 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_TRAP_FLAG);1019 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_USE_MSR_BITMAPS);1020 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_MONITOR_EXIT);1021 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_ CONTROLS_PAUSE_EXIT);1002 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT); 1003 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING); 1004 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_HLT_EXIT); 1005 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT); 1006 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT); 1007 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_RDPMC_EXIT); 1008 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT); 1009 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT); 1010 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT); 1011 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT); 1012 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT); 1013 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW); 1014 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT); 1015 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT); 1016 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT); 1017 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_USE_IO_BITMAPS); 1018 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG); 1019 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS); 1020 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_MONITOR_EXIT); 1021 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT); 1022 1022 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL); 1023 1023 if (pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL) … … 1043 1043 val = pVM->hm.s.vmx.msr.vmx_entry.n.allowed1; 1044 1044 zap = pVM->hm.s.vmx.msr.vmx_entry.n.disallowed0; 1045 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_DEBUG);1046 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_IA32E_MODE_GUEST);1047 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_ENTRY_SMM);1048 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_DEACTIVATE_DUALMON);1049 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_PERF_MSR);1050 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_PAT_MSR);1051 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ CONTROLS_LOAD_GUEST_EFER_MSR);1045 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG); 1046 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST); 1047 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_ENTRY_SMM); 1048 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON); 1049 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR); 1050 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR); 1051 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR); 1052 1052 1053 1053 LogRel(("HM: MSR_IA32_VMX_EXIT_CTLS = %RX64\n", pVM->hm.s.vmx.msr.vmx_exit.u)); 1054 1054 val = pVM->hm.s.vmx.msr.vmx_exit.n.allowed1; 1055 1055 zap = pVM->hm.s.vmx.msr.vmx_exit.n.disallowed0; 1056 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_DEBUG);1057 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_HOST_ADDR_SPACE_SIZE);1058 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_PERF_MSR);1059 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_ACK_EXT_INT);1060 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_GUEST_PAT_MSR);1061 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_HOST_PAT_MSR);1062 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_GUEST_EFER_MSR);1063 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_LOAD_HOST_EFER_MSR);1064 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ CONTROLS_SAVE_VMX_PREEMPT_TIMER);1056 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_SAVE_DEBUG); 1057 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE); 1058 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_LOAD_PERF_MSR); 1059 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_ACK_EXT_INT); 1060 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_SAVE_GUEST_PAT_MSR); 1061 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_LOAD_HOST_PAT_MSR); 1062 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR); 1063 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR); 1064 VMX_REPORT_FEATURE(val, zap, VMX_VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER); 1065 1065 1066 1066 if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps) … … 2573 2573 || (pCtx->gs.Sel & X86_SEL_RPL) 2574 2574 || (pCtx->ss.Sel & X86_SEL_RPL)) 2575 { 2575 { 2576 2576 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadSel); 2577 2577 return false; … … 2589 2589 || !hmR3IsDataSelectorOkForVmx(&pCtx->gs) 2590 2590 || !hmR3IsStackSelectorOkForVmx(&pCtx->ss)) 2591 { 2591 { 2592 2592 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadSel); 2593 2593 return false; … … 2598 2598 if (pCtx->gdtr.cbGdt) 2599 2599 { 2600 if (pCtx->tr.Sel > pCtx->gdtr.cbGdt) 2600 if (pCtx->tr.Sel > pCtx->gdtr.cbGdt) 2601 2601 { 2602 2602 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadTr); -
trunk/src/VBox/VMM/include/HMInternal.h
r45919 r45947 582 582 #endif 583 583 584 /** Current VMX_VMCS32_CTRL_PIN_EXEC _CONTROLS. */584 /** Current VMX_VMCS32_CTRL_PIN_EXEC. */ 585 585 uint32_t u32PinCtls; 586 /** Current VMX_VMCS32_CTRL_PROC_EXEC _CONTROLS. */586 /** Current VMX_VMCS32_CTRL_PROC_EXEC. */ 587 587 uint32_t u32ProcCtls; 588 /** Current VMX_VMCS32_CTRL_PROC_EXEC2 _CONTROLS. */588 /** Current VMX_VMCS32_CTRL_PROC_EXEC2. */ 589 589 uint32_t u32ProcCtls2; 590 /** Current VMX_VMCS32_CTRL_EXIT _CONTROLS. */590 /** Current VMX_VMCS32_CTRL_EXIT. */ 591 591 uint32_t u32ExitCtls; 592 /** Current VMX_VMCS32_CTRL_ENTRY _CONTROLS. */592 /** Current VMX_VMCS32_CTRL_ENTRY. */ 593 593 uint32_t u32EntryCtls; 594 594 /** Physical address of the virtual APIC page for TPR caching. */
Note:
See TracChangeset
for help on using the changeset viewer.