VirtualBox

Ignore:
Timestamp:
Apr 10, 2020 9:33:38 AM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Bits.

File:
1 edited

Legend:

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

    r83649 r83665  
    20512051}
    20522052
     2053
    20532054/**
    20542055 * Writes the Device Table Base Address Register.
     
    23852386    Assert(!(off & (cb - 1)));
    23862387
    2387     PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU);
    23882388    uint64_t const uValue = cb == 8 ? *(uint64_t const *)pv : *(uint32_t const *)pv;
    23892389    return iommuAmdWriteRegister(pDevIns, off, cb, uValue);
     
    24292429    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
    24302430    PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);
     2431
     2432    pThis->DevTabBaseAddr.u64    = 0;
     2433    pThis->CmdBufBaseAddr.u64    = 0;
     2434    pThis->EvtLogBaseAddr.u64    = 0;
     2435    pThis->Ctrl.u64              = 0;
     2436    pThis->ExclRangeBaseAddr.u64 = 0;
     2437    pThis->ExclRangeLimit.u64    = 0;
     2438    pThis->ExtFeat.n.u1PrefetchSup           = 0;
     2439    pThis->ExtFeat.n.u1PprSup                = 0;
     2440    pThis->ExtFeat.n.u1X2ApicSup             = 0;
     2441    pThis->ExtFeat.n.u1NoExecuteSup          = 0;
     2442    pThis->ExtFeat.n.u1GstTranslateSup       = 0;
     2443    pThis->ExtFeat.n.u1InvAllSup             = 0;
     2444    pThis->ExtFeat.n.u1GstVirtApicSup        = 0;
     2445    pThis->ExtFeat.n.u1HwErrorSup            = 0;
     2446    pThis->ExtFeat.n.u1PerfCounterSup        = 0;
     2447    pThis->ExtFeat.n.u2HostAddrTranslateSize = 0;   /* Requires GstTranslateSup. */
     2448    pThis->ExtFeat.n.u2GstAddrTranslateSize  = 0;   /* Requires GstTranslateSup. */
     2449    pThis->ExtFeat.n.u2GstCr3RootTblLevel    = 0;   /* Requires GstTranslateSup. */
     2450    pThis->ExtFeat.n.u2SmiFilterSup          = 0;
     2451    pThis->ExtFeat.n.u3SmiFilterCount        = 0;
     2452    pThis->ExtFeat.n.u3GstVirtApicModeSup    = 0;   /* Requires GstVirtApicSup */
     2453    pThis->ExtFeat.n.u2DualPprLogSup         = 0;
     2454    pThis->ExtFeat.n.u2DualEvtLogSup         = 0;
     2455    pThis->ExtFeat.n.u5MaxPasidSup           = 0;   /* Requires GstTranslateSup. */
     2456    pThis->ExtFeat.n.u1UserSupervisorSup     = 0;
     2457    pThis->ExtFeat.n.u2DevTabSegSup          = 0;
     2458    pThis->ExtFeat.n.u1PprLogOverflowWarn    = 0;
     2459    pThis->ExtFeat.n.u1PprAutoRespSup        = 0;
     2460    pThis->ExtFeat.n.u2MarcSup               = 0;
     2461    pThis->ExtFeat.n.u1BlockStopMarkSup      = 0;
     2462    pThis->ExtFeat.n.u1PerfOptSup            = 0;
     2463    pThis->ExtFeat.n.u1MsiCapMmioSup         = 1;
     2464    pThis->ExtFeat.n.u1GstIoSup              = 0;
     2465    pThis->ExtFeat.n.u1HostAccessSup         = 0;
     2466    pThis->ExtFeat.n.u1EnhancedPprSup        = 0;
     2467    pThis->ExtFeat.n.u1AttrForwardSup        = 0;
     2468    pThis->ExtFeat.n.u1HostDirtySup          = 0;
     2469    pThis->ExtFeat.n.u1InvIoTlbTypeSup       = 0;
     2470    pThis->ExtFeat.n.u1GstUpdateDisSup       = 0;
     2471    pThis->ExtFeat.n.u1ForcePhysDstSup       = 0;
     2472    pThis->PprLogBaseAddr.u64                = 0;
     2473    pThis->HwEvtHi.u64                       = 0;
     2474    pThis->HwEvtLo                           = 0;
     2475    pThis->HwEvtStatus.u64                   = 0;
     2476    pThis->GALogBaseAddr.n.u40GALogBase      = 0;
     2477    pThis->GALogBaseAddr.n.u4GALogLen        = 8;
     2478    pThis->GALogTailAddr.u64                 = 0;
     2479    pThis->PprLogBBaseAddr.n.u40PprLogBase   = 0;
     2480    pThis->PprLogBBaseAddr.n.u4PprLogLen     = 8;
     2481    pThis->EvtLogBBaseAddr.n.u40EvtBase      = 0;
     2482    pThis->EvtLogBBaseAddr.n.u4EvtLen        = 8;
     2483    memset(&pThis->DevTabSeg[0], 0, sizeof(pThis->DevTabSeg));
     2484    pThis->DevSpecificFeat.u64               = 0;
     2485    pThis->DevSpecificCtrl.u64               = 0;
     2486    pThis->DevSpecificStatus.u64             = 0;
     2487    pThis->MsiMiscInfo.u64                   = 0;
     2488    pThis->MsiCapHdr.u32                     = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_CAP_HDR);
     2489    pThis->MsiAddr.u64                       = 0;
     2490    pThis->MsiData.u32                       = 0;
     2491    pThis->MsiMapCapHdr.u32                  = 0;
     2492    pThis->PerfOptCtrl.u32                   = 0;
     2493    pThis->XtGenIntrCtrl.u64                 = 0;
     2494    pThis->XtPprIntrCtrl.u64                 = 0;
     2495    pThis->XtGALogIntrCtrl.u64               = 0;
     2496    memset(&pThis->aMarcApers[0], 0, sizeof(pThis->aMarcApers));
     2497    pThis->RsvdReg                           = 0;
     2498    pThis->CmdBufHeadPtr.u64                 = 0;
     2499    pThis->CmdBufTailPtr.u64                 = 0;
     2500    pThis->EvtLogHeadPtr.u64                 = 0;
     2501    pThis->EvtLogTailPtr.u64                 = 0;
     2502    pThis->Status.u64                        = 0;
     2503    pThis->PprLogHeadPtr.u64                 = 0;
     2504    pThis->PprLogTailPtr.u64                 = 0;
     2505    pThis->GALogHeadPtr.u64                  = 0;
     2506    pThis->GALogTailPtr.u64                  = 0;
     2507    pThis->PprLogBHeadPtr.u64                = 0;
     2508    pThis->PprLogBTailPtr.u64                = 0;
     2509    pThis->EvtLogBHeadPtr.u64                = 0;
     2510    pThis->EvtLogBTailPtr.u64                = 0;
     2511    pThis->PprLogAutoResp.u64                = 0;
     2512    pThis->PprLogOverflowEarly.u64           = 0;
     2513    pThis->PprLogBOverflowEarly.u64          = 0;
    24312514
    24322515    PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_LO, 0);
     
    30843167
    30853168    /*
    3086      * Initialize the PCI configuration space.
     3169     * Initialize read-only PCI configuration space.
    30873170     */
    30883171    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     
    31453228    MsiReg.cMsiVectors    = 1;
    31463229    MsiReg.iMsiCapOffset  = IOMMU_PCI_OFF_MSI_CAP_HDR;
    3147     MsiReg.iMsiNextOffset = IOMMU_PCI_OFF_MSI_MAP_CAP_HDR;
     3230    MsiReg.iMsiNextOffset = 0; /* IOMMU_PCI_OFF_MSI_MAP_CAP_HDR */
    31483231    rc = PDMDevHlpPCIRegisterMsi(pDevIns, &MsiReg);
    31493232    AssertRCReturn(rc, rc);
     3233    /* This is later copied to its MMIO shadow register (MsiCapHdr), see iommuAmdR3Init. */
    31503234#endif
     3235
     3236    /* These read-write PCI config registers are initialized in iommuAmdR3Init. */
    31513237#if 0
    31523238    /* MSI Address Lo. */
     
    31563242    /* MSI Data. */
    31573243    PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA, 0);            /* RW - MSI data. */
    3158 #else
    3159     /* These are initialized in iommuAmdInit. */
    31603244#endif
    3161     /** @todo IOMMU: I don't know if we can support this, disable later if required. */
     3245
     3246#if 0
     3247    /** @todo IOMMU: I don't know if we need to support this, enable later if
     3248     *        required. */
    31623249    /* MSI Mapping Capability Header register. */
    31633250    PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_MAP_CAP_HDR,
     
    31673254                      | RT_BF_MAKE(IOMMU_BF_MSI_MAP_CAPHDR_FIXED,    0x1)       /* RO - MSI mapping range is fixed */
    31683255                      | RT_BF_MAKE(IOMMU_BF_MSI_MAP_CAPHDR_CAP_TYPE, 0x15));    /* RO - MSI mapping capability */
     3256    /* When implementing don't forget to copy this to its MMIO shadow register (MsiMapCapHdr) in iommuAmdR3Init. */
     3257#endif
    31693258
    31703259    /*
    31713260     * Initialize parts of the IOMMU state as it would during reset.
     3261     * Must be called -after- initializing PCI config. space registers.
    31723262     */
    31733263    iommuAmdR3Init(pDevIns);
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