Changeset 2504 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 4, 2007 6:12:30 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r2270 r2504 719 719 * Reads an I/O port register. 720 720 * 721 * @returns VBox status code. 721 * @returns Strict VBox status code. Informational status codes other than the one documented 722 * here are to be treated as internal failure. 723 * @retval VINF_SUCCESS Success. 724 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 725 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 722 726 * 723 727 * @param pVM VM handle. … … 857 861 * Reads the string buffer of an I/O port register. 858 862 * 859 * @returns VBox status code. 863 * @returns Strict VBox status code. Informational status codes other than the one documented 864 * here are to be treated as internal failure. 865 * @retval VINF_SUCCESS Success. 866 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 867 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 860 868 * 861 869 * @param pVM VM handle. … … 978 986 * Writes to an I/O port register. 979 987 * 980 * @returns VBox status code. 988 * @returns Strict VBox status code. Informational status codes other than the one documented 989 * here are to be treated as internal failure. 990 * @retval VINF_SUCCESS Success. 991 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 992 * @retval VINF_IOM_HC_IOPORT_WRITE Defer the write to ring-3. (R0/GC only) 981 993 * 982 994 * @param pVM VM handle. … … 1089 1101 return VINF_SUCCESS; 1090 1102 } 1103 1104 1091 1105 /** 1092 1106 * Writes the string buffer of an I/O port register. 1093 1107 * 1094 * @returns VBox status code. 1108 * @returns Strict VBox status code. Informational status codes other than the one documented 1109 * here are to be treated as internal failure. 1110 * @retval VINF_SUCCESS Success. 1111 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1112 * @retval VINF_IOM_HC_IOPORT_WRITE Defer the write to ring-3. (R0/GC only) 1095 1113 * 1096 1114 * @param pVM VM handle. … … 1208 1226 } 1209 1227 1228 1210 1229 /** 1211 1230 * Checks that the operation is allowed according to the IOPL 1212 1231 * level and I/O bitmap. 1213 1232 * 1214 * @returns VBox status code. 1215 * If not VINF_SUCCESS a \#GP(0) was raised or an error occured. 1233 * @returns Strict VBox status code. Informational status codes other than the one documented 1234 * here are to be treated as internal failure. 1235 * @retval VINF_SUCCESS Success. 1236 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1237 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1238 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1216 1239 * 1217 1240 * @param pVM VM handle. … … 1303 1326 * IN <AL|AX|EAX>, <DX|imm16> 1304 1327 * 1305 * @returns VBox status code. 1328 * @returns Strict VBox status code. Informational status codes other than the one documented 1329 * here are to be treated as internal failure. 1330 * @retval VINF_SUCCESS Success. 1331 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1332 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 1333 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1334 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1335 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1306 1336 * 1307 1337 * @param pVM The virtual machine (GC pointer ofcourse). … … 1334 1364 uint32_t u32Data = ~0U; 1335 1365 rc = IOMIOPortRead(pVM, uPort, &u32Data, cbSize); 1336 if (rc == VINF_SUCCESS) 1366 if ( rc == VINF_SUCCESS 1367 || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST)) 1337 1368 { 1338 1369 /* … … 1342 1373 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 1343 1374 } 1344 } 1375 else 1376 AssertMsg(rc == VINF_IOM_HC_IOPORT_READ || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1377 } 1378 else 1379 AssertMsg(rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_TRPM_XCPT_DISPATCHED || rc == VINF_TRPM_XCPT_DISPATCHED || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1345 1380 return rc; 1346 1381 } … … 1350 1385 * OUT <DX|imm16>, <AL|AX|EAX> 1351 1386 * 1352 * @returns VBox status code. 1387 * @returns Strict VBox status code. Informational status codes other than the one documented 1388 * here are to be treated as internal failure. 1389 * @retval VINF_SUCCESS Success. 1390 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1391 * @retval VINF_IOM_HC_IOPORT_WRITE Defer the write to ring-3. (R0/GC only) 1392 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1393 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1394 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1353 1395 * 1354 1396 * @param pVM The virtual machine (GC pointer ofcourse). … … 1379 1421 1380 1422 /* 1381 * Attemp to write to the port.1423 * Attempt to write to the port. 1382 1424 */ 1383 1425 rc = IOMIOPortWrite(pVM, uPort, u32Data, cbSize); 1384 } 1426 AssertMsg(rc == VINF_SUCCESS || rc == VINF_IOM_HC_IOPORT_WRITE || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST) || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1427 } 1428 else 1429 AssertMsg(rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_TRPM_XCPT_DISPATCHED || rc == VINF_TRPM_XCPT_DISPATCHED || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1385 1430 return rc; 1386 1431 } -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r2363 r2504 460 460 461 461 462 inline intiomRamRead(PVM pVM, void *pDest, RTGCPTR GCSrc, uint32_t cb)462 DECLINLINE(int) iomRamRead(PVM pVM, void *pDest, RTGCPTR GCSrc, uint32_t cb) 463 463 { 464 464 #ifdef IN_GC … … 479 479 } 480 480 481 inline intiomRamWrite(PVM pVM, RTGCPTR GCDest, void *pSrc, uint32_t cb)481 DECLINLINE(int) iomRamWrite(PVM pVM, RTGCPTR GCDest, void *pSrc, uint32_t cb) 482 482 { 483 483 #ifdef IN_GC … … 1589 1589 * ES:EDI,DX[,ECX] 1590 1590 * 1591 * @note Assumes caller checked the access privileges (IOMInterpretCheckPortIOAccess) 1592 * 1593 * @returns VBox status code. 1591 * @remark Assumes caller checked the access privileges (IOMInterpretCheckPortIOAccess) 1592 * 1593 * @returns Strict VBox status code. Informational status codes other than the one documented 1594 * here are to be treated as internal failure. 1595 * @retval VINF_SUCCESS Success. 1596 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1597 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 1598 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1599 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1600 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1594 1601 * 1595 1602 * @param pVM The virtual machine (GC pointer ofcourse). … … 1601 1608 IOMDECL(int) IOMInterpretINSEx(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, uint32_t cbTransfer) 1602 1609 { 1603 int rc = VINF_SUCCESS;1604 1605 1610 #ifdef VBOX_WITH_STATISTICS 1606 1611 STAM_COUNTER_INC(&pVM->iom.s.StatGCInstIns); … … 1628 1633 /* Convert destination address es:edi. */ 1629 1634 RTGCPTR GCPtrDst; 1630 rc = SELMToFlatEx(pVM, pRegFrame->eflags, pRegFrame->es, (RTGCPTR)pRegFrame->edi, &pRegFrame->esHid,1631 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL,1632 &GCPtrDst, NULL);1635 int rc = SELMToFlatEx(pVM, pRegFrame->eflags, pRegFrame->es, (RTGCPTR)pRegFrame->edi, &pRegFrame->esHid, 1636 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL, 1637 &GCPtrDst, NULL); 1633 1638 if (VBOX_FAILURE(rc)) 1634 1639 { … … 1683 1688 pRegFrame->ecx = cTransfers; 1684 1689 1690 AssertMsg(rc == VINF_SUCCESS || rc == VINF_IOM_HC_IOPORT_READ || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST) || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1685 1691 return rc; 1686 1692 } … … 1691 1697 * ES:EDI,DX[,ECX] 1692 1698 * 1693 * @returns VBox status code. 1699 * @returns Strict VBox status code. Informational status codes other than the one documented 1700 * here are to be treated as internal failure. 1701 * @retval VINF_SUCCESS Success. 1702 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1703 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 1704 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1705 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1706 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1694 1707 * 1695 1708 * @param pVM The virtual machine (GC pointer ofcourse). … … 1712 1725 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize); 1713 1726 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 1727 { 1728 AssertMsg(rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_TRPM_XCPT_DISPATCHED || rc == VINF_TRPM_XCPT_DISPATCHED || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1714 1729 return rc; 1730 } 1715 1731 1716 1732 return IOMInterpretINSEx(pVM, pRegFrame, uPort, pCpu->prefix, cbSize); 1717 1733 } 1734 1718 1735 1719 1736 /** … … 1721 1738 * DS:ESI,DX[,ECX] 1722 1739 * 1723 * @note Assumes caller checked the access privileges (IOMInterpretCheckPortIOAccess) 1724 * 1725 * @returns VBox status code. 1740 * @remark Assumes caller checked the access privileges (IOMInterpretCheckPortIOAccess) 1741 * 1742 * @returns Strict VBox status code. Informational status codes other than the one documented 1743 * here are to be treated as internal failure. 1744 * @retval VINF_SUCCESS Success. 1745 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1746 * @retval VINF_IOM_HC_IOPORT_WRITE Defer the write to ring-3. (R0/GC only) 1747 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1748 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1749 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1726 1750 * 1727 1751 * @param pVM The virtual machine (GC pointer ofcourse). … … 1733 1757 IOMDECL(int) IOMInterpretOUTSEx(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, uint32_t cbTransfer) 1734 1758 { 1735 int rc = VINF_SUCCESS;1736 1737 1759 #ifdef VBOX_WITH_STATISTICS 1738 1760 STAM_COUNTER_INC(&pVM->iom.s.StatGCInstOuts); … … 1760 1782 /* Convert source address ds:esi. */ 1761 1783 RTGCPTR GCPtrSrc; 1762 rc = SELMToFlatEx(pVM, pRegFrame->eflags, pRegFrame->ds, (RTGCPTR)pRegFrame->esi, &pRegFrame->dsHid,1763 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL,1764 &GCPtrSrc, NULL);1784 int rc = SELMToFlatEx(pVM, pRegFrame->eflags, pRegFrame->ds, (RTGCPTR)pRegFrame->esi, &pRegFrame->dsHid, 1785 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL, 1786 &GCPtrSrc, NULL); 1765 1787 if (VBOX_FAILURE(rc)) 1766 1788 { 1767 Log(("OUTS source address conversion failed -> fallback, rc=% d\n", rc));1789 Log(("OUTS source address conversion failed -> fallback, rc=%Vrc\n", rc)); 1768 1790 return VINF_IOM_HC_IOPORT_WRITE; 1769 1791 } … … 1775 1797 if (rc != VINF_SUCCESS) 1776 1798 { 1777 Log(("OUTS will generate a trap -> fallback, rc=% d\n", rc));1799 Log(("OUTS will generate a trap -> fallback, rc=%Vrc\n", rc)); 1778 1800 return VINF_IOM_HC_IOPORT_WRITE; 1779 1801 } … … 1783 1805 { 1784 1806 /* 1785 * If the device supports string transfers, ask it to do as1786 * much as it wants. The rest is done with single-word transfers.1787 */1807 * If the device supports string transfers, ask it to do as 1808 * much as it wants. The rest is done with single-word transfers. 1809 */ 1788 1810 const RTGCUINTREG cTransfersOrg = cTransfers; 1789 1811 rc = IOMIOPortWriteString(pVM, uPort, &GCPtrSrc, &cTransfers, cbTransfer); … … 1803 1825 break; 1804 1826 rc = IOMIOPortWrite(pVM, uPort, u32Value, cbTransfer); 1805 if (rc == VINF_IOM_HC_IOPORT_WRITE )1827 if (rc == VINF_IOM_HC_IOPORT_WRITE || VBOX_FAILURE(rc)) 1806 1828 break; 1807 1829 GCPtrSrc = (RTGCPTR)((RTUINTPTR)GCPtrSrc + cbTransfer); … … 1817 1839 if (uPrefix & PREFIX_REP) 1818 1840 pRegFrame->ecx = cTransfers; 1841 1842 AssertMsg(rc == VINF_SUCCESS || rc == VINF_IOM_HC_IOPORT_WRITE || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST) || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1819 1843 return rc; 1820 1844 } 1821 1822 1845 1823 1846 … … 1826 1849 * DS:ESI,DX[,ECX] 1827 1850 * 1828 * @returns VBox status code. 1851 * @returns Strict VBox status code. Informational status codes other than the one documented 1852 * here are to be treated as internal failure. 1853 * @retval VINF_SUCCESS Success. 1854 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 1855 * @retval VINF_IOM_HC_IOPORT_WRITE Defer the write to ring-3. (R0/GC only) 1856 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 1857 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 1858 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 1829 1859 * 1830 1860 * @param pVM The virtual machine (GC pointer ofcourse). … … 1849 1879 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize); 1850 1880 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 1881 { 1882 AssertMsg(rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_TRPM_XCPT_DISPATCHED || rc == VINF_TRPM_XCPT_DISPATCHED || VBOX_FAILURE(rc), ("%Vrc\n", rc)); 1851 1883 return rc; 1884 } 1852 1885 1853 1886 return IOMInterpretOUTSEx(pVM, pRegFrame, uPort, pCpu->prefix, cbSize); 1854 1887 } 1888 -
trunk/src/VBox/VMM/VMMGC/IOMGC.cpp
r2231 r2504 51 51 * 52 52 * The \#GP trap handler in GC will call this function if the opcode causing the 53 * trap is a in or out type instruction. 53 * trap is a in or out type instruction. (Call it indirectly via EM that is.) 54 54 * 55 * @returns VBox status code. 55 * @returns Strict VBox status code. Informational status codes other than the one documented 56 * here are to be treated as internal failure. 57 * @retval VINF_SUCCESS Success. 58 * @retval VINF_EM_FIRST-VINF_EM_LAST Success but schedulinging information needs to be passed onto EM. 59 * @retval VINF_IOM_HC_IOPORT_READ Defer the read to ring-3. (R0/GC only) 60 * @retval VINF_EM_RAW_GUEST_TRAP The exception was left pending. (TRPMRaiseXcptErr) 61 * @retval VINF_TRPM_XCPT_DISPATCHED The exception was raised and dispatched for raw-mode execution. (TRPMRaiseXcptErr) 62 * @retval VINF_EM_RESCHEDULE_REM The exception was dispatched and cannot be executed in raw-mode. (TRPMRaiseXcptErr) 56 63 * 57 64 * @param pVM The virtual machine (GC pointer ofcourse).
Note:
See TracChangeset
for help on using the changeset viewer.