Changeset 73752 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 18, 2018 4:04:56 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r73745 r73752 82 82 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmptrld_Success , "Success" ), 83 83 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmptrld_VmcsRevId , "VmcsRevId" ) 84 /* VMPTRST. */ 85 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmptrst_Cpl , "Cpl" ), 86 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmptrst_PtrMap , "PtrMap" ) 84 87 /* kVmxVInstrDiag_Last */ 85 88 }; -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r73745 r73752 15531 15531 15532 15532 /** 15533 * Interface for HM and EM to emulate the VM XOFFinstruction.15533 * Interface for HM and EM to emulate the VMPTRLD instruction. 15534 15534 * 15535 15535 * @returns Strict VBox status code. 15536 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15537 * @param cbInstr The instruction length in bytes. 15536 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15537 * @param cbInstr The instruction length in bytes. 15538 * @param GCPtrVmxon The linear address of the VMCS pointer. 15539 * @param uExitInstrInfo The VM-exit instruction information field. 15540 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any. 15538 15541 * @thread EMT(pVCpu) 15539 15542 */ 15540 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmxoff(PVMCPU pVCpu, uint8_t cbInstr) 15543 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrld(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, uint32_t uExitInstrInfo, 15544 RTGCPTR GCPtrDisp) 15541 15545 { 15542 15546 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15547 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15543 15548 15544 15549 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15545 VBOXSTRICTRC rcStrict = IEM_CIMPL_CALL_0(iemCImpl_vmxoff); 15546 Assert(!pVCpu->iem.s.cActiveMappings); 15547 return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict); 15550 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15551 VBOXSTRICTRC rcStrict = iemVmxVmptrld(pVCpu, cbInstr, GCPtrVmcs, pExitInstrInfo, GCPtrDisp); 15552 if (pVCpu->iem.s.cActiveMappings) 15553 iemMemRollback(pVCpu); 15554 return iemExecStatusCodeFiddling(pVCpu, rcStrict); 15555 } 15556 15557 15558 /** 15559 * Interface for HM and EM to emulate the VMPTRST instruction. 15560 * 15561 * @returns Strict VBox status code. 15562 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15563 * @param cbInstr The instruction length in bytes. 15564 * @param GCPtrVmxon The linear address of where to store the VMCS pointer. 15565 * @param uExitInstrInfo The VM-exit instruction information field. 15566 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any. 15567 * @thread EMT(pVCpu) 15568 */ 15569 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrst(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, uint32_t uExitInstrInfo, 15570 RTGCPTR GCPtrDisp) 15571 { 15572 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15573 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15574 15575 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15576 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15577 VBOXSTRICTRC rcStrict = iemVmxVmptrst(pVCpu, cbInstr, GCPtrVmcs, pExitInstrInfo, GCPtrDisp); 15578 if (pVCpu->iem.s.cActiveMappings) 15579 iemMemRollback(pVCpu); 15580 return iemExecStatusCodeFiddling(pVCpu, rcStrict); 15548 15581 } 15549 15582 … … 15572 15605 iemMemRollback(pVCpu); 15573 15606 return iemExecStatusCodeFiddling(pVCpu, rcStrict); 15607 } 15608 15609 15610 /** 15611 * Interface for HM and EM to emulate the VMXOFF instruction. 15612 * 15613 * @returns Strict VBox status code. 15614 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15615 * @param cbInstr The instruction length in bytes. 15616 * @thread EMT(pVCpu) 15617 */ 15618 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmxoff(PVMCPU pVCpu, uint8_t cbInstr) 15619 { 15620 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15621 15622 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15623 VBOXSTRICTRC rcStrict = IEM_CIMPL_CALL_0(iemCImpl_vmxoff); 15624 Assert(!pVCpu->iem.s.cActiveMappings); 15625 return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict); 15574 15626 } 15575 15627 -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r73745 r73752 481 481 482 482 /** 483 * VMPTRST instruction execution worker. 484 * 485 * @param pVCpu The cross context virtual CPU structure. 486 * @param cbInstr The instruction length. 487 * @param GCPtrVmcs The linear address of where to store the current VMCS 488 * pointer. 489 * @param pExitInstrInfo Pointer to the VM-exit instruction information field. 490 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any. 491 * 492 * @remarks Common VMX instruction checks are already expected to by the caller, 493 * i.e. VMX operation, CR4.VMXE, Real/V86 mode, EFER/CS.L checks. 494 */ 495 IEM_STATIC VBOXSTRICTRC iemVmxVmptrst(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, PCVMXEXITINSTRINFO pExitInstrInfo, 496 RTGCPTR GCPtrDisp) 497 { 498 if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 499 { 500 RT_NOREF(GCPtrDisp); 501 /** @todo NSTVMX: intercept. */ 502 } 503 Assert(IEM_IS_VMX_ROOT_MODE(pVCpu)); 504 505 /* CPL. */ 506 if (CPUMGetGuestCPL(pVCpu) > 0) 507 { 508 Log(("vmptrst: CPL %u -> #GP(0)\n", pVCpu->iem.s.uCpl)); 509 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmptrst_Cpl; 510 return iemRaiseGeneralProtectionFault0(pVCpu); 511 } 512 513 /* Set the VMCS pointer to the location specified by the destination memory operand. */ 514 Assert(NIL_RTGCPHYS == ~(RTGCPHYS)0U); 515 VBOXSTRICTRC rcStrict = iemMemStoreDataU64(pVCpu, pExitInstrInfo->VmxXsave.iSegReg, GCPtrVmcs, 516 pVCpu->cpum.GstCtx.hwvirt.vmx.GCPhysVmcs); 517 if (RT_LIKELY(rcStrict == VINF_SUCCESS)) 518 { 519 iemVmxVmSucceed(pVCpu); 520 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 521 return rcStrict; 522 } 523 524 Log(("vmptrld: Failed to store VMCS pointer to memory at destination operand %#Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); 525 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmptrst_PtrMap; 526 return rcStrict; 527 } 528 529 530 /** 483 531 * VMPTRLD instruction execution worker. 484 532 * -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r73745 r73752 8461 8461 8462 8462 /** Opcode [0xf3] 0x0f 0xc7 !11/7. */ 8463 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 8464 FNIEMOP_DEF_1(iemOp_Grp9_vmptrst_Mq, uint8_t, bRm) 8465 { 8466 IEMOP_MNEMONIC(vmptrst, "vmptrst"); 8467 IEMOP_HLP_IN_VMX_OPERATION(); 8468 IEMOP_HLP_VMX_INSTR(); 8469 IEM_MC_BEGIN(1, 0); 8470 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 0); 8471 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 8472 IEMOP_HLP_DONE_DECODING_NO_LOCK_REPZ_OR_REPNZ_PREFIXES(); 8473 IEM_MC_CALL_CIMPL_1(iemCImpl_vmptrld, GCPtrEffDst); 8474 IEM_MC_END(); 8475 return VINF_SUCCESS; 8476 } 8477 #else 8463 8478 FNIEMOP_UD_STUB_1(iemOp_Grp9_vmptrst_Mq, uint8_t, bRm); 8479 #endif 8464 8480 8465 8481 /** Opcode 0x0f 0xc7 11/7. */
Note:
See TracChangeset
for help on using the changeset viewer.