Changeset 43930 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Nov 21, 2012 3:36:39 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0A.asm
r43737 r43930 280 280 ; */ 281 281 ALIGNCODE(16) 282 BEGINPROC VMXWriteV MCS64282 BEGINPROC VMXWriteVmcs64 283 283 %ifdef RT_ARCH_AMD64 284 284 %ifdef ASM_CALL64_GCC … … 335 335 BITS 32 336 336 %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL 337 ENDPROC VMXWriteV MCS64337 ENDPROC VMXWriteVmcs64 338 338 339 339 … … 345 345 ; * @param pData Ptr to store VM field value 346 346 ; */ 347 ;DECLASM(int) VMXReadV MCS64(uint32_t idxField, uint64_t *pData);348 ALIGNCODE(16) 349 BEGINPROC VMXReadV MCS64347 ;DECLASM(int) VMXReadVmcs64(uint32_t idxField, uint64_t *pData); 348 ALIGNCODE(16) 349 BEGINPROC VMXReadVmcs64 350 350 %ifdef RT_ARCH_AMD64 351 351 %ifdef ASM_CALL64_GCC … … 402 402 BITS 32 403 403 %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL 404 ENDPROC VMXReadV MCS64404 ENDPROC VMXReadVmcs64 405 405 406 406 … … 412 412 ; * @param pu32Data Ptr to store VM field value 413 413 ; */ 414 ;DECLASM(int) VMXReadV MCS32(uint32_t idxField, uint32_t *pu32Data);415 ALIGNCODE(16) 416 BEGINPROC VMXReadV MCS32414 ;DECLASM(int) VMXReadVmcs32(uint32_t idxField, uint32_t *pu32Data); 415 ALIGNCODE(16) 416 BEGINPROC VMXReadVmcs32 417 417 %ifdef RT_ARCH_AMD64 418 418 %ifdef ASM_CALL64_GCC … … 467 467 BITS 32 468 468 %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL 469 ENDPROC VMXReadV MCS32469 ENDPROC VMXReadVmcs32 470 470 471 471 … … 477 477 ; * @param u32Data Ptr to store VM field value 478 478 ; */ 479 ;DECLASM(int) VMXWriteV MCS32(uint32_t idxField, uint32_t u32Data);480 ALIGNCODE(16) 481 BEGINPROC VMXWriteV MCS32479 ;DECLASM(int) VMXWriteVmcs32(uint32_t idxField, uint32_t u32Data); 480 ALIGNCODE(16) 481 BEGINPROC VMXWriteVmcs32 482 482 %ifdef RT_ARCH_AMD64 483 483 %ifdef ASM_CALL64_GCC … … 531 531 BITS 32 532 532 %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL 533 ENDPROC VMXWriteV MCS32533 ENDPROC VMXWriteVmcs32 534 534 535 535 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r43849 r43930 102 102 RTCCUINTREG instrError; 103 103 104 VMXReadV MCS(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError);104 VMXReadVmcs(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError); 105 105 pVCpu->hm.s.vmx.lasterror.ulInstrError = instrError; 106 106 } … … 528 528 val &= pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1; 529 529 530 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, val);530 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, val); 531 531 AssertRC(rc); 532 532 … … 582 582 pVCpu->hm.s.vmx.u64ProcCtls = val; 583 583 584 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, val);584 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, val); 585 585 AssertRC(rc); 586 586 … … 613 613 val &= pVM->hm.s.vmx.msr.vmx_proc_ctls2.n.allowed1; 614 614 pVCpu->hm.s.vmx.u64ProcCtls2 = val; 615 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS2, val);615 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS2, val); 616 616 AssertRC(rc); 617 617 } … … 621 621 * Set required bits to one and zero according to the MSR capabilities. 622 622 */ 623 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_CR3_TARGET_COUNT, 0);623 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_CR3_TARGET_COUNT, 0); 624 624 AssertRC(rc); 625 625 … … 641 641 * Don't filter page faults, all of them should cause a world switch. 642 642 */ 643 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PAGEFAULT_ERROR_MASK, 0);643 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PAGEFAULT_ERROR_MASK, 0); 644 644 AssertRC(rc); 645 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PAGEFAULT_ERROR_MATCH, 0);645 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PAGEFAULT_ERROR_MATCH, 0); 646 646 AssertRC(rc); 647 647 648 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, 0);648 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, 0); 649 649 AssertRC(rc); 650 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_IO_BITMAP_A_FULL, 0);650 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_IO_BITMAP_A_FULL, 0); 651 651 AssertRC(rc); 652 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_IO_BITMAP_B_FULL, 0);652 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_IO_BITMAP_B_FULL, 0); 653 653 AssertRC(rc); 654 654 … … 660 660 Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap); 661 661 662 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_MSR_BITMAP_FULL, pVCpu->hm.s.vmx.HCPhysMsrBitmap);662 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_MSR_BITMAP_FULL, pVCpu->hm.s.vmx.HCPhysMsrBitmap); 663 663 AssertRC(rc); 664 664 … … 685 685 */ 686 686 Assert(pVCpu->hm.s.vmx.HCPhysGuestMsr); 687 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_ENTRY_MSR_LOAD_FULL, pVCpu->hm.s.vmx.HCPhysGuestMsr);687 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_ENTRY_MSR_LOAD_FULL, pVCpu->hm.s.vmx.HCPhysGuestMsr); 688 688 AssertRC(rc); 689 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_EXIT_MSR_STORE_FULL, pVCpu->hm.s.vmx.HCPhysGuestMsr);689 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EXIT_MSR_STORE_FULL, pVCpu->hm.s.vmx.HCPhysGuestMsr); 690 690 AssertRC(rc); 691 691 Assert(pVCpu->hm.s.vmx.HCPhysHostMsr); 692 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_EXIT_MSR_LOAD_FULL, pVCpu->hm.s.vmx.HCPhysHostMsr);692 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EXIT_MSR_LOAD_FULL, pVCpu->hm.s.vmx.HCPhysHostMsr); 693 693 AssertRC(rc); 694 694 #endif /* VBOX_WITH_AUTO_MSR_LOAD_RESTORE */ 695 695 696 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_MSR_LOAD_COUNT, 0);696 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_MSR_LOAD_COUNT, 0); 697 697 AssertRC(rc); 698 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXIT_MSR_STORE_COUNT, 0);698 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT_MSR_STORE_COUNT, 0); 699 699 AssertRC(rc); 700 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXIT_MSR_LOAD_COUNT, 0);700 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT_MSR_LOAD_COUNT, 0); 701 701 AssertRC(rc); 702 702 … … 705 705 Assert(pVM->hm.s.vmx.hMemObjApicAccess); 706 706 /* Optional */ 707 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_TPR_THRESHOLD, 0);708 rc |= VMXWriteV MCS64(VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVAPIC);707 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_TPR_THRESHOLD, 0); 708 rc |= VMXWriteVmcs64(VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVAPIC); 709 709 710 710 if (pVM->hm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC) 711 rc |= VMXWriteV MCS64(VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL, pVM->hm.s.vmx.HCPhysApicAccess);711 rc |= VMXWriteVmcs64(VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL, pVM->hm.s.vmx.HCPhysApicAccess); 712 712 713 713 AssertRC(rc); … … 715 715 716 716 /* Set link pointer to -1. Not currently used. */ 717 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL, 0xFFFFFFFFFFFFFFFFULL);717 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL, 0xFFFFFFFFFFFFFFFFULL); 718 718 AssertRC(rc); 719 719 … … 730 730 PVMCSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache; 731 731 732 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_RIP);733 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_RSP);734 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_RFLAGS);735 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE);736 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_CTRL_CR0_READ_SHADOW);737 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_CR0);738 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_CTRL_CR4_READ_SHADOW);739 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_CR4);740 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_DR7);741 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_SYSENTER_CS);742 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_SYSENTER_EIP);743 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_SYSENTER_ESP);744 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_GDTR_LIMIT);745 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_GDTR_BASE);746 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_IDTR_LIMIT);747 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_IDTR_BASE);732 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_RIP); 733 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_RSP); 734 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_RFLAGS); 735 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE); 736 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_CTRL_CR0_READ_SHADOW); 737 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_CR0); 738 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_CTRL_CR4_READ_SHADOW); 739 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_CR4); 740 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_DR7); 741 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_SYSENTER_CS); 742 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_SYSENTER_EIP); 743 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_SYSENTER_ESP); 744 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_GDTR_LIMIT); 745 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_GDTR_BASE); 746 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_IDTR_LIMIT); 747 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_IDTR_BASE); 748 748 749 749 VMX_SETUP_SELREG(ES, pCache); … … 759 759 * Status code VMCS reads. 760 760 */ 761 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_EXIT_REASON);762 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_VM_INSTR_ERROR);763 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_EXIT_INSTR_LENGTH);764 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_EXIT_INTERRUPTION_ERRCODE);765 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO);766 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_EXIT_INSTR_INFO);767 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_RO_EXIT_QUALIFICATION);768 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_IDT_INFO);769 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_RO_IDT_ERRCODE);761 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_EXIT_REASON); 762 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_VM_INSTR_ERROR); 763 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_EXIT_INSTR_LENGTH); 764 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_EXIT_INTERRUPTION_ERRCODE); 765 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO); 766 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_EXIT_INSTR_INFO); 767 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_RO_EXIT_QUALIFICATION); 768 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_IDT_INFO); 769 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_RO_IDT_ERRCODE); 770 770 771 771 if (pVM->hm.s.fNestedPaging) 772 772 { 773 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_CR3);774 VMXSetupCachedReadV MCS(pCache, VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL);773 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_CR3); 774 VMXSetupCachedReadVmcs(pCache, VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL); 775 775 pCache->Read.cValidEntries = VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX; 776 776 } … … 974 974 * Set event injection state. 975 975 */ 976 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, intInfo | (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT));977 rc |= VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH, cbInstr);978 rc |= VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE, errCode);976 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, intInfo | (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT)); 977 rc |= VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH, cbInstr); 978 rc |= VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE, errCode); 979 979 980 980 AssertRC(rc); … … 1044 1044 LogFlow(("Enable irq window exit!\n")); 1045 1045 pVCpu->hm.s.vmx.u64ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT; 1046 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);1046 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 1047 1047 AssertRC(rc); 1048 1048 } … … 1226 1226 * Control registers. 1227 1227 */ 1228 rc = VMXWriteV MCS(VMX_VMCS_HOST_CR0, ASMGetCR0());1228 rc = VMXWriteVmcs(VMX_VMCS_HOST_CR0, ASMGetCR0()); 1229 1229 Log2(("VMX_VMCS_HOST_CR0 %08x\n", ASMGetCR0())); 1230 1230 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL … … 1232 1232 { 1233 1233 cr3 = hmR0Get64bitCR3(); 1234 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_CR3, cr3);1234 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_CR3, cr3); 1235 1235 } 1236 1236 else … … 1238 1238 { 1239 1239 cr3 = ASMGetCR3(); 1240 rc |= VMXWriteV MCS(VMX_VMCS_HOST_CR3, cr3);1240 rc |= VMXWriteVmcs(VMX_VMCS_HOST_CR3, cr3); 1241 1241 } 1242 1242 Log2(("VMX_VMCS_HOST_CR3 %08RX64\n", cr3)); 1243 rc |= VMXWriteV MCS(VMX_VMCS_HOST_CR4, ASMGetCR4());1243 rc |= VMXWriteVmcs(VMX_VMCS_HOST_CR4, ASMGetCR4()); 1244 1244 Log2(("VMX_VMCS_HOST_CR4 %08x\n", ASMGetCR4())); 1245 1245 AssertRC(rc); … … 1266 1266 Assert(!(cs & X86_SEL_LDT)); Assert((cs & X86_SEL_RPL) == 0); 1267 1267 Assert(!(ss & X86_SEL_LDT)); Assert((ss & X86_SEL_RPL) == 0); 1268 rc = VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_CS, cs);1268 rc = VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_CS, cs); 1269 1269 /* Note: VMX is (again) very picky about the RPL of the selectors here; we'll restore them manually. */ 1270 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_DS, 0);1271 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_ES, 0);1270 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_DS, 0); 1271 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_ES, 0); 1272 1272 #if HC_ARCH_BITS == 32 1273 1273 if (!VMX_IS_64BIT_HOST_MODE()) 1274 1274 { 1275 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_FS, 0);1276 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_GS, 0);1277 } 1278 #endif 1279 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_SS, ss);1275 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_FS, 0); 1276 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_GS, 0); 1277 } 1278 #endif 1279 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_SS, ss); 1280 1280 SelTR = ASMGetTR(); 1281 rc |= VMXWriteV MCS(VMX_VMCS16_HOST_FIELD_TR, SelTR);1281 rc |= VMXWriteVmcs(VMX_VMCS16_HOST_FIELD_TR, SelTR); 1282 1282 AssertRC(rc); 1283 1283 Log2(("VMX_VMCS_HOST_FIELD_CS %08x (%08x)\n", cs, ASMGetSS())); … … 1297 1297 X86XDTR64 gdtr64, idtr64; 1298 1298 hmR0Get64bitGdtrAndIdtr(&gdtr64, &idtr64); 1299 rc = VMXWriteV MCS64(VMX_VMCS_HOST_GDTR_BASE, gdtr64.uAddr);1300 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_IDTR_BASE, idtr64.uAddr);1299 rc = VMXWriteVmcs64(VMX_VMCS_HOST_GDTR_BASE, gdtr64.uAddr); 1300 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_IDTR_BASE, idtr64.uAddr); 1301 1301 AssertRC(rc); 1302 1302 Log2(("VMX_VMCS_HOST_GDTR_BASE %RX64\n", gdtr64.uAddr)); … … 1309 1309 { 1310 1310 ASMGetGDTR(&gdtr); 1311 rc = VMXWriteV MCS(VMX_VMCS_HOST_GDTR_BASE, gdtr.pGdt);1311 rc = VMXWriteVmcs(VMX_VMCS_HOST_GDTR_BASE, gdtr.pGdt); 1312 1312 ASMGetIDTR(&idtr); 1313 rc |= VMXWriteV MCS(VMX_VMCS_HOST_IDTR_BASE, idtr.pIdt);1313 rc |= VMXWriteVmcs(VMX_VMCS_HOST_IDTR_BASE, idtr.pIdt); 1314 1314 AssertRC(rc); 1315 1315 Log2(("VMX_VMCS_HOST_GDTR_BASE %RHv\n", gdtr.pGdt)); … … 1331 1331 { 1332 1332 uint64_t trBase64 = X86DESC64_BASE((PX86DESC64)pDesc); 1333 rc = VMXWriteV MCS64(VMX_VMCS_HOST_TR_BASE, trBase64);1333 rc = VMXWriteVmcs64(VMX_VMCS_HOST_TR_BASE, trBase64); 1334 1334 Log2(("VMX_VMCS_HOST_TR_BASE %RX64\n", trBase64)); 1335 1335 AssertRC(rc); … … 1343 1343 trBase = X86DESC_BASE(pDesc); 1344 1344 #endif 1345 rc = VMXWriteV MCS(VMX_VMCS_HOST_TR_BASE, trBase);1345 rc = VMXWriteVmcs(VMX_VMCS_HOST_TR_BASE, trBase); 1346 1346 AssertRC(rc); 1347 1347 Log2(("VMX_VMCS_HOST_TR_BASE %RHv\n", trBase)); … … 1356 1356 Log2(("MSR_K8_FS_BASE = %RX64\n", ASMRdMsr(MSR_K8_FS_BASE))); 1357 1357 Log2(("MSR_K8_GS_BASE = %RX64\n", ASMRdMsr(MSR_K8_GS_BASE))); 1358 rc = VMXWriteV MCS64(VMX_VMCS_HOST_FS_BASE, ASMRdMsr(MSR_K8_FS_BASE));1359 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_GS_BASE, ASMRdMsr(MSR_K8_GS_BASE));1358 rc = VMXWriteVmcs64(VMX_VMCS_HOST_FS_BASE, ASMRdMsr(MSR_K8_FS_BASE)); 1359 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_GS_BASE, ASMRdMsr(MSR_K8_GS_BASE)); 1360 1360 } 1361 1361 #endif … … 1366 1366 */ 1367 1367 /** @todo expensive!! */ 1368 rc = VMXWriteV MCS(VMX_VMCS32_HOST_SYSENTER_CS, ASMRdMsr_Low(MSR_IA32_SYSENTER_CS));1368 rc = VMXWriteVmcs(VMX_VMCS32_HOST_SYSENTER_CS, ASMRdMsr_Low(MSR_IA32_SYSENTER_CS)); 1369 1369 Log2(("VMX_VMCS_HOST_SYSENTER_CS %08x\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_CS))); 1370 1370 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL … … 1373 1373 Log2(("VMX_VMCS_HOST_SYSENTER_EIP %RX64\n", ASMRdMsr(MSR_IA32_SYSENTER_EIP))); 1374 1374 Log2(("VMX_VMCS_HOST_SYSENTER_ESP %RX64\n", ASMRdMsr(MSR_IA32_SYSENTER_ESP))); 1375 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr(MSR_IA32_SYSENTER_ESP));1376 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr(MSR_IA32_SYSENTER_EIP));1375 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr(MSR_IA32_SYSENTER_ESP)); 1376 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr(MSR_IA32_SYSENTER_EIP)); 1377 1377 } 1378 1378 else 1379 1379 { 1380 rc |= VMXWriteV MCS(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP));1381 rc |= VMXWriteV MCS(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP));1380 rc |= VMXWriteVmcs(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP)); 1381 rc |= VMXWriteVmcs(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP)); 1382 1382 Log2(("VMX_VMCS_HOST_SYSENTER_EIP %RX32\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP))); 1383 1383 Log2(("VMX_VMCS_HOST_SYSENTER_ESP %RX32\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP))); 1384 1384 } 1385 1385 #elif HC_ARCH_BITS == 32 1386 rc |= VMXWriteV MCS(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP));1387 rc |= VMXWriteV MCS(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP));1386 rc |= VMXWriteVmcs(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP)); 1387 rc |= VMXWriteVmcs(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP)); 1388 1388 Log2(("VMX_VMCS_HOST_SYSENTER_EIP %RX32\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP))); 1389 1389 Log2(("VMX_VMCS_HOST_SYSENTER_ESP %RX32\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP))); … … 1391 1391 Log2(("VMX_VMCS_HOST_SYSENTER_EIP %RX64\n", ASMRdMsr(MSR_IA32_SYSENTER_EIP))); 1392 1392 Log2(("VMX_VMCS_HOST_SYSENTER_ESP %RX64\n", ASMRdMsr(MSR_IA32_SYSENTER_ESP))); 1393 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr(MSR_IA32_SYSENTER_ESP));1394 rc |= VMXWriteV MCS64(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr(MSR_IA32_SYSENTER_EIP));1393 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr(MSR_IA32_SYSENTER_ESP)); 1394 rc |= VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr(MSR_IA32_SYSENTER_EIP)); 1395 1395 #endif 1396 1396 AssertRC(rc); … … 1458 1458 /** @todo r=ramshankar: check IA32_VMX_MISC bits 27:25 for valid idxMsr 1459 1459 * range. */ 1460 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXIT_MSR_LOAD_COUNT, idxMsr);1460 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT_MSR_LOAD_COUNT, idxMsr); 1461 1461 AssertRC(rc); 1462 1462 #endif /* VBOX_WITH_AUTO_MSR_LOAD_RESTORE */ … … 1484 1484 AssertRCReturn(rc, rc); 1485 1485 1486 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_PDPTE0_FULL, aPdpes[0].u); AssertRCReturn(rc, rc);1487 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_PDPTE1_FULL, aPdpes[1].u); AssertRCReturn(rc, rc);1488 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_PDPTE2_FULL, aPdpes[2].u); AssertRCReturn(rc, rc);1489 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_PDPTE3_FULL, aPdpes[3].u); AssertRCReturn(rc, rc);1486 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_PDPTE0_FULL, aPdpes[0].u); AssertRCReturn(rc, rc); 1487 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_PDPTE1_FULL, aPdpes[1].u); AssertRCReturn(rc, rc); 1488 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_PDPTE2_FULL, aPdpes[2].u); AssertRCReturn(rc, rc); 1489 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_PDPTE3_FULL, aPdpes[3].u); AssertRCReturn(rc, rc); 1490 1490 } 1491 1491 return VINF_SUCCESS; … … 1509 1509 int rc; 1510 1510 X86PDPE aPdpes[4]; 1511 rc = VMXReadV MCS64(VMX_VMCS64_GUEST_PDPTE0_FULL, &aPdpes[0].u); AssertRCReturn(rc, rc);1512 rc = VMXReadV MCS64(VMX_VMCS64_GUEST_PDPTE1_FULL, &aPdpes[1].u); AssertRCReturn(rc, rc);1513 rc = VMXReadV MCS64(VMX_VMCS64_GUEST_PDPTE2_FULL, &aPdpes[2].u); AssertRCReturn(rc, rc);1514 rc = VMXReadV MCS64(VMX_VMCS64_GUEST_PDPTE3_FULL, &aPdpes[3].u); AssertRCReturn(rc, rc);1511 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE0_FULL, &aPdpes[0].u); AssertRCReturn(rc, rc); 1512 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE1_FULL, &aPdpes[1].u); AssertRCReturn(rc, rc); 1513 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE2_FULL, &aPdpes[2].u); AssertRCReturn(rc, rc); 1514 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE3_FULL, &aPdpes[3].u); AssertRCReturn(rc, rc); 1515 1515 1516 1516 rc = PGMGstUpdatePaePdpes(pVCpu, &aPdpes[0]); … … 1597 1597 } 1598 1598 1599 int rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXCEPTION_BITMAP, u32TrapMask);1599 int rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXCEPTION_BITMAP, u32TrapMask); 1600 1600 AssertRC(rc); 1601 1601 } … … 1621 1621 * Load EIP, ESP and EFLAGS. 1622 1622 */ 1623 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_RIP, pCtx->rip);1624 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_RSP, pCtx->rsp);1623 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_RIP, pCtx->rip); 1624 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_RSP, pCtx->rsp); 1625 1625 AssertRC(rc); 1626 1626 … … 1643 1643 eflags.Bits.u2IOPL = 0; /* must always be 0 or else certain instructions won't cause faults. */ 1644 1644 } 1645 rc = VMXWriteV MCS(VMX_VMCS_GUEST_RFLAGS, eflags.u32);1645 rc = VMXWriteVmcs(VMX_VMCS_GUEST_RFLAGS, eflags.u32); 1646 1646 AssertRC(rc); 1647 1647 } … … 1683 1683 */ 1684 1684 val &= pVM->hm.s.vmx.msr.vmx_entry.n.allowed1; 1685 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_CONTROLS, val);1685 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_CONTROLS, val); 1686 1686 AssertRC(rc); 1687 1687 … … 1713 1713 * Don't acknowledge external interrupts on VM-exit. 1714 1714 */ 1715 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXIT_CONTROLS, val);1715 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT_CONTROLS, val); 1716 1716 AssertRC(rc); 1717 1717 … … 1782 1782 if (pCtx->ldtr.Sel == 0) 1783 1783 { 1784 rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_LDTR, 0);1785 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_LDTR_LIMIT, 0);1786 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_LDTR_BASE, 0); /* @todo removing "64" in the function should be the same. */1784 rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_LDTR, 0); 1785 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_LDTR_LIMIT, 0); 1786 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_LDTR_BASE, 0); /* @todo removing "64" in the function should be the same. */ 1787 1787 /* Note: vmlaunch will fail with 0 or just 0x02. No idea why. */ 1788 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */);1788 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */); 1789 1789 } 1790 1790 else 1791 1791 { 1792 rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_LDTR, pCtx->ldtr.Sel);1793 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_LDTR_LIMIT, pCtx->ldtr.u32Limit);1794 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_LDTR_BASE, pCtx->ldtr.u64Base); /* @todo removing "64" and it should be the same */1795 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtr.Attr.u);1792 rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_LDTR, pCtx->ldtr.Sel); 1793 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_LDTR_LIMIT, pCtx->ldtr.u32Limit); 1794 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_LDTR_BASE, pCtx->ldtr.u64Base); /* @todo removing "64" and it should be the same */ 1795 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtr.Attr.u); 1796 1796 } 1797 1797 AssertRC(rc); … … 1816 1816 AssertRC(rc); 1817 1817 1818 rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_TR, 0);1819 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_TR_LIMIT, HM_VTX_TSS_SIZE);1820 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_TR_BASE, GCPhys /* phys = virt in this mode */);1818 rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_TR, 0); 1819 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_TR_LIMIT, HM_VTX_TSS_SIZE); 1820 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_TR_BASE, GCPhys /* phys = virt in this mode */); 1821 1821 1822 1822 X86DESCATTR attr; … … 1829 1829 else 1830 1830 { 1831 rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_TR, pCtx->tr.Sel);1832 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_TR_LIMIT, pCtx->tr.u32Limit);1833 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_TR_BASE, pCtx->tr.u64Base);1831 rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_TR, pCtx->tr.Sel); 1832 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_TR_LIMIT, pCtx->tr.u32Limit); 1833 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_TR_BASE, pCtx->tr.u64Base); 1834 1834 1835 1835 val = pCtx->tr.Attr.u; … … 1847 1847 ("%#x\n", val)); 1848 1848 } 1849 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS, val);1849 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS, val); 1850 1850 AssertRC(rc); 1851 1851 } … … 1856 1856 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_GDTR) 1857 1857 { 1858 rc = VMXWriteV MCS(VMX_VMCS32_GUEST_GDTR_LIMIT, pCtx->gdtr.cbGdt);1859 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_GDTR_BASE, pCtx->gdtr.pGdt);1858 rc = VMXWriteVmcs(VMX_VMCS32_GUEST_GDTR_LIMIT, pCtx->gdtr.cbGdt); 1859 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_GDTR_BASE, pCtx->gdtr.pGdt); 1860 1860 AssertRC(rc); 1861 1861 } … … 1866 1866 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_IDTR) 1867 1867 { 1868 rc = VMXWriteV MCS(VMX_VMCS32_GUEST_IDTR_LIMIT, pCtx->idtr.cbIdt);1869 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_IDTR_BASE, pCtx->idtr.pIdt);1868 rc = VMXWriteVmcs(VMX_VMCS32_GUEST_IDTR_LIMIT, pCtx->idtr.cbIdt); 1869 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_IDTR_BASE, pCtx->idtr.pIdt); 1870 1870 AssertRC(rc); 1871 1871 } … … 1876 1876 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_MSR) 1877 1877 { 1878 rc = VMXWriteV MCS(VMX_VMCS32_GUEST_SYSENTER_CS, pCtx->SysEnter.cs);1879 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip);1880 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp);1878 rc = VMXWriteVmcs(VMX_VMCS32_GUEST_SYSENTER_CS, pCtx->SysEnter.cs); 1879 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip); 1880 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp); 1881 1881 AssertRC(rc); 1882 1882 } … … 1888 1888 { 1889 1889 val = pCtx->cr0; 1890 rc = VMXWriteV MCS(VMX_VMCS_CTRL_CR0_READ_SHADOW, val);1890 rc = VMXWriteVmcs(VMX_VMCS_CTRL_CR0_READ_SHADOW, val); 1891 1891 Log2(("Guest CR0-shadow %08x\n", val)); 1892 1892 if (CPUMIsGuestFPUStateActive(pVCpu) == false) … … 1921 1921 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT; 1922 1922 } 1923 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);1923 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 1924 1924 AssertRC(rc); 1925 1925 } … … 1933 1933 val &= ~(X86_CR0_CD|X86_CR0_NW); 1934 1934 1935 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_CR0, val);1935 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_CR0, val); 1936 1936 Log2(("Guest CR0 %08x\n", val)); 1937 1937 … … 1954 1954 pVCpu->hm.s.vmx.cr0_mask = val; 1955 1955 1956 rc |= VMXWriteV MCS(VMX_VMCS_CTRL_CR0_MASK, val);1956 rc |= VMXWriteVmcs(VMX_VMCS_CTRL_CR0_MASK, val); 1957 1957 Log2(("Guest CR0-mask %08x\n", val)); 1958 1958 AssertRC(rc); … … 1961 1961 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_CR4) 1962 1962 { 1963 rc = VMXWriteV MCS(VMX_VMCS_CTRL_CR4_READ_SHADOW, pCtx->cr4);1963 rc = VMXWriteVmcs(VMX_VMCS_CTRL_CR4_READ_SHADOW, pCtx->cr4); 1964 1964 Log2(("Guest CR4-shadow %08x\n", pCtx->cr4)); 1965 1965 /* Set the required bits in cr4 too (currently X86_CR4_VMXE). */ … … 2013 2013 } 2014 2014 2015 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_CR4, val);2015 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_CR4, val); 2016 2016 Log2(("Guest CR4 %08x\n", val)); 2017 2017 … … 2027 2027 pVCpu->hm.s.vmx.cr4_mask = val; 2028 2028 2029 rc |= VMXWriteV MCS(VMX_VMCS_CTRL_CR4_MASK, val);2029 rc |= VMXWriteVmcs(VMX_VMCS_CTRL_CR4_MASK, val); 2030 2030 Log2(("Guest CR4-mask %08x\n", val)); 2031 2031 AssertRC(rc); … … 2038 2038 { 2039 2039 pVCpu->hm.s.vmx.u64ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MONITOR_TRAP_FLAG; 2040 rc = VMXWriteV MCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);2040 rc = VMXWriteVmcs(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 2041 2041 AssertRC(rc); 2042 2042 } … … 2055 2055 | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT); 2056 2056 2057 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx.GCPhysEPTP);2057 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx.GCPhysEPTP); 2058 2058 AssertRC(rc); 2059 2059 … … 2088 2088 2089 2089 /* Save our shadow CR3 register. */ 2090 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_CR3, val);2090 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_CR3, val); 2091 2091 AssertRC(rc); 2092 2092 } … … 2105 2105 2106 2106 /* Resync DR7 */ 2107 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);2107 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]); 2108 2108 AssertRC(rc); 2109 2109 … … 2121 2121 2122 2122 /* Override dr7 with the hypervisor value. */ 2123 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_DR7, CPUMGetHyperDR7(pVCpu));2123 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_DR7, CPUMGetHyperDR7(pVCpu)); 2124 2124 AssertRC(rc); 2125 2125 } … … 2135 2135 /* Disable DRx move intercepts. */ 2136 2136 pVCpu->hm.s.vmx.u64ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MOV_DR_EXIT; 2137 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);2137 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 2138 2138 AssertRC(rc); 2139 2139 … … 2144 2144 2145 2145 /* IA32_DEBUGCTL MSR. */ 2146 rc = VMXWriteV MCS64(VMX_VMCS64_GUEST_DEBUGCTL_FULL, 0);2146 rc = VMXWriteVmcs64(VMX_VMCS64_GUEST_DEBUGCTL_FULL, 0); 2147 2147 AssertRC(rc); 2148 2148 2149 2149 /** @todo do we really ever need this? */ 2150 rc |= VMXWriteV MCS(VMX_VMCS_GUEST_DEBUG_EXCEPTIONS, 0);2150 rc |= VMXWriteVmcs(VMX_VMCS_GUEST_DEBUG_EXCEPTIONS, 0); 2151 2151 AssertRC(rc); 2152 2152 } … … 2171 2171 { 2172 2172 /* Update these as wrmsr might have changed them. */ 2173 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_FS_BASE, pCtx->fs.u64Base);2173 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_FS_BASE, pCtx->fs.u64Base); 2174 2174 AssertRC(rc); 2175 rc = VMXWriteV MCS64(VMX_VMCS_GUEST_GS_BASE, pCtx->gs.u64Base);2175 rc = VMXWriteVmcs64(VMX_VMCS_GUEST_GS_BASE, pCtx->gs.u64Base); 2176 2176 AssertRC(rc); 2177 2177 } … … 2243 2243 pVCpu->hm.s.vmx.cGuestMsrs = idxMsr; 2244 2244 2245 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_MSR_LOAD_COUNT, idxMsr);2245 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_MSR_LOAD_COUNT, idxMsr); 2246 2246 AssertRC(rc); 2247 2247 2248 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_EXIT_MSR_STORE_COUNT, idxMsr);2248 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_EXIT_MSR_STORE_COUNT, idxMsr); 2249 2249 AssertRC(rc); 2250 2250 #endif /* VBOX_WITH_AUTO_MSR_LOAD_RESTORE */ … … 2263 2263 cTicksToDeadline >>= pVM->hm.s.vmx.cPreemptTimerShift; 2264 2264 uint32_t cPreemptionTickCount = (uint32_t)RT_MIN(cTicksToDeadline, UINT32_MAX - 16); 2265 rc = VMXWriteV MCS(VMX_VMCS32_GUEST_PREEMPTION_TIMER_VALUE, cPreemptionTickCount);2265 rc = VMXWriteVmcs(VMX_VMCS32_GUEST_PREEMPTION_TIMER_VALUE, cPreemptionTickCount); 2266 2266 AssertRC(rc); 2267 2267 } … … 2275 2275 { 2276 2276 /* Note: VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */ 2277 rc = VMXWriteV MCS64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, pVCpu->hm.s.vmx.u64TSCOffset);2277 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, pVCpu->hm.s.vmx.u64TSCOffset); 2278 2278 AssertRC(rc); 2279 2279 2280 2280 pVCpu->hm.s.vmx.u64ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT; 2281 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);2281 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 2282 2282 AssertRC(rc); 2283 2283 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset); … … 2291 2291 TMCpuTickGet(pVCpu))); 2292 2292 pVCpu->hm.s.vmx.u64ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT; 2293 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);2293 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 2294 2294 AssertRC(rc); 2295 2295 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscInterceptOverFlow); … … 2299 2299 { 2300 2300 pVCpu->hm.s.vmx.u64ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT; 2301 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);2301 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 2302 2302 AssertRC(rc); 2303 2303 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); … … 2328 2328 2329 2329 /* First sync back EIP, ESP, and EFLAGS. */ 2330 rc = VMXReadCachedV MCS(VMX_VMCS_GUEST_RIP, &val);2330 rc = VMXReadCachedVmcs(VMX_VMCS_GUEST_RIP, &val); 2331 2331 AssertRC(rc); 2332 2332 pCtx->rip = val; 2333 rc = VMXReadCachedV MCS(VMX_VMCS_GUEST_RSP, &val);2333 rc = VMXReadCachedVmcs(VMX_VMCS_GUEST_RSP, &val); 2334 2334 AssertRC(rc); 2335 2335 pCtx->rsp = val; 2336 rc = VMXReadCachedV MCS(VMX_VMCS_GUEST_RFLAGS, &val);2336 rc = VMXReadCachedVmcs(VMX_VMCS_GUEST_RFLAGS, &val); 2337 2337 AssertRC(rc); 2338 2338 pCtx->eflags.u32 = val; 2339 2339 2340 2340 /* Take care of instruction fusing (sti, mov ss) */ 2341 rc |= VMXReadCachedV MCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, &val);2341 rc |= VMXReadCachedVmcs(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, &val); 2342 2342 uInterruptState = val; 2343 2343 if (uInterruptState != 0) … … 2351 2351 2352 2352 /* Control registers. */ 2353 VMXReadCachedV MCS(VMX_VMCS_CTRL_CR0_READ_SHADOW, &valShadow);2354 VMXReadCachedV MCS(VMX_VMCS_GUEST_CR0, &val);2353 VMXReadCachedVmcs(VMX_VMCS_CTRL_CR0_READ_SHADOW, &valShadow); 2354 VMXReadCachedVmcs(VMX_VMCS_GUEST_CR0, &val); 2355 2355 val = (valShadow & pVCpu->hm.s.vmx.cr0_mask) | (val & ~pVCpu->hm.s.vmx.cr0_mask); 2356 2356 CPUMSetGuestCR0(pVCpu, val); 2357 2357 2358 VMXReadCachedV MCS(VMX_VMCS_CTRL_CR4_READ_SHADOW, &valShadow);2359 VMXReadCachedV MCS(VMX_VMCS_GUEST_CR4, &val);2358 VMXReadCachedVmcs(VMX_VMCS_CTRL_CR4_READ_SHADOW, &valShadow); 2359 VMXReadCachedVmcs(VMX_VMCS_GUEST_CR4, &val); 2360 2360 val = (valShadow & pVCpu->hm.s.vmx.cr4_mask) | (val & ~pVCpu->hm.s.vmx.cr4_mask); 2361 2361 CPUMSetGuestCR4(pVCpu, val); … … 2373 2373 CPUMSetGuestCR2(pVCpu, pCache->cr2); 2374 2374 2375 VMXReadCachedV MCS(VMX_VMCS_GUEST_CR3, &val);2375 VMXReadCachedVmcs(VMX_VMCS_GUEST_CR3, &val); 2376 2376 2377 2377 if (val != pCtx->cr3) … … 2385 2385 2386 2386 /* Sync back DR7. */ 2387 VMXReadCachedV MCS(VMX_VMCS_GUEST_DR7, &val);2387 VMXReadCachedVmcs(VMX_VMCS_GUEST_DR7, &val); 2388 2388 pCtx->dr[7] = val; 2389 2389 … … 2397 2397 2398 2398 /* System MSRs */ 2399 VMXReadCachedV MCS(VMX_VMCS32_GUEST_SYSENTER_CS, &val);2399 VMXReadCachedVmcs(VMX_VMCS32_GUEST_SYSENTER_CS, &val); 2400 2400 pCtx->SysEnter.cs = val; 2401 VMXReadCachedV MCS(VMX_VMCS_GUEST_SYSENTER_EIP, &val);2401 VMXReadCachedVmcs(VMX_VMCS_GUEST_SYSENTER_EIP, &val); 2402 2402 pCtx->SysEnter.eip = val; 2403 VMXReadCachedV MCS(VMX_VMCS_GUEST_SYSENTER_ESP, &val);2403 VMXReadCachedVmcs(VMX_VMCS_GUEST_SYSENTER_ESP, &val); 2404 2404 pCtx->SysEnter.esp = val; 2405 2405 … … 2407 2407 VMX_READ_SELREG(LDTR, ldtr); 2408 2408 2409 VMXReadCachedV MCS(VMX_VMCS32_GUEST_GDTR_LIMIT, &val);2409 VMXReadCachedVmcs(VMX_VMCS32_GUEST_GDTR_LIMIT, &val); 2410 2410 pCtx->gdtr.cbGdt = val; 2411 VMXReadCachedV MCS(VMX_VMCS_GUEST_GDTR_BASE, &val);2411 VMXReadCachedVmcs(VMX_VMCS_GUEST_GDTR_BASE, &val); 2412 2412 pCtx->gdtr.pGdt = val; 2413 2413 2414 VMXReadCachedV MCS(VMX_VMCS32_GUEST_IDTR_LIMIT, &val);2414 VMXReadCachedVmcs(VMX_VMCS32_GUEST_IDTR_LIMIT, &val); 2415 2415 pCtx->idtr.cbIdt = val; 2416 VMXReadCachedV MCS(VMX_VMCS_GUEST_IDTR_BASE, &val);2416 VMXReadCachedVmcs(VMX_VMCS_GUEST_IDTR_BASE, &val); 2417 2417 pCtx->idtr.pIdt = val; 2418 2418 … … 2602 2602 2603 2603 /* Update VMCS with the VPID. */ 2604 int rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid);2604 int rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid); 2605 2605 AssertRC(rc); 2606 2606 } … … 2761 2761 ("cpu%d VM uCurrentAsid = %x\n", pCpu->idCpu, pVCpu->hm.s.uCurrentAsid)); 2762 2762 2763 int rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid);2763 int rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid); 2764 2764 AssertRC(rc); 2765 2765 … … 2831 2831 * originated before a VM reset *after* the VM has been reset. See @bugref{6220}. 2832 2832 */ 2833 VMXWriteV MCS(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, 0);2833 VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, 0); 2834 2834 2835 2835 #ifdef VBOX_STRICT … … 2837 2837 RTCCUINTREG val2; 2838 2838 2839 rc2 = VMXReadV MCS(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, &val2);2839 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, &val2); 2840 2840 AssertRC(rc2); 2841 2841 Log2(("VMX_VMCS_CTRL_PIN_EXEC_CONTROLS = %08x\n", val2)); … … 2849 2849 Log(("Invalid VMX_VMCS_CTRL_PIN_EXEC_CONTROLS: one\n")); 2850 2850 2851 rc2 = VMXReadV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, &val2);2851 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, &val2); 2852 2852 AssertRC(rc2); 2853 2853 Log2(("VMX_VMCS_CTRL_PROC_EXEC_CONTROLS = %08x\n", val2)); … … 2871 2871 Log(("Invalid VMX_VMCS_CTRL_PROC_EXEC_CONTROLS: one\n")); 2872 2872 2873 rc2 = VMXReadV MCS(VMX_VMCS32_CTRL_ENTRY_CONTROLS, &val2);2873 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY_CONTROLS, &val2); 2874 2874 AssertRC(rc2); 2875 2875 Log2(("VMX_VMCS_CTRL_ENTRY_CONTROLS = %08x\n", val2)); … … 2883 2883 Log(("Invalid VMX_VMCS_CTRL_ENTRY_CONTROLS: one\n")); 2884 2884 2885 rc2 = VMXReadV MCS(VMX_VMCS32_CTRL_EXIT_CONTROLS, &val2);2885 rc2 = VMXReadVmcs(VMX_VMCS32_CTRL_EXIT_CONTROLS, &val2); 2886 2886 AssertRC(rc2); 2887 2887 Log2(("VMX_VMCS_CTRL_EXIT_CONTROLS = %08x\n", val2)); … … 2941 2941 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS); 2942 2942 /* Irq inhibition is no longer active; clear the corresponding VMX state. */ 2943 rc2 = VMXWriteV MCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0);2943 rc2 = VMXWriteVmcs(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0); 2944 2944 AssertRC(rc2); 2945 2945 } … … 2948 2948 { 2949 2949 /* Irq inhibition is no longer active; clear the corresponding VMX state. */ 2950 rc2 = VMXWriteV MCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0);2950 rc2 = VMXWriteVmcs(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0); 2951 2951 AssertRC(rc2); 2952 2952 } … … 3077 3077 3078 3078 /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 3079 rc = VMXWriteV MCS(VMX_VMCS32_CTRL_TPR_THRESHOLD, (fPending) ? (u8LastTPR >> 4) : 0);3079 rc = VMXWriteVmcs(VMX_VMCS32_CTRL_TPR_THRESHOLD, (fPending) ? (u8LastTPR >> 4) : 0); 3080 3080 AssertRC(VBOXSTRICTRC_VAL(rc)); 3081 3081 … … 3180 3180 /* Non-register state Guest Context */ 3181 3181 /** @todo change me according to cpu state */ 3182 rc2 = VMXWriteV MCS(VMX_VMCS32_GUEST_ACTIVITY_STATE, VMX_CMS_GUEST_ACTIVITY_ACTIVE);3182 rc2 = VMXWriteVmcs(VMX_VMCS32_GUEST_ACTIVITY_STATE, VMX_CMS_GUEST_ACTIVITY_ACTIVE); 3183 3183 AssertRC(rc2); 3184 3184 … … 3301 3301 3302 3302 /* Investigate why there was a VM-exit. */ 3303 rc2 = VMXReadCachedV MCS(VMX_VMCS32_RO_EXIT_REASON, &exitReason);3303 rc2 = VMXReadCachedVmcs(VMX_VMCS32_RO_EXIT_REASON, &exitReason); 3304 3304 STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[exitReason & MASK_EXITREASON_STAT]); 3305 3305 3306 3306 exitReason &= 0xffff; /* bit 0-15 contain the exit code. */ 3307 rc2 |= VMXReadCachedV MCS(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError);3308 rc2 |= VMXReadCachedV MCS(VMX_VMCS32_RO_EXIT_INSTR_LENGTH, &cbInstr);3309 rc2 |= VMXReadCachedV MCS(VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO, &intInfo);3307 rc2 |= VMXReadCachedVmcs(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError); 3308 rc2 |= VMXReadCachedVmcs(VMX_VMCS32_RO_EXIT_INSTR_LENGTH, &cbInstr); 3309 rc2 |= VMXReadCachedVmcs(VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO, &intInfo); 3310 3310 /* might not be valid; depends on VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID. */ 3311 rc2 |= VMXReadCachedV MCS(VMX_VMCS32_RO_EXIT_INTERRUPTION_ERRCODE, &errCode);3312 rc2 |= VMXReadCachedV MCS(VMX_VMCS32_RO_EXIT_INSTR_INFO, &instrInfo);3313 rc2 |= VMXReadCachedV MCS(VMX_VMCS_RO_EXIT_QUALIFICATION, &exitQualification);3311 rc2 |= VMXReadCachedVmcs(VMX_VMCS32_RO_EXIT_INTERRUPTION_ERRCODE, &errCode); 3312 rc2 |= VMXReadCachedVmcs(VMX_VMCS32_RO_EXIT_INSTR_INFO, &instrInfo); 3313 rc2 |= VMXReadCachedVmcs(VMX_VMCS_RO_EXIT_QUALIFICATION, &exitQualification); 3314 3314 AssertRC(rc2); 3315 3315 … … 3330 3330 * Check if an injected event was interrupted prematurely. 3331 3331 */ 3332 rc2 = VMXReadCachedV MCS(VMX_VMCS32_RO_IDT_INFO, &val);3332 rc2 = VMXReadCachedVmcs(VMX_VMCS32_RO_IDT_INFO, &val); 3333 3333 AssertRC(rc2); 3334 3334 pVCpu->hm.s.Event.intInfo = VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(val); … … 3344 3344 if (VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID(pVCpu->hm.s.Event.intInfo)) 3345 3345 { 3346 rc2 = VMXReadCachedV MCS(VMX_VMCS32_RO_IDT_ERRCODE, &val);3346 rc2 = VMXReadCachedVmcs(VMX_VMCS32_RO_IDT_ERRCODE, &val); 3347 3347 AssertRC(rc2); 3348 3348 pVCpu->hm.s.Event.errCode = val; … … 3646 3646 3647 3647 /* Resync DR7 */ 3648 rc2 = VMXWriteV MCS64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);3648 rc2 = VMXWriteVmcs64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]); 3649 3649 AssertRC(rc2); 3650 3650 … … 3725 3725 EMSetInhibitInterruptsPC(pVCpu, pCtx->rip + pDis->cbInstr); 3726 3726 Assert(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)); 3727 rc2 = VMXWriteV MCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE,3727 rc2 = VMXWriteVmcs(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 3728 3728 VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI); 3729 3729 AssertRC(rc2); … … 4015 4015 Assert(pVM->hm.s.fNestedPaging); 4016 4016 4017 rc2 = VMXReadV MCS64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);4017 rc2 = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys); 4018 4018 AssertRC(rc2); 4019 4019 Assert(((exitQualification >> 7) & 3) != 2); … … 4089 4089 Assert(pVM->hm.s.fNestedPaging); 4090 4090 4091 rc2 = VMXReadV MCS64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);4091 rc2 = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys); 4092 4092 AssertRC(rc2); 4093 4093 Log(("VMX_EXIT_EPT_MISCONFIG for %RGp\n", GCPhys)); … … 4135 4135 VMCPU_FF_ISPENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC|VMCPU_FF_INTERRUPT_PIC)), pCtx->eflags.Bits.u1IF)); 4136 4136 pVCpu->hm.s.vmx.u64ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT; 4137 rc2 = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);4137 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 4138 4138 AssertRC(rc2); 4139 4139 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIrqWindow); … … 4390 4390 /* Disable DRx move intercepts. */ 4391 4391 pVCpu->hm.s.vmx.u64ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MOV_DR_EXIT; 4392 rc2 = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);4392 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 4393 4393 AssertRC(rc2); 4394 4394 … … 4580 4580 4581 4581 /* Resync DR7 */ 4582 rc2 = VMXWriteV MCS64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);4582 rc2 = VMXWriteVmcs64(VMX_VMCS_GUEST_DR7, pCtx->dr[7]); 4583 4583 AssertRC(rc2); 4584 4584 … … 4756 4756 LogFlow(("VMX_EXIT_MTF at %RGv\n", (RTGCPTR)pCtx->rip)); 4757 4757 pVCpu->hm.s.vmx.u64ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MONITOR_TRAP_FLAG; 4758 rc2 = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);4758 rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 4759 4759 AssertRC(rc2); 4760 4760 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitMtf); … … 4827 4827 Log(("VMX_EXIT_ERR_INVALID_GUEST_STATE\n")); 4828 4828 4829 VMXReadV MCS(VMX_VMCS_GUEST_RIP, &val2);4829 VMXReadVmcs(VMX_VMCS_GUEST_RIP, &val2); 4830 4830 Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val2)); 4831 4831 4832 VMXReadV MCS(VMX_VMCS_GUEST_CR0, &val2);4832 VMXReadVmcs(VMX_VMCS_GUEST_CR0, &val2); 4833 4833 Log(("VMX_VMCS_GUEST_CR0 %RX64\n", (uint64_t)val2)); 4834 4834 4835 VMXReadV MCS(VMX_VMCS_GUEST_CR3, &val2);4835 VMXReadVmcs(VMX_VMCS_GUEST_CR3, &val2); 4836 4836 Log(("VMX_VMCS_GUEST_CR3 %RX64\n", (uint64_t)val2)); 4837 4837 4838 VMXReadV MCS(VMX_VMCS_GUEST_CR4, &val2);4838 VMXReadVmcs(VMX_VMCS_GUEST_CR4, &val2); 4839 4839 Log(("VMX_VMCS_GUEST_CR4 %RX64\n", (uint64_t)val2)); 4840 4840 4841 VMXReadV MCS(VMX_VMCS_GUEST_RFLAGS, &val2);4841 VMXReadVmcs(VMX_VMCS_GUEST_RFLAGS, &val2); 4842 4842 Log(("VMX_VMCS_GUEST_RFLAGS %08x\n", val2)); 4843 4843 … … 4851 4851 VMX_LOG_SELREG(LDTR, "LDTR", val2); 4852 4852 4853 VMXReadV MCS(VMX_VMCS_GUEST_GDTR_BASE, &val2);4853 VMXReadVmcs(VMX_VMCS_GUEST_GDTR_BASE, &val2); 4854 4854 Log(("VMX_VMCS_GUEST_GDTR_BASE %RX64\n", (uint64_t)val2)); 4855 VMXReadV MCS(VMX_VMCS_GUEST_IDTR_BASE, &val2);4855 VMXReadVmcs(VMX_VMCS_GUEST_IDTR_BASE, &val2); 4856 4856 Log(("VMX_VMCS_GUEST_IDTR_BASE %RX64\n", (uint64_t)val2)); 4857 4857 #endif /* VBOX_STRICT */ … … 4991 4991 /* Enable DRx move intercepts again. */ 4992 4992 pVCpu->hm.s.vmx.u64ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MOV_DR_EXIT; 4993 int rc = VMXWriteV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls);4993 int rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u64ProcCtls); 4994 4994 AssertRC(rc); 4995 4995 … … 5163 5163 RTCCUINTREG exitReason, instrError; 5164 5164 5165 rc2 = VMXReadV MCS(VMX_VMCS32_RO_EXIT_REASON, &exitReason);5166 rc2 |= VMXReadV MCS(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError);5165 rc2 = VMXReadVmcs(VMX_VMCS32_RO_EXIT_REASON, &exitReason); 5166 rc2 |= VMXReadVmcs(VMX_VMCS32_RO_VM_INSTR_ERROR, &instrError); 5167 5167 AssertRC(rc2); 5168 5168 if (rc2 == VINF_SUCCESS) … … 5182 5182 ASMGetGDTR(&gdtr); 5183 5183 5184 VMXReadV MCS(VMX_VMCS_GUEST_RIP, &val);5184 VMXReadVmcs(VMX_VMCS_GUEST_RIP, &val); 5185 5185 Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val)); 5186 VMXReadV MCS(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, &val);5186 VMXReadVmcs(VMX_VMCS32_CTRL_PIN_EXEC_CONTROLS, &val); 5187 5187 Log(("VMX_VMCS_CTRL_PIN_EXEC_CONTROLS %08x\n", val)); 5188 VMXReadV MCS(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, &val);5188 VMXReadVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, &val); 5189 5189 Log(("VMX_VMCS_CTRL_PROC_EXEC_CONTROLS %08x\n", val)); 5190 VMXReadV MCS(VMX_VMCS32_CTRL_ENTRY_CONTROLS, &val);5190 VMXReadVmcs(VMX_VMCS32_CTRL_ENTRY_CONTROLS, &val); 5191 5191 Log(("VMX_VMCS_CTRL_ENTRY_CONTROLS %08x\n", val)); 5192 VMXReadV MCS(VMX_VMCS32_CTRL_EXIT_CONTROLS, &val);5192 VMXReadVmcs(VMX_VMCS32_CTRL_EXIT_CONTROLS, &val); 5193 5193 Log(("VMX_VMCS_CTRL_EXIT_CONTROLS %08x\n", val)); 5194 5194 5195 VMXReadV MCS(VMX_VMCS_HOST_CR0, &val);5195 VMXReadVmcs(VMX_VMCS_HOST_CR0, &val); 5196 5196 Log(("VMX_VMCS_HOST_CR0 %08x\n", val)); 5197 VMXReadV MCS(VMX_VMCS_HOST_CR3, &val);5197 VMXReadVmcs(VMX_VMCS_HOST_CR3, &val); 5198 5198 Log(("VMX_VMCS_HOST_CR3 %08x\n", val)); 5199 VMXReadV MCS(VMX_VMCS_HOST_CR4, &val);5199 VMXReadVmcs(VMX_VMCS_HOST_CR4, &val); 5200 5200 Log(("VMX_VMCS_HOST_CR4 %08x\n", val)); 5201 5201 5202 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_CS, &val);5202 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_CS, &val); 5203 5203 Log(("VMX_VMCS_HOST_FIELD_CS %08x\n", val)); 5204 VMXReadV MCS(VMX_VMCS_GUEST_RFLAGS, &val);5204 VMXReadVmcs(VMX_VMCS_GUEST_RFLAGS, &val); 5205 5205 Log(("VMX_VMCS_GUEST_RFLAGS %08x\n", val)); 5206 5206 … … 5211 5211 } 5212 5212 5213 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_DS, &val);5213 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_DS, &val); 5214 5214 Log(("VMX_VMCS_HOST_FIELD_DS %08x\n", val)); 5215 5215 if (val < gdtr.cbGdt) … … 5219 5219 } 5220 5220 5221 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_ES, &val);5221 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_ES, &val); 5222 5222 Log(("VMX_VMCS_HOST_FIELD_ES %08x\n", val)); 5223 5223 if (val < gdtr.cbGdt) … … 5227 5227 } 5228 5228 5229 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_FS, &val);5229 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_FS, &val); 5230 5230 Log(("VMX_VMCS16_HOST_FIELD_FS %08x\n", val)); 5231 5231 if (val < gdtr.cbGdt) … … 5235 5235 } 5236 5236 5237 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_GS, &val);5237 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_GS, &val); 5238 5238 Log(("VMX_VMCS16_HOST_FIELD_GS %08x\n", val)); 5239 5239 if (val < gdtr.cbGdt) … … 5243 5243 } 5244 5244 5245 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_SS, &val);5245 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_SS, &val); 5246 5246 Log(("VMX_VMCS16_HOST_FIELD_SS %08x\n", val)); 5247 5247 if (val < gdtr.cbGdt) … … 5251 5251 } 5252 5252 5253 VMXReadV MCS(VMX_VMCS16_HOST_FIELD_TR, &val);5253 VMXReadVmcs(VMX_VMCS16_HOST_FIELD_TR, &val); 5254 5254 Log(("VMX_VMCS16_HOST_FIELD_TR %08x\n", val)); 5255 5255 if (val < gdtr.cbGdt) … … 5259 5259 } 5260 5260 5261 VMXReadV MCS(VMX_VMCS_HOST_TR_BASE, &val);5261 VMXReadVmcs(VMX_VMCS_HOST_TR_BASE, &val); 5262 5262 Log(("VMX_VMCS_HOST_TR_BASE %RHv\n", val)); 5263 VMXReadV MCS(VMX_VMCS_HOST_GDTR_BASE, &val);5263 VMXReadVmcs(VMX_VMCS_HOST_GDTR_BASE, &val); 5264 5264 Log(("VMX_VMCS_HOST_GDTR_BASE %RHv\n", val)); 5265 VMXReadV MCS(VMX_VMCS_HOST_IDTR_BASE, &val);5265 VMXReadVmcs(VMX_VMCS_HOST_IDTR_BASE, &val); 5266 5266 Log(("VMX_VMCS_HOST_IDTR_BASE %RHv\n", val)); 5267 VMXReadV MCS(VMX_VMCS32_HOST_SYSENTER_CS, &val);5267 VMXReadVmcs(VMX_VMCS32_HOST_SYSENTER_CS, &val); 5268 5268 Log(("VMX_VMCS_HOST_SYSENTER_CS %08x\n", val)); 5269 VMXReadV MCS(VMX_VMCS_HOST_SYSENTER_EIP, &val);5269 VMXReadVmcs(VMX_VMCS_HOST_SYSENTER_EIP, &val); 5270 5270 Log(("VMX_VMCS_HOST_SYSENTER_EIP %RHv\n", val)); 5271 VMXReadV MCS(VMX_VMCS_HOST_SYSENTER_ESP, &val);5271 VMXReadVmcs(VMX_VMCS_HOST_SYSENTER_ESP, &val); 5272 5272 Log(("VMX_VMCS_HOST_SYSENTER_ESP %RHv\n", val)); 5273 VMXReadV MCS(VMX_VMCS_HOST_RSP, &val);5273 VMXReadVmcs(VMX_VMCS_HOST_RSP, &val); 5274 5274 Log(("VMX_VMCS_HOST_RSP %RHv\n", val)); 5275 VMXReadV MCS(VMX_VMCS_HOST_RIP, &val);5275 VMXReadVmcs(VMX_VMCS_HOST_RIP, &val); 5276 5276 Log(("VMX_VMCS_HOST_RIP %RHv\n", val)); 5277 5277 # if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) … … 5564 5564 * @param u64Val 16, 32 or 64 bits value. 5565 5565 */ 5566 VMMR0DECL(int) VMXWriteV MCS64Ex(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val)5566 VMMR0DECL(int) VMXWriteVmcs64Ex(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val) 5567 5567 { 5568 5568 int rc; … … 5587 5587 case VMX_VMCS64_CTRL_EPTP_FULL: 5588 5588 /* These fields consist of two parts, which are both writable in 32 bits mode. */ 5589 rc = VMXWriteV MCS32(idxField, u64Val);5590 rc |= VMXWriteV MCS32(idxField + 1, (uint32_t)(u64Val >> 32ULL));5589 rc = VMXWriteVmcs32(idxField, u64Val); 5590 rc |= VMXWriteVmcs32(idxField + 1, (uint32_t)(u64Val >> 32ULL)); 5591 5591 AssertRC(rc); 5592 5592 return rc; … … 5612 5612 /* Queue a 64 bits value as we can't set it in 32 bits host mode. */ 5613 5613 if (u64Val >> 32ULL) 5614 rc = VMXWriteCachedV MCSEx(pVCpu, idxField, u64Val);5614 rc = VMXWriteCachedVmcsEx(pVCpu, idxField, u64Val); 5615 5615 else 5616 rc = VMXWriteV MCS32(idxField, (uint32_t)u64Val);5616 rc = VMXWriteVmcs32(idxField, (uint32_t)u64Val); 5617 5617 5618 5618 return rc; … … 5632 5632 * @param u64Val 16, 32 or 64 bits value. 5633 5633 */ 5634 VMMR0DECL(int) VMXWriteCachedV MCSEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val)5634 VMMR0DECL(int) VMXWriteCachedVmcsEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val) 5635 5635 { 5636 5636 PVMCSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache; -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.h
r43769 r43930 94 94 #define VMX_VMCS32_RO_IDT_INFO_CACHE_IDX 55 95 95 #define VMX_VMCS32_RO_IDT_ERRCODE_CACHE_IDX 56 96 #define VMX_VMCS_MAX_CACHE_IDX (VMX_VMCS32_RO_IDT_ERRCODE_CACHE_IDX +1)96 #define VMX_VMCS_MAX_CACHE_IDX (VMX_VMCS32_RO_IDT_ERRCODE_CACHE_IDX + 1) 97 97 #define VMX_VMCS_GUEST_CR3_CACHE_IDX 57 98 98 #define VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL_CACHE_IDX 58 99 #define VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX (VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL_CACHE_IDX +1)99 #define VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX (VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL_CACHE_IDX + 1) 100 100 101 101 … … 209 209 do \ 210 210 { \ 211 rc = VMXWriteV MCS(VMX_VMCS16_GUEST_FIELD_##REG, pCtx->reg.Sel); \212 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_##REG##_LIMIT, pCtx->reg.u32Limit); \213 rc |= VMXWriteV MCS64(VMX_VMCS_GUEST_##REG##_BASE, pCtx->reg.u64Base); \211 rc = VMXWriteVmcs(VMX_VMCS16_GUEST_FIELD_##REG, pCtx->reg.Sel); \ 212 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_##REG##_LIMIT, pCtx->reg.u32Limit); \ 213 rc |= VMXWriteVmcs64(VMX_VMCS_GUEST_##REG##_BASE, pCtx->reg.u64Base); \ 214 214 if ((pCtx->eflags.u32 & X86_EFL_VM)) \ 215 215 { \ … … 241 241 val = 0x10000; /* Invalid guest state error otherwise. (BIT(16) = Unusable) */ \ 242 242 \ 243 rc |= VMXWriteV MCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, val); \243 rc |= VMXWriteVmcs(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, val); \ 244 244 } while (0) 245 245 … … 247 247 do \ 248 248 { \ 249 VMXReadCachedV MCS(VMX_VMCS16_GUEST_FIELD_##REG, &val); \249 VMXReadCachedVmcs(VMX_VMCS16_GUEST_FIELD_##REG, &val); \ 250 250 pCtx->reg.Sel = val; \ 251 251 pCtx->reg.ValidSel = val; \ 252 252 pCtx->reg.fFlags = CPUMSELREG_FLAGS_VALID; \ 253 VMXReadCachedV MCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \253 VMXReadCachedVmcs(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \ 254 254 pCtx->reg.u32Limit = val; \ 255 VMXReadCachedV MCS(VMX_VMCS_GUEST_##REG##_BASE, &val); \255 VMXReadCachedVmcs(VMX_VMCS_GUEST_##REG##_BASE, &val); \ 256 256 pCtx->reg.u64Base = val; \ 257 VMXReadCachedV MCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \257 VMXReadCachedVmcs(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \ 258 258 pCtx->reg.Attr.u = val; \ 259 259 } while (0) … … 263 263 do \ 264 264 { \ 265 VMXReadV MCS(VMX_VMCS16_GUEST_FIELD_##REG, &(val)); \265 VMXReadVmcs(VMX_VMCS16_GUEST_FIELD_##REG, &(val)); \ 266 266 Log(("%s Selector %x\n", szSelReg, (val))); \ 267 VMXReadV MCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &(val)); \267 VMXReadVmcs(VMX_VMCS32_GUEST_##REG##_LIMIT, &(val)); \ 268 268 Log(("%s Limit %x\n", szSelReg, (val))); \ 269 VMXReadV MCS(VMX_VMCS_GUEST_##REG##_BASE, &(val)); \269 VMXReadVmcs(VMX_VMCS_GUEST_##REG##_BASE, &(val)); \ 270 270 Log(("%s Base %RX64\n", szSelReg, (uint64_t)(val))); \ 271 VMXReadV MCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &(val)); \271 VMXReadVmcs(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &(val)); \ 272 272 Log(("%s Attributes %x\n", szSelReg, (val))); \ 273 273 } while (0) … … 281 281 * @param u64Val 16, 32 or 64 bits value. 282 282 */ 283 VMMR0DECL(int) VMXWriteCachedV MCSEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val);283 VMMR0DECL(int) VMXWriteCachedVmcsEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val); 284 284 285 285 #ifdef VMX_USE_CACHED_VMCS_ACCESSES … … 291 291 * @param pVal 16, 32 or 64 bits value. 292 292 */ 293 DECLINLINE(int) VMXReadCachedV MCSEx(PVMCPU pVCpu, uint32_t idxCache, RTGCUINTREG *pVal)293 DECLINLINE(int) VMXReadCachedVmcsEx(PVMCPU pVCpu, uint32_t idxCache, RTGCUINTREG *pVal) 294 294 { 295 295 Assert(idxCache <= VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX); … … 307 307 */ 308 308 #ifdef VMX_USE_CACHED_VMCS_ACCESSES 309 # define VMXReadCachedV MCS(idxField, pVal) VMXReadCachedVMCSEx(pVCpu, idxField##_CACHE_IDX, pVal)309 # define VMXReadCachedVmcs(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField##_CACHE_IDX, pVal) 310 310 #else 311 # define VMXReadCachedV MCS(idxField, pVal) VMXReadVMCS(idxField, pVal)311 # define VMXReadCachedVmcs(idxField, pVal) VMXReadVmcs(idxField, pVal) 312 312 #endif 313 313 … … 319 319 * @param idxField VMCS field index. 320 320 */ 321 #define VMXSetupCachedReadV MCS(pCache, idxField) \321 #define VMXSetupCachedReadVmcs(pCache, idxField) \ 322 322 { \ 323 323 Assert(pCache->Read.aField[idxField##_CACHE_IDX] == 0); \ … … 328 328 #define VMX_SETUP_SELREG(REG, pCache) \ 329 329 { \ 330 VMXSetupCachedReadV MCS(pCache, VMX_VMCS16_GUEST_FIELD_##REG); \331 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_##REG##_LIMIT); \332 VMXSetupCachedReadV MCS(pCache, VMX_VMCS_GUEST_##REG##_BASE); \333 VMXSetupCachedReadV MCS(pCache, VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS); \330 VMXSetupCachedReadVmcs(pCache, VMX_VMCS16_GUEST_FIELD_##REG); \ 331 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_##REG##_LIMIT); \ 332 VMXSetupCachedReadVmcs(pCache, VMX_VMCS_GUEST_##REG##_BASE); \ 333 VMXSetupCachedReadVmcs(pCache, VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS); \ 334 334 } 335 335 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r43394 r43930 1508 1508 } 1509 1509 1510 1511 /** 1512 * Checks if log flushing is disabled or not. 1513 * 1514 * @param pVCpu Pointer to the VMCPU. 1515 */ 1516 VMMR0DECL(bool) VMMR0IsLogFlushDisabled(PVMCPU pVCpu) 1517 { 1518 if (pVCpu->vmm.s.pR0LoggerR0) 1519 return pVCpu->vmm.s.pR0LoggerR0->fFlushingDisabled; 1520 return true; 1521 } 1510 1522 #endif /* LOG_ENABLED */ 1511 1523
Note:
See TracChangeset
for help on using the changeset viewer.