Changeset 101016 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Sep 5, 2023 9:08:39 AM (18 months ago)
- svn:sync-xref-src-repo-rev:
- 158973
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r100986 r101016 1148 1148 DECLINLINE(void) buslogicR3OutgoingMailboxAdvance(PBUSLOGIC pThis) 1149 1149 { 1150 pThis->uMailboxOutgoingPositionCurrent = (pThis->uMailboxOutgoingPositionCurrent + 1) % pThis->cMailbox; 1150 uint32_t uNextPos = pThis->uMailboxOutgoingPositionCurrent + 1; 1151 Assert(uNextPos <= pThis->cMailbox); 1152 pThis->uMailboxOutgoingPositionCurrent = uNextPos >= pThis->cMailbox ? 0 : uNextPos; 1151 1153 } 1152 1154 … … 3414 3416 } 3415 3417 else 3418 { 3416 3419 AssertMsgFailed(("Invalid outgoing mailbox action code %u\n", MailboxGuest.u.out.uActionCode)); 3420 /** @todo We ought to report an error in the incoming mailbox here */ 3421 rc = VINF_NOT_SUPPORTED; /* Not immediately an error, keep going. */ 3422 } 3417 3423 3418 3424 AssertRC(rc); … … 3821 3827 if (ASMAtomicXchgU32(&pThis->cMailboxesReady, 0)) 3822 3828 { 3823 /* Process mailboxes. */ 3829 /* Process mailboxes as long as there are new entries. The loop can potentially 3830 * keep going for a while if the guest keeps supplying new entries. 3831 * If there are too many invalid mailbox entries, abort processing because 3832 * we're just wasting time. This might happen if the guest keeps supplying 3833 * new invalid entries (extremely unlikely), or if the mailbox memory is not 3834 * writable for whatever reason. 3835 */ 3836 uint32_t cMaxInvalid = pThis->cMailbox * 2; /* NB: cMailbox can't be more than 255. */ 3824 3837 do 3825 3838 { 3826 3839 rc = buslogicR3ProcessMailboxNext(pDevIns, pThis, pThisCC); 3840 if (RT_UNLIKELY(rc == VINF_NOT_SUPPORTED)) 3841 { 3842 if (cMaxInvalid-- == 0) 3843 { 3844 LogRelMax(10, ("BusLogic: Too many invalid entries, aborting maibox processing!\n")); 3845 break; 3846 } 3847 } 3827 3848 AssertMsg(RT_SUCCESS(rc) || rc == VERR_NO_DATA, ("Processing mailbox failed rc=%Rrc\n", rc)); 3828 3849 } while (RT_SUCCESS(rc));
Note:
See TracChangeset
for help on using the changeset viewer.