Changeset 13020 in vbox
- Timestamp:
- Oct 6, 2008 4:27:16 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmapi.h
r13013 r13020 51 51 VMMDECL(int) PDMApicSetTPR(PVM pVM, uint8_t u8TPR); 52 52 VMMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR, bool *pfPending); 53 VMMDECL(int) PDMApicW RMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);54 VMMDECL(int) PDMApicR DMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);53 VMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value); 54 VMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value); 55 55 VMMDECL(int) PDMVMMDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys); 56 56 -
trunk/include/VBox/pdmdev.h
r13013 r13020 992 992 993 993 /** 994 * W RMSR in APIC range.994 * Write MSR in APIC range. 995 995 * 996 996 * @returns VBox status code. … … 1000 1000 * @param u64Value Value to write. 1001 1001 */ 1002 DECLR3CALLBACKMEMBER(uint32_t, pfnW RMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value));1003 1004 /** 1005 * R DMSR in APIC range.1002 DECLR3CALLBACKMEMBER(uint32_t, pfnWriteMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)); 1003 1004 /** 1005 * Read MSR in APIC range. 1006 1006 * 1007 1007 * @returns VBox status code. … … 1011 1011 * @param pu64Value Value read. 1012 1012 */ 1013 DECLR3CALLBACKMEMBER(uint32_t, pfnR DMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value));1013 DECLR3CALLBACKMEMBER(uint32_t, pfnReadMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)); 1014 1014 1015 1015 /** … … 1046 1046 /** The name of the RC GetTPR entry point. */ 1047 1047 const char *pszGetTPRRC; 1048 /** The name of the RC W RMSR entry point. */1049 const char *pszW RMSRRC;1050 /** The name of the RC R DMSR entry point. */1051 const char *pszR DMSRRC;1048 /** The name of the RC WriteMSR entry point. */ 1049 const char *pszWriteMSRRC; 1050 /** The name of the RC ReadMSR entry point. */ 1051 const char *pszReadMSRRC; 1052 1052 /** The name of the RC BusDeliver entry point. */ 1053 1053 const char *pszBusDeliverRC; … … 1065 1065 /** The name of the R0 GetTPR entry point. */ 1066 1066 const char *pszGetTPRR0; 1067 /** The name of the R0 W RMSR entry point. */1068 const char *pszW RMSRR0;1069 /** The name of the R0 R DMSR entry point. */1070 const char *pszR DMSRR0;1067 /** The name of the R0 WriteMSR entry point. */ 1068 const char *pszWriteMSRR0; 1069 /** The name of the R0 ReadMSR entry point. */ 1070 const char *pszReadMSRR0; 1071 1071 /** The name of the R0 BusDeliver entry point. */ 1072 1072 const char *pszBusDeliverR0; -
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r13013 r13020 366 366 uint8_t u8DeliveryMode, uint8_t iVector, uint8_t u8Polarity, 367 367 uint8_t u8TriggerMode); 368 PDMBOTHCBDECL(uint32_t) apicW RMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);369 PDMBOTHCBDECL(uint32_t) apicR DMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);368 PDMBOTHCBDECL(uint32_t) apicWriteMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value); 369 PDMBOTHCBDECL(uint32_t) apicReadMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value); 370 370 PDMBOTHCBDECL(int) ioapicMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb); 371 371 PDMBOTHCBDECL(int) ioapicMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb); … … 581 581 } 582 582 583 PDMBOTHCBDECL(uint32_t) apicWRMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value) 584 { 583 PDMBOTHCBDECL(uint32_t) apicWriteMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value) 584 { 585 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 586 u32Reg -= MSR_IA32_APIC_START; 587 LogRel(("nike: WRMSR on %d: to %x written %llx\n", iCpu, u32Reg, u64Value)); 585 588 return 0; 586 589 } 587 PDMBOTHCBDECL(uint32_t) apicRDMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value) 588 { 590 PDMBOTHCBDECL(uint32_t) apicReadMSR(PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value) 591 { 592 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 593 u32Reg -= MSR_IA32_APIC_START; 594 LogRel(("nike: RDMSR on %d: read from %x\n", iCpu, u32Reg)); 595 *pu64Value = 0; 589 596 return 0; 590 597 } … … 1968 1975 ApicReg.pfnSetTPRR3 = apicSetTPR; 1969 1976 ApicReg.pfnGetTPRR3 = apicGetTPR; 1970 ApicReg.pfnW RMSRR3 = apicWRMSR;1971 ApicReg.pfnR DMSRR3 = apicRDMSR;1977 ApicReg.pfnWriteMSRR3 = apicWriteMSR; 1978 ApicReg.pfnReadMSRR3 = apicReadMSR; 1972 1979 ApicReg.pfnBusDeliverR3 = apicBusDeliverCallback; 1973 1980 if (fGCEnabled) { … … 1978 1985 ApicReg.pszSetTPRRC = "apicSetTPR"; 1979 1986 ApicReg.pszGetTPRRC = "apicGetTPR"; 1980 ApicReg.pszW RMSRRC = "apicWRMSR";1981 ApicReg.pszR DMSRRC = "apicRDMSR";1987 ApicReg.pszWriteMSRRC = "apicWriteMSR"; 1988 ApicReg.pszReadMSRRC = "apicReadMSR"; 1982 1989 ApicReg.pszBusDeliverRC = "apicBusDeliverCallback"; 1983 1990 } else { … … 1988 1995 ApicReg.pszSetTPRRC = NULL; 1989 1996 ApicReg.pszGetTPRRC = NULL; 1990 ApicReg.pszW RMSRRC= NULL;1991 ApicReg.pszR DMSRRC= NULL;1997 ApicReg.pszWriteMSRRC = NULL; 1998 ApicReg.pszReadMSRRC = NULL; 1992 1999 ApicReg.pszBusDeliverRC = NULL; 1993 2000 } … … 1999 2006 ApicReg.pszSetTPRR0 = "apicSetTPR"; 2000 2007 ApicReg.pszGetTPRR0 = "apicGetTPR"; 2001 ApicReg.pszW RMSRR0 = "apicWRMSR";2002 ApicReg.pszR DMSRR0 = "apicRDMSR";2008 ApicReg.pszWriteMSRR0 = "apicWriteMSR"; 2009 ApicReg.pszReadMSRR0 = "apicReadMSR"; 2003 2010 ApicReg.pszBusDeliverR0 = "apicBusDeliverCallback"; 2004 2011 } else { … … 2009 2016 ApicReg.pszSetTPRR0 = NULL; 2010 2017 ApicReg.pszGetTPRR0 = NULL; 2011 ApicReg.pszW RMSRR0= NULL;2012 ApicReg.pszR DMSRR0= NULL;2018 ApicReg.pszWriteMSRR0 = NULL; 2019 ApicReg.pszReadMSRR0 = NULL; 2013 2020 ApicReg.pszBusDeliverR0 = NULL; 2014 2021 } -
trunk/src/VBox/VMM/PDM.cpp
r13013 r13020 432 432 pVM->pdm.s.Apic.pfnGetTPRRC += offDelta; 433 433 pVM->pdm.s.Apic.pfnBusDeliverRC += offDelta; 434 pVM->pdm.s.Apic.pfnW RMSRRC+= offDelta;435 pVM->pdm.s.Apic.pfnR DMSRRC+= offDelta;434 pVM->pdm.s.Apic.pfnWriteMSRRC += offDelta; 435 pVM->pdm.s.Apic.pfnReadMSRRC += offDelta; 436 436 } 437 437 -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r13013 r13020 1489 1489 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1490 1490 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterruptR3=%p, .pfnSetBaseR3=%p, .pfnGetBaseR3=%p, " 1491 ".pfnSetTPRR3=%p, .pfnGetTPRR3=%p, .pfnW RMSR3=%p, .pfnRDMSR3=%p, .pfnBusDeliverR3=%p, pszGetInterruptRC=%p:{%s}, pszSetBaseRC=%p:{%s}, pszGetBaseRC=%p:{%s}, "1492 ".pszSetTPRRC=%p:{%s}, .pszGetTPRRC=%p:{%s}, .pszW RMSRRC=%p:{%s}, .pszRDMSRRC=%p:{%s}, .pszBusDeliverRC=%p:{%s}} ppApicHlpR3=%p\n",1491 ".pfnSetTPRR3=%p, .pfnGetTPRR3=%p, .pfnWriteMSR3=%p, .pfnReadMSR3=%p, .pfnBusDeliverR3=%p, pszGetInterruptRC=%p:{%s}, pszSetBaseRC=%p:{%s}, pszGetBaseRC=%p:{%s}, " 1492 ".pszSetTPRRC=%p:{%s}, .pszGetTPRRC=%p:{%s}, .pszWriteMSRRC=%p:{%s}, .pszReadMSRRC=%p:{%s}, .pszBusDeliverRC=%p:{%s}} ppApicHlpR3=%p\n", 1493 1493 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pApicReg, pApicReg->u32Version, pApicReg->pfnGetInterruptR3, pApicReg->pfnSetBaseR3, 1494 pApicReg->pfnGetBaseR3, pApicReg->pfnSetTPRR3, pApicReg->pfnGetTPRR3, pApicReg->pfnW RMSRR3, pApicReg->pfnRDMSRR3, pApicReg->pfnBusDeliverR3, pApicReg->pszGetInterruptRC,1494 pApicReg->pfnGetBaseR3, pApicReg->pfnSetTPRR3, pApicReg->pfnGetTPRR3, pApicReg->pfnWriteMSRR3, pApicReg->pfnReadMSRR3, pApicReg->pfnBusDeliverR3, pApicReg->pszGetInterruptRC, 1495 1495 pApicReg->pszGetInterruptRC, pApicReg->pszSetBaseRC, pApicReg->pszSetBaseRC, pApicReg->pszGetBaseRC, pApicReg->pszGetBaseRC, 1496 pApicReg->pszSetTPRRC, pApicReg->pszSetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszW RMSRRC, pApicReg->pszWRMSRRC, pApicReg->pszRDMSRRC, pApicReg->pszRDMSRRC, pApicReg->pszBusDeliverRC,1496 pApicReg->pszSetTPRRC, pApicReg->pszSetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszWriteMSRRC, pApicReg->pszWriteMSRRC, pApicReg->pszReadMSRRC, pApicReg->pszReadMSRRC, pApicReg->pszBusDeliverRC, 1497 1497 pApicReg->pszBusDeliverRC, ppApicHlpR3)); 1498 1498 … … 1512 1512 || !pApicReg->pfnSetTPRR3 1513 1513 || !pApicReg->pfnGetTPRR3 1514 || !pApicReg->pfnW RMSRR31515 || !pApicReg->pfnR DMSRR31514 || !pApicReg->pfnWriteMSRR3 1515 || !pApicReg->pfnReadMSRR3 1516 1516 || !pApicReg->pfnBusDeliverR3) 1517 1517 { … … 1522 1522 Assert(pApicReg->pfnSetTPRR3); 1523 1523 Assert(pApicReg->pfnGetTPRR3); 1524 Assert(pApicReg->pfnW RMSRR3);1525 Assert(pApicReg->pfnR DMSRR3);1524 Assert(pApicReg->pfnWriteMSRR3); 1525 Assert(pApicReg->pfnReadMSRR3); 1526 1526 Assert(pApicReg->pfnBusDeliverR3); 1527 1527 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (R3 callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER)); … … 1534 1534 || pApicReg->pszSetTPRRC 1535 1535 || pApicReg->pszGetTPRRC 1536 || pApicReg->pszW RMSRRC1537 || pApicReg->pszR DMSRRC1536 || pApicReg->pszWriteMSRRC 1537 || pApicReg->pszReadMSRRC 1538 1538 || pApicReg->pszBusDeliverRC) 1539 1539 && ( !VALID_PTR(pApicReg->pszGetInterruptRC) … … 1543 1543 || !VALID_PTR(pApicReg->pszSetTPRRC) 1544 1544 || !VALID_PTR(pApicReg->pszGetTPRRC) 1545 || !VALID_PTR(pApicReg->pszW RMSRRC)1546 || !VALID_PTR(pApicReg->pszR DMSRRC)1545 || !VALID_PTR(pApicReg->pszWriteMSRRC) 1546 || !VALID_PTR(pApicReg->pszReadMSRRC) 1547 1547 || !VALID_PTR(pApicReg->pszBusDeliverRC)) 1548 1548 ) … … 1554 1554 Assert(VALID_PTR(pApicReg->pszSetTPRRC)); 1555 1555 Assert(VALID_PTR(pApicReg->pszGetTPRRC)); 1556 Assert(VALID_PTR(pApicReg->pszR DMSRRC));1557 Assert(VALID_PTR(pApicReg->pszW RMSRRC));1556 Assert(VALID_PTR(pApicReg->pszReadMSRRC)); 1557 Assert(VALID_PTR(pApicReg->pszWriteMSRRC)); 1558 1558 Assert(VALID_PTR(pApicReg->pszBusDeliverRC)); 1559 1559 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (RC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER)); … … 1566 1566 || pApicReg->pszSetTPRR0 1567 1567 || pApicReg->pszGetTPRR0 1568 || pApicReg->pszW RMSRR01569 || pApicReg->pszR DMSRR01568 || pApicReg->pszWriteMSRR0 1569 || pApicReg->pszReadMSRR0 1570 1570 || pApicReg->pszBusDeliverR0) 1571 1571 && ( !VALID_PTR(pApicReg->pszGetInterruptR0) … … 1575 1575 || !VALID_PTR(pApicReg->pszSetTPRR0) 1576 1576 || !VALID_PTR(pApicReg->pszGetTPRR0) 1577 || !VALID_PTR(pApicReg->pszR DMSRR0)1578 || !VALID_PTR(pApicReg->pszW RMSRR0)1577 || !VALID_PTR(pApicReg->pszReadMSRR0) 1578 || !VALID_PTR(pApicReg->pszWriteMSRR0) 1579 1579 || !VALID_PTR(pApicReg->pszBusDeliverR0)) 1580 1580 ) … … 1586 1586 Assert(VALID_PTR(pApicReg->pszSetTPRR0)); 1587 1587 Assert(VALID_PTR(pApicReg->pszGetTPRR0)); 1588 Assert(VALID_PTR(pApicReg->pszR DMSRR0));1589 Assert(VALID_PTR(pApicReg->pszW RMSRR0));1588 Assert(VALID_PTR(pApicReg->pszReadMSRR0)); 1589 Assert(VALID_PTR(pApicReg->pszWriteMSRR0)); 1590 1590 Assert(VALID_PTR(pApicReg->pszBusDeliverR0)); 1591 1591 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (R0 callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER)); … … 1645 1645 if (RT_SUCCESS(rc)) 1646 1646 { 1647 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pDevReg->szRCMod, pApicReg->pszW RMSRRC, &pVM->pdm.s.Apic.pfnWRMSRRC);1648 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szRCMod, pApicReg->pszW RMSRRC, rc));1647 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pDevReg->szRCMod, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC); 1648 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szRCMod, pApicReg->pszWriteMSRRC, rc)); 1649 1649 } 1650 1650 if (RT_SUCCESS(rc)) 1651 1651 { 1652 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pDevReg->szRCMod, pApicReg->pszR DMSRRC, &pVM->pdm.s.Apic.pfnRDMSRRC);1653 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szRCMod, pApicReg->pszR DMSRRC, rc));1652 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pDevReg->szRCMod, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC); 1653 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szRCMod, pApicReg->pszReadMSRRC, rc)); 1654 1654 } 1655 1655 if (RT_SUCCESS(rc)) … … 1674 1674 pVM->pdm.s.Apic.pfnSetTPRRC = 0; 1675 1675 pVM->pdm.s.Apic.pfnGetTPRRC = 0; 1676 pVM->pdm.s.Apic.pfnW RMSRRC= 0;1677 pVM->pdm.s.Apic.pfnR DMSRRC= 0;1676 pVM->pdm.s.Apic.pfnWriteMSRRC = 0; 1677 pVM->pdm.s.Apic.pfnReadMSRRC = 0; 1678 1678 pVM->pdm.s.Apic.pfnBusDeliverRC = 0; 1679 1679 } … … 1713 1713 if (RT_SUCCESS(rc)) 1714 1714 { 1715 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszW RMSRR0, &pVM->pdm.s.Apic.pfnWRMSRR0);1716 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszW RMSRR0, rc));1715 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0); 1716 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszWriteMSRR0, rc)); 1717 1717 } 1718 1718 if (RT_SUCCESS(rc)) 1719 1719 { 1720 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszR DMSRR0, &pVM->pdm.s.Apic.pfnRDMSRR0);1721 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszR DMSRR0, rc));1720 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0); 1721 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszReadMSRR0, rc)); 1722 1722 } 1723 1723 if (RT_SUCCESS(rc)) … … 1742 1742 pVM->pdm.s.Apic.pfnSetTPRR0 = 0; 1743 1743 pVM->pdm.s.Apic.pfnGetTPRR0 = 0; 1744 pVM->pdm.s.Apic.pfnW RMSRR0= 0;1745 pVM->pdm.s.Apic.pfnR DMSRR0= 0;1744 pVM->pdm.s.Apic.pfnWriteMSRR0 = 0; 1745 pVM->pdm.s.Apic.pfnReadMSRR0 = 0; 1746 1746 pVM->pdm.s.Apic.pfnBusDeliverR0 = 0; 1747 1747 pVM->pdm.s.Apic.pDevInsR0 = 0; … … 1758 1758 pVM->pdm.s.Apic.pfnSetTPRR3 = pApicReg->pfnSetTPRR3; 1759 1759 pVM->pdm.s.Apic.pfnGetTPRR3 = pApicReg->pfnGetTPRR3; 1760 pVM->pdm.s.Apic.pfnW RMSRR3 = pApicReg->pfnWRMSRR3;1761 pVM->pdm.s.Apic.pfnR DMSRR3 = pApicReg->pfnRDMSRR3;1760 pVM->pdm.s.Apic.pfnWriteMSRR3 = pApicReg->pfnWriteMSRR3; 1761 pVM->pdm.s.Apic.pfnReadMSRR3 = pApicReg->pfnReadMSRR3; 1762 1762 pVM->pdm.s.Apic.pfnBusDeliverR3 = pApicReg->pfnBusDeliverR3; 1763 1763 Log(("PDM: Registered APIC device '%s'/%d pDevIns=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns)); -
trunk/src/VBox/VMM/PDMInternal.h
r13013 r13020 409 409 /** @copydoc PDMAPICREG::pfnGetTPRR3 */ 410 410 DECLR3CALLBACKMEMBER(uint8_t, pfnGetTPRR3,(PPDMDEVINS pDevIns)); 411 /** @copydoc PDMAPICREG::pfnW RMSRR3 */412 DECLR3CALLBACKMEMBER(uint32_t, pfnW RMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value));413 /** @copydoc PDMAPICREG::pfnR DMSRR3 */414 DECLR3CALLBACKMEMBER(uint32_t, pfnR DMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value));411 /** @copydoc PDMAPICREG::pfnWriteMSRR3 */ 412 DECLR3CALLBACKMEMBER(uint32_t, pfnWriteMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)); 413 /** @copydoc PDMAPICREG::pfnReadMSRR3 */ 414 DECLR3CALLBACKMEMBER(uint32_t, pfnReadMSRR3, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)); 415 415 /** @copydoc PDMAPICREG::pfnBusDeliverR3 */ 416 416 DECLR3CALLBACKMEMBER(void, pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, … … 431 431 /** @copydoc PDMAPICREG::pfnGetTPRR3 */ 432 432 DECLR0CALLBACKMEMBER(uint8_t, pfnGetTPRR0,(PPDMDEVINS pDevIns)); 433 /** @copydoc PDMAPICREG::pfnW RMSRR3 */434 DECLR0CALLBACKMEMBER(uint32_t, pfnW RMSRR0, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value));435 /** @copydoc PDMAPICREG::pfnR DMSRR3 */436 DECLR0CALLBACKMEMBER(uint32_t, pfnR DMSRR0, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value));433 /** @copydoc PDMAPICREG::pfnWriteMSRR3 */ 434 DECLR0CALLBACKMEMBER(uint32_t, pfnWriteMSRR0, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)); 435 /** @copydoc PDMAPICREG::pfnReadMSRR3 */ 436 DECLR0CALLBACKMEMBER(uint32_t, pfnReadMSRR0, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)); 437 437 /** @copydoc PDMAPICREG::pfnBusDeliverR3 */ 438 438 DECLR0CALLBACKMEMBER(void, pfnBusDeliverR0,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, … … 453 453 /** @copydoc PDMAPICREG::pfnGetTPRR3 */ 454 454 DECLRCCALLBACKMEMBER(uint8_t, pfnGetTPRRC,(PPDMDEVINS pDevIns)); 455 /** @copydoc PDMAPICREG::pfnW RMSRR3 */456 DECLRCCALLBACKMEMBER(uint32_t, pfnW RMSRRC, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value));457 /** @copydoc PDMAPICREG::pfnR DMSRR3 */458 DECLRCCALLBACKMEMBER(uint32_t, pfnR DMSRRC, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value));455 /** @copydoc PDMAPICREG::pfnWriteMSRR3 */ 456 DECLRCCALLBACKMEMBER(uint32_t, pfnWriteMSRRC, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)); 457 /** @copydoc PDMAPICREG::pfnReadMSRR3 */ 458 DECLRCCALLBACKMEMBER(uint32_t, pfnReadMSRRC, (PPDMDEVINS pDevIns, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)); 459 459 /** @copydoc PDMAPICREG::pfnBusDeliverR3 */ 460 460 DECLRCCALLBACKMEMBER(void, pfnBusDeliverRC,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r13013 r13020 2579 2579 /* In X2APIC specification this range is reserved for APIC control. */ 2580 2580 if ((pRegFrame->ecx >= MSR_IA32_APIC_START) && (pRegFrame->ecx < MSR_IA32_APIC_END)) 2581 { 2582 rc = PDMApicRDMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, &val); 2583 } 2581 rc = PDMApicReadMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, &val); 2584 2582 else 2585 {2586 2583 /* We should actually trigger a #GP here, but don't as that might cause more trouble. */ 2587 2584 val = 0; 2588 break; 2589 } 2585 break; 2590 2586 } 2591 2587 Log(("EMInterpretRdmsr %s (%x) -> val=%VX64\n", emMSRtoString(pRegFrame->ecx), pRegFrame->ecx, val)); … … 2728 2724 /* In X2APIC specification this range is reserved for APIC control. */ 2729 2725 if ((pRegFrame->ecx >= MSR_IA32_APIC_START) && (pRegFrame->ecx < MSR_IA32_APIC_END)) 2730 { 2731 return PDMApicWRMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, val); 2732 } 2726 return PDMApicWriteMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, val); 2727 2733 2728 /* We should actually trigger a #GP here, but don't as that might cause more trouble. */ 2734 2729 break; -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r13013 r13020 254 254 255 255 /** 256 * W RMSR in APIC range.256 * Write MSR in APIC range. 257 257 * 258 258 * @returns VBox status code. … … 262 262 * @param u64Value Value to write. 263 263 */ 264 VMMDECL(int) PDMApicW RMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)265 { 266 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 267 { 268 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnW RMSR));269 pdmLock(pVM); 270 pVM->pdm.s.Apic.CTX_SUFF(pfnW RMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, u64Value);271 pdmUnlock(pVM); 272 return VINF_SUCCESS; 273 } 274 return VERR_PDM_NO_APIC_INSTANCE; 275 } 276 277 /** 278 * R DMSR in APIC range.264 VMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value) 265 { 266 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 267 { 268 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnWriteMSR)); 269 pdmLock(pVM); 270 pVM->pdm.s.Apic.CTX_SUFF(pfnWriteMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, u64Value); 271 pdmUnlock(pVM); 272 return VINF_SUCCESS; 273 } 274 return VERR_PDM_NO_APIC_INSTANCE; 275 } 276 277 /** 278 * Read MSR in APIC range. 279 279 * 280 280 * @returns VBox status code. … … 284 284 * @param pu64Value Value read. 285 285 */ 286 VMMDECL(int) PDMApicR DMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)287 { 288 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 289 { 290 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnR DMSR));291 pdmLock(pVM); 292 pVM->pdm.s.Apic.CTX_SUFF(pfnR DMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, pu64Value);286 VMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value) 287 { 288 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 289 { 290 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnReadMSR)); 291 pdmLock(pVM); 292 pVM->pdm.s.Apic.CTX_SUFF(pfnReadMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, pu64Value); 293 293 pdmUnlock(pVM); 294 294 return VINF_SUCCESS; -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r13019 r13020 275 275 GEN_CHECK_OFF(PDM, Apic.pfnGetBaseR3); 276 276 GEN_CHECK_OFF(PDM, Apic.pfnSetTPRR3); 277 GEN_CHECK_OFF(PDM, Apic.pfnW RMSRR3);278 GEN_CHECK_OFF(PDM, Apic.pfnR DMSRR3);277 GEN_CHECK_OFF(PDM, Apic.pfnWriteMSRR3); 278 GEN_CHECK_OFF(PDM, Apic.pfnReadMSRR3); 279 279 GEN_CHECK_OFF(PDM, Apic.pfnGetTPRR3); 280 280 GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverR3); … … 285 285 GEN_CHECK_OFF(PDM, Apic.pfnSetTPRR0); 286 286 GEN_CHECK_OFF(PDM, Apic.pfnGetTPRR0); 287 GEN_CHECK_OFF(PDM, Apic.pfnW RMSRR0);288 GEN_CHECK_OFF(PDM, Apic.pfnR DMSRR0);287 GEN_CHECK_OFF(PDM, Apic.pfnWriteMSRR0); 288 GEN_CHECK_OFF(PDM, Apic.pfnReadMSRR0); 289 289 GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverR0); 290 290 GEN_CHECK_OFF(PDM, Apic.pDevInsRC); … … 294 294 GEN_CHECK_OFF(PDM, Apic.pfnSetTPRRC); 295 295 GEN_CHECK_OFF(PDM, Apic.pfnGetTPRRC); 296 GEN_CHECK_OFF(PDM, Apic.pfnW RMSRRC);297 GEN_CHECK_OFF(PDM, Apic.pfnR DMSRRC);296 GEN_CHECK_OFF(PDM, Apic.pfnWriteMSRRC); 297 GEN_CHECK_OFF(PDM, Apic.pfnReadMSRRC); 298 298 GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverRC); 299 299 GEN_CHECK_OFF(PDM, IoApic); -
trunk/src/recompiler/VBoxREMWrapper.cpp
r13013 r13020 645 645 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 646 646 }; 647 static const REMPARMDESC g_aArgsPDMApicW RMSR[] =647 static const REMPARMDESC g_aArgsPDMApicWriteMSR[] = 648 648 { 649 649 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, … … 652 652 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL } 653 653 }; 654 static const REMPARMDESC g_aArgsPDMApicR DMSR[] =654 static const REMPARMDESC g_aArgsPDMApicReadMSR[] = 655 655 { 656 656 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, … … 1079 1079 { "PDMApicSetBase", (void *)(uintptr_t)&PDMApicSetBase, &g_aArgsPDMApicSetBase[0], RT_ELEMENTS(g_aArgsPDMApicSetBase), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1080 1080 { "PDMApicSetTPR", (void *)(uintptr_t)&PDMApicSetTPR, &g_aArgsPDMApicSetTPR[0], RT_ELEMENTS(g_aArgsPDMApicSetTPR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1081 { "PDMApicW RMSR", (void *)(uintptr_t)&PDMApicWRMSR, &g_aArgsPDMApicWRMSR[0], RT_ELEMENTS(g_aArgsPDMApicWRMSR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },1082 { "PDMApicR DMSR", (void *)(uintptr_t)&PDMApicRDMSR, &g_aArgsPDMApicRDMSR[0], RT_ELEMENTS(g_aArgsPDMApicRDMSR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },1081 { "PDMApicWriteMSR", (void *)(uintptr_t)&PDMApicWriteMSR, &g_aArgsPDMApicWriteMSR[0], RT_ELEMENTS(g_aArgsPDMApicWriteMSR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1082 { "PDMApicReadMSR", (void *)(uintptr_t)&PDMApicReadMSR, &g_aArgsPDMApicReadMSR[0], RT_ELEMENTS(g_aArgsPDMApicReadMSR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1083 1083 { "PDMR3DmaRun", (void *)(uintptr_t)&PDMR3DmaRun, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1084 1084 { "PDMGetInterrupt", (void *)(uintptr_t)&PDMGetInterrupt, &g_aArgsPDMGetInterrupt[0], RT_ELEMENTS(g_aArgsPDMGetInterrupt), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, -
trunk/src/recompiler/VBoxRecompiler.c
r13013 r13020 4090 4090 { 4091 4091 uint64_t value; 4092 int rc = PDMApicRDMSR(env->pVM, 0/* cpu */, reg, &value); 4093 if (rc != VINF_SUCCESS) 4094 { 4095 /** @todo: exception ? */ 4096 value = 0; 4097 } 4092 int rc = PDMApicReadMSR(env->pVM, 0/* cpu */, reg, &value); 4093 if (VBOX_SUCCESS(rc)) 4094 { 4095 LogFlow(("cpu_apic_rdms returns %#x\n", value)); 4096 return value; 4097 } 4098 /** @todo: exception ? */ 4099 LogFlow(("cpu_apic_rdms returns 0 (rc=%Vrc)\n", rc)); 4098 4100 return value; 4099 4101 } … … 4101 4103 void cpu_apic_wrmsr(CPUX86State *env, uint32_t reg, uint64_t value) 4102 4104 { 4103 int rc = PDMApicWRMSR(env->pVM, 0 /* cpu */, reg, value); 4104 if (rc != VINF_SUCCESS) 4105 { 4106 /** @todo: exception ? */ 4107 } 4105 int rc = PDMApicWriteMSR(env->pVM, 0 /* cpu */, reg, value); 4106 /** @todo: exception if error ? */ 4107 LogFlow(("cpu_apic_wrmsr: rc=%Vrc\n", rc)); NOREF(rc); 4108 4108 } 4109 4109 /* -+- I/O Ports -+- */ -
trunk/src/recompiler/target-i386/helper.c
r13013 r13020 3077 3077 /* In X2APIC specification this range is reserved for APIC control. */ 3078 3078 if ((ecx >= MSR_APIC_RANGE_START) && (ecx < MSR_APIC_RANGE_END)) 3079 {3080 3079 cpu_apic_wrmsr(env, ecx, val); 3081 }3082 3080 else 3083 { 3084 /* @todo: exception ? */ 3085 } 3081 /* @todo: exception ? */; 3086 3082 break; 3087 3083 } … … 3139 3135 /* In X2APIC specification this range is reserved for APIC control. */ 3140 3136 if ((ecx >= MSR_APIC_RANGE_START) && (ecx < MSR_APIC_RANGE_END)) 3141 {3142 3137 val = cpu_apic_rdmsr(env, ecx); 3143 }3144 3138 else 3145 {3146 3139 /** @todo: exception ? */ 3147 3140 val = 0; 3148 break; 3149 } 3141 break; 3150 3142 } 3151 3143 }
Note:
See TracChangeset
for help on using the changeset viewer.