Changeset 104511 in vbox
- Timestamp:
- May 3, 2024 3:03:42 PM (7 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/gcm.h
r104509 r104511 59 59 #endif /* IN_RING3 */ 60 60 61 VMM_INT_DECL(bool) GCM ShouldTrapXcptDE(PVMCPUCC pVCpu);62 VMM_INT_DECL( VBOXSTRICTRC) GCMXcptDE(PVMCPUCC pVCpu, PCPUMCTX pCtx, PDISSTATE pDis, uint8_t *pcbInstr);61 VMM_INT_DECL(bool) GCMIsInterceptingXcptDE(PVMCPUCC pVCpu); 62 VMM_INT_DECL(int) GCMXcptDE(PVMCPUCC pVCpu, PCPUMCTX pCtx); 63 63 /** @} */ 64 64 -
trunk/src/VBox/VMM/VMMAll/GCMAll.cpp
r104509 r104511 47 47 * @param pVCpu The cross context virtual CPU structure. 48 48 */ 49 VMM_INT_DECL(bool) GCM ShouldTrapXcptDE(PVMCPUCC pVCpu)49 VMM_INT_DECL(bool) GCMIsInterceptingXcptDE(PVMCPUCC pVCpu) 50 50 { 51 LogFunc(("GCM checking if #DE needs trapping\n"));52 PVM pVM = pVCpu->CTX_SUFF(pVM);53 54 51 /* See if the enabled fixers need to intercept #DE. */ 55 if ( pVM->gcm.s.fFixerSet 56 & (GCMFIXER_DBZ_DOS | GCMFIXER_DBZ_OS2 | GCMFIXER_DBZ_WIN9X)) 57 { 58 LogRel(("GCM: #DE should be trapped\n")); 59 return true; 60 } 61 62 return false; 52 PVM const pVM = pVCpu->CTX_SUFF(pVM); 53 bool const fRet = (pVM->gcm.s.fFixerSet & (GCMFIXER_DBZ_DOS | GCMFIXER_DBZ_OS2 | GCMFIXER_DBZ_WIN9X)) != 0; 54 LogFlow(("GCMIsInterceptingXcptDE: returns %d\n", fRet)); 55 return fRet; 63 56 } 64 57 … … 67 60 * Exception handler for \#DE when registered by GCM. 68 61 * 69 * @returns StrictVBox status code.62 * @returns VBox status code. 70 63 * @retval VINF_SUCCESS retry division and continue. 71 64 * @retval VERR_NOT_FOUND deliver exception to guest. … … 73 66 * @param pVCpu The cross context virtual CPU structure. 74 67 * @param pCtx Pointer to the guest-CPU context. 75 * @param pDis Pointer to the disassembled instruction state at RIP.76 * If NULL is passed, it implies the disassembly of the77 * the instruction at RIP is the78 * responsibility of GCM.79 * @param pcbInstr Where to store the instruction length of80 * the divide instruction. Optional, can be81 * NULL.82 68 * 83 69 * @thread EMT(pVCpu). 84 70 */ 85 VMM_INT_DECL( VBOXSTRICTRC) GCMXcptDE(PVMCPUCC pVCpu, PCPUMCTX pCtx, PDISSTATE pDis, uint8_t *pcbInstr)71 VMM_INT_DECL(int) GCMXcptDE(PVMCPUCC pVCpu, PCPUMCTX pCtx) 86 72 { 87 73 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 88 74 Assert(pVM->gcm.s.fFixerSet & (GCMFIXER_DBZ_DOS | GCMFIXER_DBZ_OS2 | GCMFIXER_DBZ_WIN9X)); 89 Assert(pDis || pcbInstr);90 RT_NOREF(pDis);91 RT_NOREF(pcbInstr);92 75 93 76 LogRel(("GCM: Intercepted #DE at CS:RIP=%04x:%RX64 (%RX64 linear) RDX:RAX=%RX64:%RX64 RCX=%RX64 RBX=%RX64\n", … … 214 197 return VERR_NOT_FOUND; 215 198 } 199 -
trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h
r104259 r104511 7551 7551 if (VCPU_2_VMXSTATE(pVCpu).fGCMTrapXcptDE) 7552 7552 { 7553 uint8_t cbInstr = 0; 7554 VBOXSTRICTRC rc2 = GCMXcptDE(pVCpu, &pVCpu->cpum.GstCtx, NULL /* pDis */, &cbInstr); 7555 if (rc2 == VINF_SUCCESS) 7556 rcStrict = VINF_SUCCESS; /* Restart instruction with modified guest register context. */ 7557 else if (rc2 == VERR_NOT_FOUND) 7558 rcStrict = VERR_NOT_FOUND; /* Deliver the exception. */ 7559 else 7560 Assert(RT_FAILURE(VBOXSTRICTRC_VAL(rcStrict))); 7561 } 7553 rcStrict = GCMXcptDE(pVCpu, &pVCpu->cpum.GstCtx); 7554 Assert(rcStrict == VINF_SUCCESS /* restart instr */ || rcStrict == VERR_NOT_FOUND /* deliver exception */); 7555 } 7556 /** @todo r=bird: This cannot be right! It'll suppress \#DE */ 7562 7557 else 7563 7558 rcStrict = VINF_SUCCESS; /* Do nothing. */ … … 7571 7566 } 7572 7567 7568 /** @todo r=bird: This assertion is wrong. rcStrict can never be 7569 * VERR_VMX_UNEXPECTED_INTERRUPTION_EXIT_TYPE here, it can only be 7570 * VINF_SUCCESS. */ 7573 7571 Assert(rcStrict == VINF_SUCCESS || rcStrict == VERR_VMX_UNEXPECTED_INTERRUPTION_EXIT_TYPE); 7574 7572 return VBOXSTRICTRC_VAL(rcStrict); -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r103194 r104511 8359 8359 { 8360 8360 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, HMSVM_CPUMCTX_EXTRN_ALL); 8361 uint8_t cbInstr = 0; 8362 VBOXSTRICTRC rcStrict = GCMXcptDE(pVCpu, &pVCpu->cpum.GstCtx, NULL /* pDis */, &cbInstr); 8363 if (rcStrict == VINF_SUCCESS) 8364 rc = VINF_SUCCESS; /* Restart instruction with modified guest register context. */ 8365 else if (rcStrict == VERR_NOT_FOUND) 8366 rc = VERR_NOT_FOUND; /* Deliver the exception. */ 8367 else 8368 Assert(RT_FAILURE(VBOXSTRICTRC_VAL(rcStrict))); 8361 rc = GCMXcptDE(pVCpu, &pVCpu->cpum.GstCtx); 8362 AssertMsg(rc == VINF_SUCCESS /* restart */ || rc == VERR_NOT_FOUND /* deliver exception */, ("rc=%Rrc\n", rc)); 8369 8363 } 8370 8364 -
trunk/src/VBox/VMM/VMMR3/GCM.cpp
r104508 r104511 154 154 155 155 #if 0 /* development override */ 156 pVM->gcm.s. enmFixerIds= GCMFIXER_DBZ_OS2 | GCMFIXER_DBZ_DOS | GCMFIXER_DBZ_WIN9X;156 pVM->gcm.s.fFixerSet = GCMFIXER_DBZ_OS2 | GCMFIXER_DBZ_DOS | GCMFIXER_DBZ_WIN9X; 157 157 #endif 158 158 -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r103270 r104511 754 754 PVMCPU pVCpu = pVM->apCpusR3[idCpu]; 755 755 pVCpu->hm.s.fActive = false; 756 pVCpu->hm.s.fGIMTrapXcptUD = GIMShouldTrapXcptUD(pVCpu); /* Is safe to call now since GIMR3Init() has completed. */757 pVCpu->hm.s.fGCMTrapXcptDE = GCM ShouldTrapXcptDE(pVCpu);/* Is safe to call now since GCMR3Init() has completed. */756 pVCpu->hm.s.fGIMTrapXcptUD = GIMShouldTrapXcptUD(pVCpu); /* Is safe to call now since GIMR3Init() has completed. */ 757 pVCpu->hm.s.fGCMTrapXcptDE = GCMIsInterceptingXcptDE(pVCpu); /* Is safe to call now since GCMR3Init() has completed. */ 758 758 } 759 759
Note:
See TracChangeset
for help on using the changeset viewer.