Changeset 80386 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 22, 2019 2:39:03 PM (5 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r80350 r80386 15874 15874 15875 15875 /** 15876 * Interface for HM and EM to emulate a trap-like VM-exit (MTF, APIC-write, 15877 * Virtualized-EOI, TPR-below threshold). 15878 * 15879 * @returns Strict VBox status code. 15880 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15881 * @param pExitInfo Pointer to the VM-exit information. 15882 * @thread EMT(pVCpu) 15883 */ 15884 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitTrapLike(PVMCPUCC pVCpu, PCVMXVEXITINFO pExitInfo) 15885 { 15886 Assert(pExitInfo); 15887 VBOXSTRICTRC rcStrict = iemVmxVmexitTrapLikeWithInfo(pVCpu, pExitInfo); 15888 Assert(!pVCpu->iem.s.cActiveMappings); 15889 return iemExecStatusCodeFiddling(pVCpu, rcStrict); 15890 } 15891 15892 15893 /** 15876 15894 * Interface for HM and EM to emulate a VM-exit due to a task switch. 15877 15895 * -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r80364 r80386 782 782 783 783 /** 784 * Sets the guest pending-debug exceptions field. 785 * 786 * @param pVCpu The cross context virtual CPU structure. 787 * @param uGuestPendingDbgXcpts The guest pending-debug exceptions. 788 */ 789 DECL_FORCE_INLINE(void) iemVmxVmcsSetGuestPendingDbgXcpts(PVMCPUCC pVCpu, uint64_t uGuestPendingDbgXcpts) 790 { 791 PVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); 792 Assert(!(uGuestPendingDbgXcpts & VMX_VMCS_GUEST_PENDING_DEBUG_VALID_MASK)); 793 pVmcs->u64GuestPendingDbgXcpt.u = uGuestPendingDbgXcpts; 794 } 795 796 797 /** 784 798 * Implements VMSucceed for VMX instruction success. 785 799 * … … 1484 1498 /* 1485 1499 * Pending debug exceptions. 1500 * 1501 * For VM-exits where it is not applicable, we can safely zero out the field. 1502 * For VM-exits where it is applicable, it's expected to be updated by the caller already. 1486 1503 */ 1487 1504 if ( uExitReason != VMX_EXIT_INIT_SIGNAL … … 1493 1510 * block-by-MovSS is in effect. */ 1494 1511 pVmcs->u64GuestPendingDbgXcpt.u = 0; 1495 }1496 else1497 {1498 /*1499 * Pending debug exception field is identical to DR6 except the RTM bit (16) which needs to be flipped.1500 * The "enabled breakpoint" bit (12) is not present in DR6, so we need to update it here.1501 *1502 * See Intel spec. 24.4.2 "Guest Non-Register State".1503 */1504 /** @todo r=ramshankar: NSTVMX: I'm not quite sure if we can simply derive this from1505 * DR6. */1506 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_DR6);1507 uint64_t fPendingDbgMask = pVCpu->cpum.GstCtx.dr[6];1508 uint64_t const fBpHitMask = VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP0 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP11509 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP2 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP3;1510 if (fPendingDbgMask & fBpHitMask)1511 fPendingDbgMask |= VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_EN_BP;1512 fPendingDbgMask ^= VMX_VMCS_GUEST_PENDING_DEBUG_RTM;1513 pVmcs->u64GuestPendingDbgXcpt.u = fPendingDbgMask;1514 1512 } 1515 1513 … … 3412 3410 iemVmxVmcsSetExitInstrLen(pVCpu, cbInstr); 3413 3411 return iemVmxVmexit(pVCpu, VMX_EXIT_TASK_SWITCH, u64ExitQual); 3412 } 3413 3414 3415 /** 3416 * VMX VM-exit handler for trap-like VM-exits. 3417 * 3418 * @returns VBox strict status code. 3419 * @param pVCpu The cross context virtual CPU structure. 3420 * @param pExitInfo Pointer to the VM-exit information. 3421 * @param pExitEventInfo Pointer to the VM-exit event information. 3422 */ 3423 IEM_STATIC VBOXSTRICTRC iemVmxVmexitTrapLikeWithInfo(PVMCPUCC pVCpu, PCVMXVEXITINFO pExitInfo) 3424 { 3425 Assert(VMXIsVmexitTrapLike(pExitInfo->uReason)); 3426 iemVmxVmcsSetGuestPendingDbgXcpts(pVCpu, pExitInfo->u64GuestPendingDbgXcpts); 3427 return iemVmxVmexit(pVCpu, pExitInfo->uReason, pExitInfo->u64Qual); 3414 3428 } 3415 3429
Note:
See TracChangeset
for help on using the changeset viewer.