Changeset 78613 in vbox for trunk/src/VBox
- Timestamp:
- May 21, 2019 6:27:11 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r78612 r78613 12533 12533 if (CPUMIsGuestVmxIoInterceptSet(pVCpu, uIOPort, cbAccess)) 12534 12534 { 12535 /* 12536 * INS/OUTS (String I/O) instructions gives us additional information 12537 * when the feature is supported (by the CPU and exposed to the guest). 12538 * 12539 * Instruction length is available for IN/OUT as well as INS/OUTS. 12540 */ 12541 PVM pVM = pVCpu->CTX_SUFF(pVM); 12535 12542 rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient); 12536 12543 AssertRCReturn(rc, rc); 12537 12544 12545 bool const fVmxInsOutsInfo = pVM->cpum.ro.GuestFeatures.fVmxInsOutInfo; 12546 bool const fIOString = VMX_EXIT_QUAL_IO_IS_STRING(pVmxTransient->uExitQual); 12547 if ( fVmxInsOutsInfo 12548 && fIOString) 12549 { 12550 Assert(RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_INS_OUTS)); /* Paranoia. */ 12551 rc = hmR0VmxReadExitInstrInfoVmcs(pVmxTransient); 12552 rc |= hmR0VmxReadGuestLinearAddrVmcs(pVCpu, pVmxTransient); 12553 AssertRCReturn(rc, rc); 12554 } 12555 else 12556 { 12557 pVmxTransient->ExitInstrInfo.u = 0; 12558 pVmxTransient->uGuestLinearAddr = 0; 12559 } 12560 12538 12561 VMXVEXITINFO ExitInfo; 12539 12562 RT_ZERO(ExitInfo); 12540 ExitInfo.uReason = uExitReason; 12541 ExitInfo.cbInstr = pVmxTransient->cbInstr; 12542 ExitInfo.u64Qual = pVmxTransient->uExitQual; 12563 ExitInfo.uReason = uExitReason; 12564 ExitInfo.cbInstr = pVmxTransient->cbInstr; 12565 ExitInfo.u64Qual = pVmxTransient->uExitQual; 12566 ExitInfo.InstrInfo = pVmxTransient->ExitInstrInfo; 12567 ExitInfo.u64GuestLinearAddr = pVmxTransient->uGuestLinearAddr; 12543 12568 rcStrict = IEMExecVmxVmexitInstrWithInfo(pVCpu, &ExitInfo); 12544 12569 } … … 12570 12595 } 12571 12596 12572 /* Instructions that cause VM-exits unconditionally (and provide only the instruction length). */ 12597 /* 12598 * Instructions that cause VM-exits unconditionally. 12599 * - Provides VM-exit instruction length ONLY. 12600 */ 12573 12601 case VMX_EXIT_CPUID: 12574 12602 case VMX_EXIT_VMCALL: … … 12576 12604 case VMX_EXIT_INVD: 12577 12605 case VMX_EXIT_XSETBV: 12606 case VMX_EXIT_VMLAUNCH: 12607 case VMX_EXIT_VMRESUME: 12608 case VMX_EXIT_VMXOFF: 12578 12609 { 12579 12610 int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient); 12580 12611 AssertRCReturn(rc, rc); 12581 12612 rcStrict = IEMExecVmxVmexitInstr(pVCpu, uExitReason, pVmxTransient->cbInstr); 12613 break; 12614 } 12615 12616 /* 12617 * Instructions that cause VM-exits unconditionally. 12618 * - Provides VM-exit instruction length. 12619 * - Provides VM-exit information. 12620 * - Optionally provides VM-exit qualification. 12621 * 12622 * Since VM-exit qualification is 0 for all VM-exits where it is not 12623 * applicable, reading and passing it to the guest should produce 12624 * defined behavior. 12625 * 12626 * See Intel spec. 27.2.1 "Basic VM-Exit Information". 12627 */ 12628 case VMX_EXIT_INVEPT: 12629 case VMX_EXIT_INVVPID: 12630 case VMX_EXIT_VMCLEAR: 12631 case VMX_EXIT_VMPTRLD: 12632 case VMX_EXIT_VMPTRST: 12633 case VMX_EXIT_VMXON: 12634 { 12635 int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient); 12636 rc |= hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient); 12637 rc |= hmR0VmxReadExitInstrInfoVmcs(pVmxTransient); 12638 AssertRCReturn(rc, rc); 12639 12640 VMXVEXITINFO ExitInfo; 12641 RT_ZERO(ExitInfo); 12642 ExitInfo.uReason = uExitReason; 12643 ExitInfo.cbInstr = pVmxTransient->cbInstr; 12644 ExitInfo.u64Qual = pVmxTransient->uExitQual; 12645 ExitInfo.InstrInfo = pVmxTransient->ExitInstrInfo; 12646 rcStrict = IEMExecVmxVmexitInstrWithInfo(pVCpu, &ExitInfo); 12582 12647 break; 12583 12648 } … … 12644 12709 case VMX_EXIT_INVPCID: 12645 12710 case VMX_EXIT_RDPMC: 12646 case VMX_EXIT_VMCLEAR:12647 case VMX_EXIT_VMLAUNCH:12648 case VMX_EXIT_VMPTRLD:12649 case VMX_EXIT_VMPTRST:12650 12711 case VMX_EXIT_VMREAD: 12651 case VMX_EXIT_VMRESUME:12652 12712 case VMX_EXIT_VMWRITE: 12653 case VMX_EXIT_VMXOFF:12654 case VMX_EXIT_VMXON:12655 12713 case VMX_EXIT_TRIPLE_FAULT: 12656 12714 case VMX_EXIT_NMI_WINDOW: … … 12663 12721 case VMX_EXIT_ERR_MACHINE_CHECK: 12664 12722 12665 case VMX_EXIT_INVEPT:12666 case VMX_EXIT_INVVPID: /** @todo NSTVMX: Do this next. */12667 12723 case VMX_EXIT_VMFUNC: 12668 12724 case VMX_EXIT_XSAVES:
Note:
See TracChangeset
for help on using the changeset viewer.