Changeset 2124 in vbox
- Timestamp:
- Apr 17, 2007 12:25:17 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 20445
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r2063 r2124 1532 1532 */ 1533 1533 uint8_t u8TrapNo; 1534 bool fSoftwareInterrupt;1534 TRPMEVENT enmType;; 1535 1535 RTGCUINT uErrorCode; 1536 1536 RTGCUINTPTR uCR2; 1537 int rc = TRPMQueryTrapAll(pVM, &u8TrapNo, & fSoftwareInterrupt, &uErrorCode, &uCR2);1537 int rc = TRPMQueryTrapAll(pVM, &u8TrapNo, &enmType, &uErrorCode, &uCR2); 1538 1538 if (VBOX_FAILURE(rc)) 1539 1539 { … … 1614 1614 int rc2 = PGMGstGetPage(pVM, uCR2, &fFlags, &GCPhys); 1615 1615 Log(("emR3RawGuestTrap: cs:eip=%04x:%08x: trap=%02x err=%08x cr2=%08x cr0=%08x%s: Phys=%VGp fFlags=%08llx %s %s %s%s rc2=%d\n", 1616 pCtx->cs, pCtx->eip, u8TrapNo, uErrorCode, uCR2, pCtx->cr0, fSoftwareInterrupt? " software" : "", GCPhys, fFlags,1616 pCtx->cs, pCtx->eip, u8TrapNo, uErrorCode, uCR2, pCtx->cr0, (enmType == TRPM_SOFTWARE_INT) ? " software" : "", GCPhys, fFlags, 1617 1617 fFlags & X86_PTE_P ? "P " : "NP", fFlags & X86_PTE_US ? "U" : "S", 1618 1618 fFlags & X86_PTE_RW ? "RW" : "R0", fFlags & X86_PTE_G ? " G" : "", rc2)); … … 1700 1700 uint8_t u8TrapNo; 1701 1701 int rc; 1702 bool fSoftwareInterrupt;1702 TRPMEVENT enmType; 1703 1703 RTGCUINT uErrorCode; 1704 1704 RTGCUINTPTR uCR2; … … 1722 1722 else 1723 1723 { 1724 rc = TRPMQueryTrapAll(pVM, &u8TrapNo, & fSoftwareInterrupt, &uErrorCode, &uCR2);1724 rc = TRPMQueryTrapAll(pVM, &u8TrapNo, &enmType, &uErrorCode, &uCR2); 1725 1725 if (VBOX_FAILURE(rc)) 1726 1726 { -
trunk/src/VBox/VMM/HWACCM.cpp
r1890 r2124 453 453 Assert(pVM->fHWACCMEnabled); 454 454 455 #if 0 456 /* AMD SVM supports real & protected mode with or without paging. */ 457 if (pVM->hwaccm.s.svm.fEnabled) 458 { 459 pVM->hwaccm.s.fActive = true; 460 return true; 461 } 462 #endif 463 455 464 /* @todo we can support real-mode by using v86 and protected mode without paging with identity mapped pages. 456 465 * (but do we really care?) -
trunk/src/VBox/VMM/TRPM.cpp
r1998 r2124 411 411 412 412 /** TRPM saved state version. */ 413 #define TRPM_SAVED_STATE_VERSION 7413 #define TRPM_SAVED_STATE_VERSION 8 414 414 415 415 … … 713 713 PTRPM pTrpm = &pVM->trpm.s; 714 714 SSMR3PutUInt(pSSM, pTrpm->uActiveVector); 715 SSMR3PutUInt(pSSM, pTrpm-> fActiveSoftwareInterrupt);715 SSMR3PutUInt(pSSM, pTrpm->enmActiveType); 716 716 SSMR3PutGCUInt(pSSM, pTrpm->uActiveErrorCode); 717 717 SSMR3PutGCUIntPtr(pSSM, pTrpm->uActiveCR2); 718 718 SSMR3PutGCUInt(pSSM, pTrpm->uSavedVector); 719 SSMR3PutUInt(pSSM, pTrpm-> fSavedSoftwareInterrupt);719 SSMR3PutUInt(pSSM, pTrpm->enmSavedType); 720 720 SSMR3PutGCUInt(pSSM, pTrpm->uSavedErrorCode); 721 721 SSMR3PutGCUIntPtr(pSSM, pTrpm->uSavedCR2); … … 774 774 PTRPM pTrpm = &pVM->trpm.s; 775 775 SSMR3GetUInt(pSSM, &pTrpm->uActiveVector); 776 SSMR3GetUInt(pSSM, &pTrpm->fActiveSoftwareInterrupt);776 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpm->enmActiveType); 777 777 SSMR3GetGCUInt(pSSM, &pTrpm->uActiveErrorCode); 778 778 SSMR3GetGCUIntPtr(pSSM, &pTrpm->uActiveCR2); 779 779 SSMR3GetGCUInt(pSSM, &pTrpm->uSavedVector); 780 SSMR3GetUInt(pSSM, &pTrpm->fSavedSoftwareInterrupt);780 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpm->enmSavedType); 781 781 SSMR3GetGCUInt(pSSM, &pTrpm->uSavedErrorCode); 782 782 SSMR3GetGCUIntPtr(pSSM, &pTrpm->uSavedCR2); … … 1319 1319 if (HWACCMR3IsActive(pVM)) 1320 1320 { 1321 rc = TRPMAssertTrap(pVM, u8Interrupt, false);1321 rc = TRPMAssertTrap(pVM, u8Interrupt, enmEvent); 1322 1322 AssertRC(rc); 1323 1323 STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]); -
trunk/src/VBox/VMM/TRPMInternal.h
r1328 r2124 97 97 RTUINT uActiveVector; 98 98 99 /** If set the active trap is a software interrupt. */100 RTUINT fActiveSoftwareInterrupt;99 /** Active trap type. */ 100 TRPMEVENT enmActiveType; 101 101 102 102 /** Errorcode for the active interrupt/trap. */ … … 109 109 RTGCUINT uSavedVector; 110 110 111 /** Saved software interrupt indicator. */112 RTUINT fSavedSoftwareInterrupt;111 /** Saved trap type. */ 112 TRPMEVENT enmSavedType; 113 113 114 114 /** Saved errorcode. */ -
trunk/src/VBox/VMM/TRPMInternal.mac
r1580 r2124 35 35 .offVM resd 1 36 36 .uActiveVector resd 1 37 . fActiveSoftwareInterruptresd 137 .enmActiveType resd 1 38 38 .uActiveErrorCode resd 1 39 39 .uActiveCR2 resd 1 40 40 .uSavedVector resd 1 41 . fSavedSoftwareInterruptresd 141 .enmSavedType resd 1 42 42 .uSavedErrorCode resd 1 43 43 .uSavedCR2 resd 1 -
trunk/src/VBox/VMM/VMM.cpp
r1890 r2124 2371 2371 /* Trap? */ 2372 2372 uint32_t uEIP = CPUMGetHyperEIP(pVM); 2373 bool fSoftwareInterrupt = false;2373 TRPMEVENT enmType; 2374 2374 uint8_t u8TrapNo = 0xce; 2375 2375 RTGCUINT uErrorCode = 0xdeadface; 2376 2376 RTGCUINTPTR uCR2 = 0xdeadface; 2377 int rc2 = TRPMQueryTrapAll(pVM, &u8TrapNo, & fSoftwareInterrupt, &uErrorCode, &uCR2);2377 int rc2 = TRPMQueryTrapAll(pVM, &u8TrapNo, &enmType, &uErrorCode, &uCR2); 2378 2378 if (VBOX_SUCCESS(rc2)) 2379 2379 pHlp->pfnPrintf(pHlp, 2380 "!! TRAP=%02x ERRCD=%VGv CR2=%VGv EIP=%VGv fSoft=%d\n",2381 u8TrapNo, uErrorCode, uCR2, uEIP, fSoftwareInterrupt);2380 "!! TRAP=%02x ERRCD=%VGv CR2=%VGv EIP=%VGv Type=%d\n", 2381 u8TrapNo, uErrorCode, uCR2, uEIP, enmType); 2382 2382 else 2383 2383 pHlp->pfnPrintf(pHlp, -
trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp
r2117 r2124 50 50 * @param pVM The virtual machine. 51 51 * @param pu8TrapNo Where to store the trap number. 52 * @param p fSoftwareInterrupt Where to store the software interrupt indicator.53 */ 54 TRPMDECL(int) TRPMQueryTrap(PVM pVM, uint8_t *pu8TrapNo, bool *pfSoftwareInterrupt)52 * @param pEnmType Where to store the trap type 53 */ 54 TRPMDECL(int) TRPMQueryTrap(PVM pVM, uint8_t *pu8TrapNo, TRPMEVENT *pEnmType) 55 55 { 56 56 /* … … 61 61 if (pu8TrapNo) 62 62 *pu8TrapNo = (uint8_t)pVM->trpm.s.uActiveVector; 63 if (p fSoftwareInterrupt)64 *p fSoftwareInterrupt = !!pVM->trpm.s.fActiveSoftwareInterrupt;63 if (pEnmType) 64 *pEnmType = pVM->trpm.s.enmActiveType; 65 65 return VINF_SUCCESS; 66 66 } … … 172 172 * @param pVM The virtual machine. 173 173 * @param u8TrapNo The trap vector to assert. 174 * @param fSoftwareInterrupt Indicate if it's a software interrupt or not.175 */ 176 TRPMDECL(int) TRPMAssertTrap(PVM pVM, uint8_t u8TrapNo, bool fSoftwareInterrupt)177 { 178 Log2(("TRPMAssertTrap: u8TrapNo=%02x fSoftwareInterrupt=%d\n", u8TrapNo, fSoftwareInterrupt));174 * @param enmType Trap type. 175 */ 176 TRPMDECL(int) TRPMAssertTrap(PVM pVM, uint8_t u8TrapNo, TRPMEVENT enmType) 177 { 178 Log2(("TRPMAssertTrap: u8TrapNo=%02x type=%d\n", u8TrapNo, enmType)); 179 179 180 180 /* … … 188 188 189 189 pVM->trpm.s.uActiveVector = u8TrapNo; 190 pVM->trpm.s. fActiveSoftwareInterrupt = fSoftwareInterrupt;190 pVM->trpm.s.enmActiveType = enmType; 191 191 pVM->trpm.s.uActiveErrorCode = ~0; 192 192 pVM->trpm.s.uActiveCR2 = 0xdeadface; … … 260 260 { 261 261 AssertMsg(pVM->trpm.s.uActiveVector != ~0U, ("No active trap!\n")); 262 return !!pVM->trpm.s.fActiveSoftwareInterrupt;262 return (pVM->trpm.s.enmActiveType == TRPM_SOFTWARE_INT); 263 263 } 264 264 … … 283 283 * @param pVM The virtual machine. 284 284 * @param pu8TrapNo Where to store the trap number. 285 * @param p fSoftwareInterrupt Where to store the software interrupt indicator.285 * @param pEnmType Where to store the trap type 286 286 * @param puErrorCode Where to store the error code associated with some traps. 287 287 * ~0U is stored if the trap has no error code. 288 288 * @param puCR2 Where to store the CR2 associated with a trap 0E. 289 289 */ 290 TRPMDECL(int) TRPMQueryTrapAll(PVM pVM, uint8_t *pu8TrapNo, bool *pfSoftwareInterrupt, PRTGCUINT puErrorCode, PRTGCUINTPTR puCR2)290 TRPMDECL(int) TRPMQueryTrapAll(PVM pVM, uint8_t *pu8TrapNo, TRPMEVENT *pEnmType, PRTGCUINT puErrorCode, PRTGCUINTPTR puCR2) 291 291 { 292 292 /* … … 297 297 298 298 if (pu8TrapNo) 299 *pu8TrapNo 300 if (p fSoftwareInterrupt)301 *p fSoftwareInterrupt = !!pVM->trpm.s.fActiveSoftwareInterrupt;299 *pu8TrapNo = (uint8_t)pVM->trpm.s.uActiveVector; 300 if (pEnmType) 301 *pEnmType = pVM->trpm.s.enmActiveType; 302 302 if (puErrorCode) 303 *puErrorCode 303 *puErrorCode = pVM->trpm.s.uActiveErrorCode; 304 304 if (puCR2) 305 *puCR2 305 *puCR2 = pVM->trpm.s.uActiveCR2; 306 306 307 307 return VINF_SUCCESS; … … 320 320 TRPMDECL(void) TRPMSaveTrap(PVM pVM) 321 321 { 322 pVM->trpm.s.uSavedVector 323 pVM->trpm.s. fSavedSoftwareInterrupt = pVM->trpm.s.fActiveSoftwareInterrupt;324 pVM->trpm.s.uSavedErrorCode 325 pVM->trpm.s.uSavedCR2 322 pVM->trpm.s.uSavedVector = pVM->trpm.s.uActiveVector; 323 pVM->trpm.s.enmSavedType = pVM->trpm.s.enmActiveType; 324 pVM->trpm.s.uSavedErrorCode = pVM->trpm.s.uActiveErrorCode; 325 pVM->trpm.s.uSavedCR2 = pVM->trpm.s.uActiveCR2; 326 326 } 327 327 … … 336 336 TRPMDECL(void) TRPMRestoreTrap(PVM pVM) 337 337 { 338 pVM->trpm.s.uActiveVector 339 pVM->trpm.s. fActiveSoftwareInterrupt = pVM->trpm.s.fSavedSoftwareInterrupt;340 pVM->trpm.s.uActiveErrorCode 341 pVM->trpm.s.uActiveCR2 338 pVM->trpm.s.uActiveVector = pVM->trpm.s.uSavedVector; 339 pVM->trpm.s.enmActiveType = pVM->trpm.s.enmSavedType; 340 pVM->trpm.s.uActiveErrorCode = pVM->trpm.s.uSavedErrorCode; 341 pVM->trpm.s.uActiveCR2 = pVM->trpm.s.uSavedCR2; 342 342 } 343 343 … … 761 761 /** @todo dispatch the trap. */ 762 762 pVM->trpm.s.uActiveVector = enmXcpt; 763 pVM->trpm.s. fActiveSoftwareInterrupt = false;763 pVM->trpm.s.enmActiveType = TRPM_TRAP; 764 764 pVM->trpm.s.uActiveErrorCode = 0xdeadbeef; 765 765 pVM->trpm.s.uActiveCR2 = 0xdeadface; … … 788 788 /** @todo dispatch the trap. */ 789 789 pVM->trpm.s.uActiveVector = enmXcpt; 790 pVM->trpm.s. fActiveSoftwareInterrupt = false;790 pVM->trpm.s.enmActiveType = TRPM_TRAP; 791 791 pVM->trpm.s.uActiveErrorCode = uErr; 792 792 pVM->trpm.s.uActiveCR2 = 0xdeadface; … … 816 816 /** @todo dispatch the trap. */ 817 817 pVM->trpm.s.uActiveVector = enmXcpt; 818 pVM->trpm.s. fActiveSoftwareInterrupt = false;818 pVM->trpm.s.enmActiveType = TRPM_TRAP; 819 819 pVM->trpm.s.uActiveErrorCode = uErr; 820 820 pVM->trpm.s.uActiveCR2 = uCR2; -
trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp
r2066 r2124 202 202 203 203 /* Assert the trap and go to the recompiler to dispatch it. */ 204 TRPMAssertTrap(pVM, u8Interrupt, false);204 TRPMAssertTrap(pVM, u8Interrupt, TRPM_HARDWARE_INT); 205 205 206 206 STAM_PROFILE_ADV_START(&pVM->trpm.s.aStatGCTraps[uOldActiveVector], a); … … 558 558 559 559 pVM->trpm.s.uActiveVector = (pVM->trpm.s.uActiveErrorCode & X86_TRAP_ERR_SEL_MASK) >> X86_TRAP_ERR_SEL_SHIFT; 560 pVM->trpm.s. fActiveSoftwareInterrupt = true;560 pVM->trpm.s.enmActiveType = TRPM_SOFTWARE_INT; 561 561 return trpmGCExitTrap(pVM, VINF_EM_RAW_RING_SWITCH_INT, pRegFrame); 562 562 } … … 664 664 665 665 pVM->trpm.s.uActiveVector = (pVM->trpm.s.uActiveErrorCode & X86_TRAP_ERR_SEL_MASK) >> X86_TRAP_ERR_SEL_SHIFT; 666 pVM->trpm.s. fActiveSoftwareInterrupt = true;666 pVM->trpm.s.enmActiveType = TRPM_SOFTWARE_INT; 667 667 return trpmGCExitTrap(pVM, VINF_EM_RAW_RING_SWITCH_INT, pRegFrame); 668 668 } -
trunk/src/VBox/VMM/VMMGC/TRPMGCHandlersA.asm
r1645 r2124 28 28 %include "TRPMInternal.mac" 29 29 %include "VBox/err.mac" 30 %include "VBox/trpm.mac" 30 31 31 32 … … 334 335 mov edx, [esp + 4h + ESPOFF] ; error code 335 336 mov [eax + TRPM.uActiveErrorCode], edx 336 mov dword [eax + TRPM. fActiveSoftwareInterrupt], 0337 mov dword [eax + TRPM.enmActiveType], TRPM_TRAP 337 338 mov edx, cr2 ;; @todo Check how expensive cr2 reads are! 338 339 mov dword [eax + TRPM.uActiveCR2], edx … … 804 805 mov [eax + TRPM.uActiveVector], edx 805 806 xor edx, edx 806 mov [eax + TRPM.fActiveSoftwareInterrupt], edx807 mov dword [eax + TRPM.enmActiveType], TRPM_HARDWARE_INT 807 808 dec edx 808 809 mov [eax + TRPM.uActiveErrorCode], edx -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r2097 r2124 212 212 if (VBOX_SUCCESS(rc)) 213 213 { 214 rc = TRPMAssertTrap(pVM, u8Interrupt, false);214 rc = TRPMAssertTrap(pVM, u8Interrupt, TRPM_HARDWARE_INT); 215 215 AssertRC(rc); 216 216 } … … 233 233 rc = TRPMQueryTrapAll(pVM, &u8Vector, 0, 0, 0); 234 234 AssertRC(rc); 235 Assert(u8Vector >= 0x20);236 235 } 237 236 #endif … … 244 243 uint8_t u8Vector; 245 244 int rc; 246 bool fSoftwareInt;245 TRPMEVENT enmType; 247 246 SVM_EVENT Event; 248 247 uint32_t u32ErrorCode; … … 251 250 252 251 /* If a new event is pending, then dispatch it now. */ 253 rc = TRPMQueryTrapAll(pVM, &u8Vector, & fSoftwareInt, &u32ErrorCode, 0);252 rc = TRPMQueryTrapAll(pVM, &u8Vector, &enmType, &u32ErrorCode, 0); 254 253 AssertRC(rc); 255 Assert(pCtx->eflags.Bits.u1IF == 1 || u8Vector < 0x20);256 Assert( fSoftwareInt == false);254 Assert(pCtx->eflags.Bits.u1IF == 1 || enmType == TRPM_TRAP); 255 Assert(enmType != TRPM_SOFTWARE_INT); 257 256 258 257 /* Clear the pending trap. */ … … 264 263 Event.n.u32ErrorCode = u32ErrorCode; 265 264 266 switch (u8Vector) { 267 case 8: 268 case 10: 269 case 11: 270 case 12: 271 case 13: 272 case 14: 273 case 17: 274 /* Valid error codes. */ 275 Event.n.u1ErrorCodeValid = 1; 276 break; 277 default: 278 break; 279 } 280 281 if (u8Vector == X86_XCPT_NMI) 282 Event.n.u3Type = SVM_EVENT_NMI; 283 else 284 if (u8Vector < 0x20) 285 Event.n.u3Type = SVM_EVENT_EXCEPTION; 265 if (enmType == TRPM_TRAP) 266 { 267 switch (u8Vector) { 268 case 8: 269 case 10: 270 case 11: 271 case 12: 272 case 13: 273 case 14: 274 case 17: 275 /* Valid error codes. */ 276 Event.n.u1ErrorCodeValid = 1; 277 break; 278 default: 279 break; 280 } 281 if (u8Vector == X86_XCPT_NMI) 282 Event.n.u3Type = SVM_EVENT_NMI; 283 else 284 Event.n.u3Type = SVM_EVENT_EXCEPTION; 285 } 286 286 else 287 287 Event.n.u3Type = SVM_EVENT_EXTERNAL_IRQ; … … 321 321 { 322 322 SVM_WRITE_SELREG(CS, cs); 323 Assert(pVMCB->guest.CS.u16Sel || !pVMCB->guest.CS.u16Attr );323 Assert(pVMCB->guest.CS.u16Sel || !pVMCB->guest.CS.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 324 324 325 325 SVM_WRITE_SELREG(SS, ss); 326 Assert(pVMCB->guest.SS.u16Sel || !pVMCB->guest.SS.u16Attr );326 Assert(pVMCB->guest.SS.u16Sel || !pVMCB->guest.SS.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 327 327 328 328 SVM_WRITE_SELREG(DS, ds); 329 Assert(pVMCB->guest.DS.u16Sel || !pVMCB->guest.DS.u16Attr );329 Assert(pVMCB->guest.DS.u16Sel || !pVMCB->guest.DS.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 330 330 331 331 SVM_WRITE_SELREG(ES, es); 332 Assert(pVMCB->guest.ES.u16Sel || !pVMCB->guest.ES.u16Attr );332 Assert(pVMCB->guest.ES.u16Sel || !pVMCB->guest.ES.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 333 333 334 334 SVM_WRITE_SELREG(FS, fs); 335 Assert(pVMCB->guest.FS.u16Sel || !pVMCB->guest.FS.u16Attr );335 Assert(pVMCB->guest.FS.u16Sel || !pVMCB->guest.FS.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 336 336 337 337 SVM_WRITE_SELREG(GS, gs); 338 Assert(pVMCB->guest.GS.u16Sel || !pVMCB->guest.GS.u16Attr );338 Assert(pVMCB->guest.GS.u16Sel || !pVMCB->guest.GS.u16Attr || !(pCtx->cr0 & X86_CR0_PE)); 339 339 } 340 340 … … 889 889 Log2(("Page fault at %VGv cr2=%VGv error code %x\n", pCtx->eip, uFaultAddress, errCode)); 890 890 /* Exit qualification contains the linear address of the page fault. */ 891 TRPMAssertTrap(pVM, X86_XCPT_PF, false);891 TRPMAssertTrap(pVM, X86_XCPT_PF, TRPM_TRAP); 892 892 TRPMSetErrorCode(pVM, errCode); 893 893 TRPMSetFaultAddress(pVM, uFaultAddress); … … 1001 1001 break; 1002 1002 } 1003 1004 1003 Log(("Trap %x at %VGv\n", vector, pCtx->eip)); 1005 1004 SVMR0InjectEvent(pVM, pVMCB, pCtx, &Event); -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r2076 r2124 328 328 if (VBOX_SUCCESS(rc)) 329 329 { 330 rc = TRPMAssertTrap(pVM, u8Interrupt, false);330 rc = TRPMAssertTrap(pVM, u8Interrupt, TRPM_HARDWARE_INT); 331 331 AssertRC(rc); 332 332 } … … 349 349 rc = TRPMQueryTrapAll(pVM, &u8Vector, 0, 0, 0); 350 350 AssertRC(rc); 351 Assert(u8Vector >= 0x20);352 351 } 353 352 #endif … … 360 359 uint8_t u8Vector; 361 360 int rc; 362 bool fSoftwareInt;361 TRPMEVENT enmType; 363 362 RTGCUINTPTR intInfo, errCode; 364 363 365 364 /* If a new event is pending, then dispatch it now. */ 366 rc = TRPMQueryTrapAll(pVM, &u8Vector, & fSoftwareInt, &errCode, 0);367 AssertRC(rc); 368 Assert(pCtx->eflags.Bits.u1IF == 1 || u8Vector < 0x20);369 Assert( fSoftwareInt == false);365 rc = TRPMQueryTrapAll(pVM, &u8Vector, &enmType, &errCode, 0); 366 AssertRC(rc); 367 Assert(pCtx->eflags.Bits.u1IF == 1 || enmType == TRPM_TRAP); 368 Assert(enmType != TRPM_SOFTWARE_INT); 370 369 371 370 /* Clear the pending trap. */ … … 376 375 intInfo |= (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT); 377 376 378 switch (u8Vector) { 379 case 8: 380 case 10: 381 case 11: 382 case 12: 383 case 13: 384 case 14: 385 case 17: 386 /* Valid error codes. */ 387 intInfo |= VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID; 388 break; 389 default: 390 break; 391 } 392 393 if (u8Vector == X86_XCPT_BP || u8Vector == X86_XCPT_OF) 394 intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SWEXCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); 395 else 396 if (u8Vector < 0x20) 397 intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_HWEXCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); 377 if (enmType == TRPM_TRAP) 378 { 379 switch (u8Vector) { 380 case 8: 381 case 10: 382 case 11: 383 case 12: 384 case 13: 385 case 14: 386 case 17: 387 /* Valid error codes. */ 388 intInfo |= VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID; 389 break; 390 default: 391 break; 392 } 393 if (u8Vector == X86_XCPT_BP || u8Vector == X86_XCPT_OF) 394 intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SWEXCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); 395 else 396 intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_HWEXCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); 397 } 398 398 else 399 399 intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_EXT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); … … 756 756 #endif 757 757 AssertRC(rc); 758 759 758 760 759 /* Done. */ … … 1271 1270 Log2(("Page fault at %VGv error code %x\n", exitQualification ,errCode)); 1272 1271 /* Exit qualification contains the linear address of the page fault. */ 1273 TRPMAssertTrap(pVM, X86_XCPT_PF, false);1272 TRPMAssertTrap(pVM, X86_XCPT_PF, TRPM_TRAP); 1274 1273 TRPMSetErrorCode(pVM, errCode); 1275 1274 TRPMSetFaultAddress(pVM, exitQualification); -
trunk/src/VBox/VMM/testcase/tstAsmStructs.cpp
r23 r2124 25 25 #include <VBox/cpum.h> 26 26 #include "CPUMInternal.h" 27 #include <VBox/trpm.h> 27 28 #include "TRPMInternal.h" 28 29 #include "../VMMSwitcher/VMMSwitcher.h"
Note:
See TracChangeset
for help on using the changeset viewer.