Changeset 19015 in vbox for trunk/src/VBox/VMM/TRPM.cpp
- Timestamp:
- Apr 20, 2009 7:54:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/TRPM.cpp
r18927 r19015 431 431 432 432 /** TRPM saved state version. */ 433 #define TRPM_SAVED_STATE_VERSION 8 433 #define TRPM_SAVED_STATE_VERSION 9 434 #define TRPM_SAVED_STATE_VERSION_UNI 8 /* SMP support bumped the version */ 434 435 435 436 … … 464 465 */ 465 466 pVM->trpm.s.offVM = RT_OFFSETOF(VM, trpm); 466 pVM->trpm.s.uActiveVector = ~0; 467 pVM->trpm.s.offTRPMCPU = RT_OFFSETOF(VM, aCpus[0].trpm) - RT_OFFSETOF(VM, trpm); 468 469 for (unsigned i=0;i<pVM->cCPUs;i++) 470 { 471 PVMCPU pVCpu = &pVM->aCpus[i]; 472 473 pVCpu->trpm.s.offVM = RT_OFFSETOF(VM, aCpus[i].trpm); 474 pVCpu->trpm.s.uActiveVector = ~0; 475 } 476 467 477 pVM->trpm.s.GuestIdtr.pIdt = RTRCPTR_MAX; 468 478 pVM->trpm.s.pvMonShwIdtRC = RTRCPTR_MAX; … … 731 741 * Reinitialize other members calling the relocator to get things right. 732 742 */ 733 pVM->trpm.s.uActiveVector = ~0; 743 for (unsigned i=0;i<pVM->cCPUs;i++) 744 { 745 PVMCPU pVCpu = &pVM->aCpus[i]; 746 pVCpu->trpm.s.uActiveVector = ~0; 747 } 734 748 memcpy(&pVM->trpm.s.aIdt[0], &g_aIdt[0], sizeof(pVM->trpm.s.aIdt)); 735 749 memset(pVM->trpm.s.aGuestTrapHandler, 0, sizeof(pVM->trpm.s.aGuestTrapHandler)); … … 752 766 static DECLCALLBACK(int) trpmR3Save(PVM pVM, PSSMHANDLE pSSM) 753 767 { 768 PTRPM pTrpm = &pVM->trpm.s; 754 769 LogFlow(("trpmR3Save:\n")); 755 770 … … 757 772 * Active and saved traps. 758 773 */ 759 PTRPM pTrpm = &pVM->trpm.s; 760 SSMR3PutUInt(pSSM, pTrpm->uActiveVector); 761 SSMR3PutUInt(pSSM, pTrpm->enmActiveType); 762 SSMR3PutGCUInt(pSSM, pTrpm->uActiveErrorCode); 763 SSMR3PutGCUIntPtr(pSSM, pTrpm->uActiveCR2); 764 SSMR3PutGCUInt(pSSM, pTrpm->uSavedVector); 765 SSMR3PutUInt(pSSM, pTrpm->enmSavedType); 766 SSMR3PutGCUInt(pSSM, pTrpm->uSavedErrorCode); 767 SSMR3PutGCUIntPtr(pSSM, pTrpm->uSavedCR2); 768 SSMR3PutGCUInt(pSSM, pTrpm->uPrevVector); 769 #if 0 /** @todo Enable this (+ load change) on the next version change. */ 774 for (unsigned i=0;i<pVM->cCPUs;i++) 775 { 776 PTRPMCPU pTrpmCpu = &pVM->aCpus[i].trpm.s; 777 778 SSMR3PutUInt(pSSM, pTrpmCpu->uActiveVector); 779 SSMR3PutUInt(pSSM, pTrpmCpu->enmActiveType); 780 SSMR3PutGCUInt(pSSM, pTrpmCpu->uActiveErrorCode); 781 SSMR3PutGCUIntPtr(pSSM, pTrpmCpu->uActiveCR2); 782 SSMR3PutGCUInt(pSSM, pTrpmCpu->uSavedVector); 783 SSMR3PutUInt(pSSM, pTrpmCpu->enmSavedType); 784 SSMR3PutGCUInt(pSSM, pTrpmCpu->uSavedErrorCode); 785 SSMR3PutGCUIntPtr(pSSM, pTrpmCpu->uSavedCR2); 786 SSMR3PutGCUInt(pSSM, pTrpmCpu->uPrevVector); 787 } 770 788 SSMR3PutBool(pSSM, pTrpm->fDisableMonitoring); 771 #else772 SSMR3PutGCUInt(pSSM, pTrpm->fDisableMonitoring);773 #endif774 789 SSMR3PutUInt(pSSM, VM_FF_ISSET(pVM, VM_FF_TRPM_SYNC_IDT)); 775 790 SSMR3PutMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched)); … … 808 823 * Validate version. 809 824 */ 810 if (u32Version != TRPM_SAVED_STATE_VERSION) 825 if ( u32Version != TRPM_SAVED_STATE_VERSION 826 && u32Version != TRPM_SAVED_STATE_VERSION_UNI) 811 827 { 812 828 AssertMsgFailed(("trpmR3Load: Invalid version u32Version=%d!\n", u32Version)); … … 823 839 */ 824 840 PTRPM pTrpm = &pVM->trpm.s; 825 SSMR3GetUInt(pSSM, &pTrpm->uActiveVector); 826 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpm->enmActiveType); 827 SSMR3GetGCUInt(pSSM, &pTrpm->uActiveErrorCode); 828 SSMR3GetGCUIntPtr(pSSM, &pTrpm->uActiveCR2); 829 SSMR3GetGCUInt(pSSM, &pTrpm->uSavedVector); 830 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpm->enmSavedType); 831 SSMR3GetGCUInt(pSSM, &pTrpm->uSavedErrorCode); 832 SSMR3GetGCUIntPtr(pSSM, &pTrpm->uSavedCR2); 833 SSMR3GetGCUInt(pSSM, &pTrpm->uPrevVector); 834 #if 0 /** @todo Enable this + the corresponding save code on the next version change. */ 835 SSMR3GetBool(pSSM, &pTrpm->fDisableMonitoring); 836 #else 837 RTGCUINT fDisableMonitoring; 838 SSMR3GetGCUInt(pSSM, &fDisableMonitoring); 839 pTrpm->fDisableMonitoring = !!fDisableMonitoring; 840 #endif 841 842 if (u32Version == TRPM_SAVED_STATE_VERSION) 843 { 844 for (unsigned i=0;i<pVM->cCPUs;i++) 845 { 846 PTRPMCPU pTrpmCpu = &pVM->aCpus[i].trpm.s; 847 SSMR3GetUInt(pSSM, &pTrpmCpu->uActiveVector); 848 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpmCpu->enmActiveType); 849 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uActiveErrorCode); 850 SSMR3GetGCUIntPtr(pSSM, &pTrpmCpu->uActiveCR2); 851 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uSavedVector); 852 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpmCpu->enmSavedType); 853 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uSavedErrorCode); 854 SSMR3GetGCUIntPtr(pSSM, &pTrpmCpu->uSavedCR2); 855 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uPrevVector); 856 } 857 858 SSMR3GetBool(pSSM, &pVM->trpm.s.fDisableMonitoring); 859 } 860 else 861 { 862 PTRPMCPU pTrpmCpu = &pVM->aCpus[0].trpm.s; 863 SSMR3GetUInt(pSSM, &pTrpmCpu->uActiveVector); 864 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpmCpu->enmActiveType); 865 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uActiveErrorCode); 866 SSMR3GetGCUIntPtr(pSSM, &pTrpmCpu->uActiveCR2); 867 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uSavedVector); 868 SSMR3GetUInt(pSSM, (uint32_t *)&pTrpmCpu->enmSavedType); 869 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uSavedErrorCode); 870 SSMR3GetGCUIntPtr(pSSM, &pTrpmCpu->uSavedCR2); 871 SSMR3GetGCUInt(pSSM, &pTrpmCpu->uPrevVector); 872 873 RTGCUINT fDisableMonitoring; 874 SSMR3GetGCUInt(pSSM, &fDisableMonitoring); 875 pTrpm->fDisableMonitoring = !!fDisableMonitoring; 876 } 841 877 842 878 RTUINT fSyncIDT; … … 1417 1453 if (HWACCMR3IsActive(pVM)) 1418 1454 { 1419 rc = TRPMAssertTrap(pV M, u8Interrupt, enmEvent);1455 rc = TRPMAssertTrap(pVCpu, u8Interrupt, enmEvent); 1420 1456 AssertRC(rc); 1421 1457 STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]); … … 1436 1472 { 1437 1473 /* There's a handler -> let's execute it in raw mode */ 1438 rc = TRPMForwardTrap(pV M, CPUMCTX2CORE(pCtx), u8Interrupt, 0, TRPM_TRAP_NO_ERRORCODE, enmEvent, -1);1474 rc = TRPMForwardTrap(pVCpu, CPUMCTX2CORE(pCtx), u8Interrupt, 0, TRPM_TRAP_NO_ERRORCODE, enmEvent, -1); 1439 1475 if (rc == VINF_SUCCESS /* Don't use RT_SUCCESS */) 1440 1476 {
Note:
See TracChangeset
for help on using the changeset viewer.