Changeset 20746 in vbox
- Timestamp:
- Jun 21, 2009 7:53:12 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
-
VBox/VMM/REMInternal.h (modified) (1 diff)
-
VBox/VMM/VMMAll/REMAll.cpp (modified) (4 diffs)
-
recompiler/VBoxRecompiler.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r20430 r20746 109 109 } u; 110 110 uint32_t idxSelf; 111 uint32_t idxNext;111 uint32_t volatile idxNext; 112 112 } REMHANDLERNOTIFICATION, *PREMHANDLERNOTIFICATION; 113 113 -
trunk/src/VBox/VMM/VMMAll/REMAll.cpp
r20431 r20746 100 100 do 101 101 { 102 idxFree = pVM->rem.s.idxFreeList;102 idxFree = ASMAtomicUoReadU32(&pVM->rem.s.idxFreeList); 103 103 if (idxFree == (uint32_t)-1) 104 104 { … … 106 106 break; 107 107 } 108 pFree = &pVM->rem.s.aHandlerNotifications[idxFree]; 108 pFree = &pVM->rem.s.aHandlerNotifications[idxFree]; 109 109 } while (!ASMAtomicCmpXchgU32(&pVM->rem.s.idxFreeList, pFree->idxNext, idxFree)); 110 110 … … 112 112 { 113 113 remFlushHandlerNotifications(pVM); 114 /** @todo why are we dropping the pReq here without a fight? If we can drop 115 * one, we can drop all... */ 114 116 return; 115 117 } … … 122 124 do 123 125 { 124 idxNext = pVM->rem.s.idxPendingList; 125 pFree->idxNext = idxNext; 126 idxNext = ASMAtomicUoReadU32(&pVM->rem.s.idxPendingList); 127 ASMAtomicWriteU32(&pFree->idxNext, idxNext); 128 ASMCompilerBarrier(); 126 129 } while (!ASMAtomicCmpXchgU32(&pVM->rem.s.idxPendingList, idxFree, idxNext)); 127 130 128 131 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 129 132 } 133 130 134 131 135 /** -
trunk/src/recompiler/VBoxRecompiler.c
r20668 r20746 279 279 * Initialize the REM critical section. 280 280 * 281 * Note: This is not a 100% safe solution as updating the internal memory state while another VCPU 281 * Note: This is not a 100% safe solution as updating the internal memory state while another VCPU 282 282 * is executing code could be dangerous. Taking the REM lock is not an option due to the danger of 283 283 * deadlocks. (mostly pgm vs rem locking) … … 2725 2725 VM_ASSERT_EMT(pVM); 2726 2726 2727 /** @todo this isn't ensuring correct replay order. */ 2727 2728 if (VM_FF_TESTANDCLEAR(pVM, VM_FF_REM_HANDLER_NOTIFY_BIT)) 2728 2729 { … … 2764 2765 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER: 2765 2766 remR3NotifyHandlerPhysicalRegister(pVM, 2766 pRec->u.PhysicalRegister.enmType,2767 pRec->u.PhysicalRegister.GCPhys,2768 pRec->u.PhysicalRegister.cb,2769 pRec->u.PhysicalRegister.fHasHCHandler);2767 pRec->u.PhysicalRegister.enmType, 2768 pRec->u.PhysicalRegister.GCPhys, 2769 pRec->u.PhysicalRegister.cb, 2770 pRec->u.PhysicalRegister.fHasHCHandler); 2770 2771 break; 2771 2772 2772 2773 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER: 2773 2774 remR3NotifyHandlerPhysicalDeregister(pVM, 2774 pRec->u.PhysicalDeregister.enmType,2775 pRec->u.PhysicalDeregister.GCPhys,2776 pRec->u.PhysicalDeregister.cb,2777 pRec->u.PhysicalDeregister.fHasHCHandler,2778 pRec->u.PhysicalDeregister.fRestoreAsRAM);2775 pRec->u.PhysicalDeregister.enmType, 2776 pRec->u.PhysicalDeregister.GCPhys, 2777 pRec->u.PhysicalDeregister.cb, 2778 pRec->u.PhysicalDeregister.fHasHCHandler, 2779 pRec->u.PhysicalDeregister.fRestoreAsRAM); 2779 2780 break; 2780 2781 2781 2782 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY: 2782 2783 remR3NotifyHandlerPhysicalModify(pVM, 2783 pRec->u.PhysicalModify.enmType,2784 pRec->u.PhysicalModify.GCPhysOld,2785 pRec->u.PhysicalModify.GCPhysNew,2786 pRec->u.PhysicalModify.cb,2787 pRec->u.PhysicalModify.fHasHCHandler,2788 pRec->u.PhysicalModify.fRestoreAsRAM);2784 pRec->u.PhysicalModify.enmType, 2785 pRec->u.PhysicalModify.GCPhysOld, 2786 pRec->u.PhysicalModify.GCPhysNew, 2787 pRec->u.PhysicalModify.cb, 2788 pRec->u.PhysicalModify.fHasHCHandler, 2789 pRec->u.PhysicalModify.fRestoreAsRAM); 2789 2790 break; 2790 2791 … … 2806 2807 do 2807 2808 { 2808 idxNext = pVM->rem.s.idxFreeList; 2809 pRec->idxNext = idxNext; 2809 idxNext = ASMAtomicUoReadU32(&pVM->rem.s.idxFreeList); 2810 ASMAtomicWriteU32(&pRec->idxNext, idxNext); 2811 ASMCompilerBarrier(); 2810 2812 } while (!ASMAtomicCmpXchgU32(&pVM->rem.s.idxFreeList, pRec->idxSelf, idxNext)); 2811 2813 }
Note:
See TracChangeset
for help on using the changeset viewer.

