VirtualBox

Changeset 80090 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jul 31, 2019 9:20:57 PM (5 years ago)
Author:
vboxsync
Message:

VMM: Kicking out raw-mode - IOM. bugref:9517

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r76553 r80090  
    850850
    851851
    852 #ifdef IN_RING3 /* Only used by REM. */
     852#if defined(IN_RING3) && defined(VBOX_WITH_REM) /* Only used by REM. */
    853853
    854854/**
     
    10871087
    10881088#endif /* IN_RING3 - only used by REM. */
    1089 #ifndef IN_RC
    10901089
    10911090/**
     
    12791278}
    12801279
    1281 #endif /* !IN_RC */
    1282 
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r76553 r80090  
    166166
    167167    /*
    168      * Setup any fixed pointers and offsets.
    169      */
    170     pVM->iom.s.offVM = RT_UOFFSETOF(VM, iom);
    171 
    172     /*
    173168     * Initialize the REM critical section.
    174169     */
     
    186181    if (RT_SUCCESS(rc))
    187182    {
    188         pVM->iom.s.pTreesRC = MMHyperR3ToRC(pVM, pVM->iom.s.pTreesR3);
    189183        pVM->iom.s.pTreesR0 = MMHyperR3ToR0(pVM, pVM->iom.s.pTreesR3);
    190184
     
    281275        pVCpu->iom.s.pMMIORangeLastR3  = NULL;
    282276        pVCpu->iom.s.pMMIOStatsLastR3  = NULL;
    283 
    284         pVCpu->iom.s.pRangeLastReadRC  = NIL_RTRCPTR;
    285         pVCpu->iom.s.pRangeLastWriteRC = NIL_RTRCPTR;
    286         pVCpu->iom.s.pStatsLastReadRC  = NIL_RTRCPTR;
    287         pVCpu->iom.s.pStatsLastWriteRC = NIL_RTRCPTR;
    288         pVCpu->iom.s.pMMIORangeLastRC  = NIL_RTRCPTR;
    289         pVCpu->iom.s.pMMIOStatsLastRC  = NIL_RTRCPTR;
    290277    }
    291278
     
    317304VMMR3_INT_DECL(void) IOMR3Relocate(PVM pVM, RTGCINTPTR offDelta)
    318305{
     306#if 0
    319307    LogFlow(("IOMR3Relocate: offDelta=%d\n", offDelta));
    320308
     
    340328        pVCpu->iom.s.pMMIOStatsLastRC  = NIL_RTRCPTR;
    341329    }
     330#else
     331    RT_NOREF(pVM, offDelta);
     332#endif
    342333}
    343334
     
    372363
    373364
     365#if 0
    374366/**
    375367 * Callback function for relocating a MMIO range.
     
    398390    return 0;
    399391}
     392#endif
    400393
    401394
     
    632625
    633626
     627#if 0
    634628/**
    635629 * Registers a I/O port RC handler.
     
    745739    return rc;
    746740}
     741#endif
    747742
    748743
     
    927922    }
    928923
     924#if 0
    929925    /*
    930926     * Remove any RC ranges first.
     
    10091005            Port++;
    10101006    } /* for all ports - RC. */
    1011 
     1007#else
     1008    int rc = VINF_SUCCESS;
     1009#endif
    10121010
    10131011    /*
     
    12741272
    12751273
     1274#if 0
    12761275/**
    12771276 * Display a single I/O port GC range.
     
    12961295    return 0;
    12971296}
     1297#endif
    12981298
    12991299
     
    13281328    RTAvlroIOPortDoWithAll(&pVM->iom.s.pTreesR3->IOPortTreeR0, true, iomR3IOPortInfoOneR3, (void *)pHlp);
    13291329
     1330#if 0
    13301331    pHlp->pfnPrintf(pHlp,
    13311332                    "I/O Port GC ranges (pVM=%p)\n"
     
    13371338                    sizeof(RTRCPTR) * 2,      "pvUser          ");
    13381339    RTAvlroIOPortDoWithAll(&pVM->iom.s.pTreesR3->IOPortTreeRC, true, iomR3IOPortInfoOneRC, (void *)pHlp);
     1340#endif
    13391341}
    13401342
     
    14431445
    14441446
     1447#if 0
    14451448/**
    14461449 * Registers a Memory Mapped I/O RC handler range.
     
    15001503    return VINF_SUCCESS;
    15011504}
     1505#endif
    15021506
    15031507
     
    17511755        }
    17521756
     1757#if 0
    17531758        if (pfnReadCallbackRC || pfnWriteCallbackRC || pfnFillCallbackRC)
    17541759        {
     
    17591764            pRange->pfnFillCallbackRC   = pfnFillCallbackRC;
    17601765        }
     1766#else
     1767        RT_NOREF(pfnReadCallbackRC, pfnWriteCallbackRC, pfnFillCallbackRC, pvUserRC);
     1768#endif
    17611769
    17621770        /*
     
    20462054                    pRange->pfnFillCallbackR0,
    20472055                    pRange->pvUserR0);
     2056#if 0
    20482057    pHlp->pfnPrintf(pHlp,
    20492058                    "%*s %RRv %RRv %RRv %RRv %RRv\n",
     
    20542063                    pRange->pfnFillCallbackRC,
    20552064                    pRange->pvUserRC);
     2065#endif
    20562066    return 0;
    20572067}
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r77299 r80090  
    129129{
    130130    PDMDEV_ASSERT_DEVINS(pDevIns);
    131     PVM pVM = pDevIns->Internal.s.pVMR3;
    132     VM_ASSERT_EMT(pVM);
     131    Assert(pDevIns->pReg->szRCMod[0]);
     132    Assert(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC);
    133133    LogFlow(("pdmR3DevHlp_IOPortRegisterRC: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pszOut=%p:{%s} pszIn=%p:{%s} pszOutStr=%p:{%s} pszInStr=%p:{%s} pszDesc=%p:{%s}\n", pDevIns->pReg->szName, pDevIns->iInstance,
    134134             Port, cPorts, pvUser, pszOut, pszOut, pszIn, pszIn, pszOutStr, pszOutStr, pszInStr, pszInStr, pszDesc, pszDesc));
    135135
     136#if 0
    136137    /*
    137138     * Resolve the functions (one of the can be NULL).
    138139     */
     140    PVM pVM = pDevIns->Internal.s.pVMR3;
     141    VM_ASSERT_EMT(pVM);
    139142    int rc = VINF_SUCCESS;
    140143    if (   pDevIns->pReg->szRCMod[0]
     
    186189        rc = VERR_INVALID_PARAMETER;
    187190    }
     191#else
     192    RT_NOREF(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
     193    int rc = VINF_SUCCESS;
     194#endif
    188195
    189196    LogFlow(("pdmR3DevHlp_IOPortRegisterRC: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     
    305312{
    306313    PDMDEV_ASSERT_DEVINS(pDevIns);
    307     PVM pVM = pDevIns->Internal.s.pVMR3;
    308     VM_ASSERT_EMT(pVM);
     314    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
     315    Assert(pDevIns->pReg->szR0Mod[0]);
     316    Assert(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0);
    309317    LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
    310318             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
    311319
    312 
     320#if 0
    313321    /*
    314322     * Resolve the functions.
     
    318326    if (   pDevIns->pReg->szRCMod[0]
    319327        && (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
    320         && VM_IS_RAW_MODE_ENABLED(pVM))
     328        && VM_IS_RAW_MODE_ENABLED(pDevIns->Internal.s.pVMR3))
    321329    {
    322330        RTRCPTR RCPtrWrite = NIL_RTRCPTR;
     
    335343
    336344        if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
    337             rc = IOMR3MmioRegisterRC(pVM, pDevIns, GCPhysStart, cbRange, pvUser, RCPtrWrite, RCPtrRead, RCPtrFill);
     345            rc = IOMR3MmioRegisterRC(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, RCPtrWrite, RCPtrRead, RCPtrFill);
    338346        else
    339347        {
     
    347355        }
    348356    }
    349     else if (VM_IS_RAW_MODE_ENABLED(pVM))
     357    else if (VM_IS_RAW_MODE_ENABLED(pDevIns->Internal.s.pVMR3))
    350358    {
    351359        AssertMsgFailed(("No RC module for this driver!\n"));
    352360        rc = VERR_INVALID_PARAMETER;
    353361    }
     362#else
     363    int rc = VINF_SUCCESS;
     364    RT_NOREF(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill);
     365#endif
    354366
    355367    LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     
    363375    PDMDEV_ASSERT_DEVINS(pDevIns);
    364376    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
     377    Assert(pDevIns->pReg->szR0Mod[0]);
     378    Assert(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0);
    365379    LogFlow(("pdmR3DevHlp_MMIORegisterHC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
    366380             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
     
    371385     */
    372386    int rc = VINF_SUCCESS;
    373     if (    pDevIns->pReg->szR0Mod[0]
    374         &&  (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0))
     387    if (   pDevIns->pReg->szR0Mod[0]
     388        && (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0))
    375389    {
    376390        R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0;
     
    505519
    506520    /* Raw-mode */
    507     rc = VINF_SUCCESS;
     521#if 0
    508522    RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteRC = 0;
    509523    if (pszWriteRC)
     
    525539        AssertLogRelMsgRCReturn(rc, ("pszFillRC=%s rc=%Rrc\n", pszFillRC, rc), rc);
    526540    }
     541#else
     542    RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteRC = 0;
     543    RCPTRTYPE(PFNIOMMMIOREAD)  pfnReadRC  = 0;
     544    RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillRC  = 0;
     545    RT_NOREF(pszWriteRC, pszReadRC, pszFillRC);
     546#endif
     547
    527548
    528549    /*
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r76585 r80090  
    8686    R3PTRTYPE(const char *)     pszDesc;
    8787
     88#if 0
    8889    /** Pointer to user argument - RC. */
    8990    RTRCPTR                     pvUserRC;
     
    99100    /** Padding structure length to multiple of 8 bytes. */
    100101    RTRCPTR                     RCPtrPadding;
     102#endif
    101103#endif
    102104} IOMMMIORANGE;
     
    289291    /** Tree containing I/O port range descriptors registered for R0 (IOMIOPORTRANGER0). */
    290292    AVLROIOPORTTREE         IOPortTreeR0;
     293#if 0
    291294    /** Tree containing I/O port range descriptors registered for RC (IOMIOPORTRANGERC). */
    292295    AVLROIOPORTTREE         IOPortTreeRC;
     296#endif
    293297
    294298    /** Tree containing the MMIO range descriptors (IOMMMIORANGE). */
     
    316320typedef struct IOM
    317321{
    318     /** Offset to the VM structure. */
    319     RTINT                           offVM;
    320 
    321     /** Pointer to the trees - RC ptr. */
    322     RCPTRTYPE(PIOMTREES)            pTreesRC;
    323322    /** Pointer to the trees - R3 ptr. */
    324323    R3PTRTYPE(PIOMTREES)            pTreesR3;
     
    447446    R0PTRTYPE(PIOMMMIORANGE)        pMMIORangeLastR0;
    448447    R0PTRTYPE(PIOMMMIOSTATS)        pMMIOStatsLastR0;
    449 
    450     RCPTRTYPE(PIOMIOPORTRANGERC)    pRangeLastReadRC;
    451     RCPTRTYPE(PIOMIOPORTRANGERC)    pRangeLastWriteRC;
    452     RCPTRTYPE(PIOMIOPORTSTATS)      pStatsLastReadRC;
    453     RCPTRTYPE(PIOMIOPORTSTATS)      pStatsLastWriteRC;
    454     RCPTRTYPE(PIOMMMIORANGE)        pMMIORangeLastRC;
    455     RCPTRTYPE(PIOMMMIOSTATS)        pMMIOStatsLastRC;
    456448    /** @} */
    457449} IOMCPU;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette