VirtualBox

Ignore:
Timestamp:
Feb 23, 2021 6:53:00 AM (4 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 SSM bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r87837 r87838  
    64036403#endif
    64046404
    6405     /** @todo The rest. */
     6405    /* Command buffer head pointer register. */
     6406    {
     6407        rc = pHlp->pfnSSMGetU64(pSSM, &pThis->CmdBufHeadPtr.u64);
     6408        AssertRCReturn(rc, rc);
     6409
     6410        /*
     6411         * IOMMU behavior is undefined when software writes a value outside the buffer length.
     6412         * In our emulation, since we ignore the write entirely (see iommuAmdCmdBufHeadPtr_w)
     6413         * we shouldn't see such values in the saved state.
     6414         */
     6415        uint32_t const offBuf = pThis->CmdBufHeadPtr.u64 & IOMMU_CMD_BUF_HEAD_PTR_VALID_MASK;
     6416        uint32_t const cbBuf  = iommuAmdGetTotalBufLength(pThis->CmdBufBaseAddr.n.u4Len);
     6417        Assert(cbBuf <= _512K);
     6418        AssertLogRelMsgReturn(offBuf < cbBuf,
     6419                              ("Command buffer head pointer invalid %#x\n", pThis->CmdBufHeadPtr.u64), rcDataError);
     6420    }
     6421
     6422    /* Command buffer tail pointer register. */
     6423    {
     6424        rc = pHlp->pfnSSMGetU64(pSSM, &pThis->CmdBufTailPtr.u64);
     6425        AssertRCReturn(rc, rc);
     6426
     6427        uint32_t const offBuf = pThis->CmdBufTailPtr.u64 & IOMMU_CMD_BUF_TAIL_PTR_VALID_MASK;
     6428        uint32_t const cbBuf  = iommuAmdGetTotalBufLength(pThis->CmdBufBaseAddr.n.u4Len);
     6429        Assert(cbBuf <= _512K);
     6430        AssertLogRelMsgReturn(offBuf < cbBuf,
     6431                              ("Command buffer tail pointer invalid %#x\n", pThis->CmdBufTailPtr.u64), rcDataError);
     6432    }
     6433
     6434    /* Event log head pointer register. */
     6435    {
     6436        rc = pHlp->pfnSSMGetU64(pSSM, &pThis->EvtLogHeadPtr.u64);
     6437        AssertRCReturn(rc, rc);
     6438
     6439        uint32_t const offBuf = pThis->EvtLogHeadPtr.u64 & IOMMU_EVT_LOG_HEAD_PTR_VALID_MASK;
     6440        uint32_t const cbBuf  = iommuAmdGetTotalBufLength(pThis->EvtLogBaseAddr.n.u4Len);
     6441        Assert(cbBuf <= _512K);
     6442        AssertLogRelMsgReturn(offBuf < cbBuf,
     6443                              ("Event log head pointer invalid %#x\n", pThis->EvtLogHeadPtr.u64), rcDataError);
     6444    }
     6445
     6446    /* Event log tail pointer register. */
     6447    {
     6448        rc = pHlp->pfnSSMGetU64(pSSM, &pThis->EvtLogTailPtr.u64);
     6449        AssertRCReturn(rc, rc);
     6450
     6451        uint32_t const offBuf = pThis->EvtLogTailPtr.u64 & IOMMU_EVT_LOG_TAIL_PTR_VALID_MASK;
     6452        uint32_t const cbBuf  = iommuAmdGetTotalBufLength(pThis->EvtLogBaseAddr.n.u4Len);
     6453        Assert(cbBuf <= _512K);
     6454        AssertLogRelMsgReturn(offBuf < cbBuf,
     6455                              ("Event log tail pointer invalid %#x\n", pThis->EvtLogTailPtr.u64), rcDataError);
     6456    }
     6457
     6458    /* Status register. */
     6459    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->Status.u64);
     6460    AssertRCReturn(rc, rc);
     6461    pThis->Status.u64 &= IOMMU_STATUS_VALID_MASK;
     6462
     6463    /* PPR log head pointer register. */
     6464    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogHeadPtr.u64);
     6465    AssertRCReturn(rc, rc);
     6466    Assert(!pThis->ExtFeat.n.u1PprSup);
     6467
     6468    /* PPR log tail pointer register. */
     6469    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogTailPtr.u64);
     6470    AssertRCReturn(rc, rc);
     6471    Assert(!pThis->ExtFeat.n.u1PprSup);
     6472
     6473    /* Guest Virtual-APIC log head pointer register. */
     6474    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->GALogHeadPtr.u64);
     6475    AssertRCReturn(rc, rc);
     6476    Assert(!pThis->ExtFeat.n.u1GstVirtApicSup);
     6477
     6478    /* Guest Virtual-APIC log tail pointer register. */
     6479    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->GALogTailPtr.u64);
     6480    AssertRCReturn(rc, rc);
     6481    Assert(!pThis->ExtFeat.n.u1GstVirtApicSup);
     6482
     6483    /* PPR log-B head pointer register. */
     6484    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogBHeadPtr.u64);
     6485    AssertRCReturn(rc, rc);
     6486    Assert(!pThis->ExtFeat.n.u1PprSup);
     6487
     6488    /* PPR log-B head pointer register. */
     6489    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogBTailPtr.u64);
     6490    AssertRCReturn(rc, rc);
     6491    Assert(!pThis->ExtFeat.n.u1PprSup);
     6492
     6493    /* Event log-B head pointer register. */
     6494    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->EvtLogBHeadPtr.u64);
     6495    AssertRCReturn(rc, rc);
     6496    Assert(!pThis->ExtFeat.n.u2DualEvtLogSup);
     6497
     6498    /* Event log-B tail pointer register. */
     6499    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->EvtLogBTailPtr.u64);
     6500    AssertRCReturn(rc, rc);
     6501    Assert(!pThis->ExtFeat.n.u2DualEvtLogSup);
     6502
     6503    /* PPR log auto response register. */
     6504    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogAutoResp.u64);
     6505    AssertRCReturn(rc, rc);
     6506    Assert(!pThis->ExtFeat.n.u1PprAutoRespSup);
     6507
     6508    /* PPR log overflow early indicator register. */
     6509    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogOverflowEarly.u64);
     6510    AssertRCReturn(rc, rc);
     6511    Assert(!pThis->ExtFeat.n.u1PprLogOverflowWarn);
     6512
     6513    /* PPR log-B overflow early indicator register. */
     6514    rc = pHlp->pfnSSMGetU64(pSSM, &pThis->PprLogBOverflowEarly.u64);
     6515    AssertRCReturn(rc, rc);
     6516    Assert(!pThis->ExtFeat.n.u1PprLogOverflowWarn);
     6517
     6518    /** @todo Kick the command thread, anything else to do on restore? */
     6519
    64066520    return VERR_NOT_IMPLEMENTED;
    6407 #if 0
    6408 
    6409     pThis->CmdBufHeadPtr.u64);
    6410     pThis->CmdBufTailPtr.u64);
    6411     pThis->EvtLogHeadPtr.u64);
    6412     pThis->EvtLogTailPtr.u64);
    6413 
    6414     pThis->Status.u64);
    6415 
    6416     pThis->PprLogHeadPtr.u64);
    6417     pThis->PprLogTailPtr.u64);
    6418 
    6419     pThis->GALogHeadPtr.u64);
    6420     pThis->GALogTailPtr.u64);
    6421 
    6422     pThis->PprLogBHeadPtr.u64);
    6423     pThis->PprLogBTailPtr.u64);
    6424 
    6425     pThis->EvtLogBHeadPtr.u64);
    6426     pThis->EvtLogBTailPtr.u64);
    6427 
    6428     pThis->PprLogAutoResp.u64);
    6429     pThis->PprLogOverflowEarly.u64);
    6430     pThis->PprLogBOverflowEarly.u64);
    6431 
    6432     return VINF_SUCCESS;
    6433 #endif
    64346521}
    64356522
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