VirtualBox

Changeset 106955 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 12, 2024 10:24:17 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165882
Message:

Main/SystemTableBuilder: Some fixes to the generated ACPI tables, MMIO ranges which are below 4GiB can be described in a 32 bit fixed memory range descriptor, set the maximum PCI bus number to what the ECAM region can describe, the TPM2 table holds the address to the CRB control request register and not the start of the TPM MMIO region, bugref:10732

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/SystemTableBuilder.cpp

    r106603 r106955  
    4242
    4343/*********************************************************************************************************************************
     44*   Defined Constants And Macros                                                                                                 *
     45*********************************************************************************************************************************/
     46
     47/** Locality CRB request register. */
     48#define TPM_CRB_LOCALITY_REG_CTRL_REQ                        0x40
     49
     50
     51/*********************************************************************************************************************************
    4452*   Structures and Typedefs                                                                                                      *
    4553*********************************************************************************************************************************/
     
    8997
    9098    RTAcpiResourceReset(hAcpiRes);
    91     int vrc = RTAcpiResourceAddQWordMemoryRange(hAcpiRes, kAcpiResMemRangeCacheability_NonCacheable, kAcpiResMemType_Memory, true /*fRw*/,
     99    int vrc;
     100    if (u64AddrBase + cbMmio <= _4G)
     101        vrc = RTAcpiResourceAdd32BitFixedMemoryRange(hAcpiRes, u64AddrBase, cbMmio, true /*fRw*/);
     102    else
     103        vrc = RTAcpiResourceAddQWordMemoryRange(hAcpiRes, kAcpiResMemRangeCacheability_NonCacheable, kAcpiResMemType_Memory, true /*fRw*/,
    92104                                                fAddrSpace, u64AddrBase, u64AddrBase + cbMmio - 1, 0 /*u64OffTrans*/, 0 /*u64Granularity*/,
    93105                                                cbMmio);
     
    235247    ACPIRSDP Xsdp; RT_ZERO(Xsdp);
    236248
    237     /* ACPI 1.0 part (RSDT) */
     249    /* ACPI 1.0 part (RSDP) */
    238250    memcpy(Xsdp.abSignature, "RSD PTR ", 8);
    239251    memcpy(Xsdp.abOemId,     "ORCLVB", 6);
     
    242254    Xsdp.bChkSum      = RTAcpiChecksumGenerate(&Xsdp, RT_OFFSETOF(ACPIRSDP, cbRsdp));
    243255
    244     /* ACPI 2.0 part (XSDT) */
     256    /* ACPI 2.0 part (XSDP) */
    245257    Xsdp.cbRsdp       = RT_H2LE_U32(sizeof(ACPIRSDP));
    246258    Xsdp.u64AddrXsdt  = RT_H2LE_U64(GCPhysXsdt);
     
    348360
    349361    m_GCPhysPciMmioEcam = GCPhysMmioEcam; /* Need that for MCFG later. */
     362    m_bPciBusMax        = 15; /** @todo Make parameter. */
    350363
    351364    RTAcpiTblDeviceStartF(m_hAcpiDsdt, "%s%RX32", pSysTblDev->pszAcpiName, 0);
     
    370383
    371384    RTAcpiResourceReset(m_hAcpiRes);
    372     int vrc = RTAcpiResourceAddWordBusNumber(m_hAcpiRes, fAddrSpace, 0 /*u16BusMin*/, 0xff /*u16BusMax*/,
    373                                              0 /*u16OffTrans*/, 0 /*u16Granularity*/, 256 /*u16Length*/);
     385    int vrc = RTAcpiResourceAddWordBusNumber(m_hAcpiRes, fAddrSpace, 0 /*u16BusMin*/, m_bPciBusMax /*u16BusMax*/,
     386                                             0 /*u16OffTrans*/, 0 /*u16Granularity*/, m_bPciBusMax + 1 /*u16Length*/);
    374387    AssertRCReturn(vrc, vrc);
    375388
     
    531544    pAlloc->u16PciSegGrpNr  = 0;
    532545    pAlloc->bPciBusFirst    = 0;
    533     pAlloc->bPciBusLast     = 0xff;
     546    pAlloc->bPciBusLast     = m_bPciBusMax;
    534547
    535548    /* Finalize the MADT. */
     
    642655
    643656    Tpm2.u32StartMethod       = m_fCrb ? ACPITBL_TPM20_START_METHOD_CRB : ACPITBL_TPM20_START_METHOD_TIS12;
    644     Tpm2.u64BaseAddrCrbOrFifo = m_GCPhysTpm20Mmio;
     657    Tpm2.u64BaseAddrCrbOrFifo = m_fCrb ? m_GCPhysTpm20Mmio + TPM_CRB_LOCALITY_REG_CTRL_REQ : m_GCPhysTpm20Mmio;
    645658    Tpm2.u16PlatCls           = ACPITBL_TPM20_PLAT_CLS_CLIENT;
    646659
     
    679692    RTAcpiTblStringAppend(m_hAcpiDsdt, "TPM 2.0 Device");
    680693
     694    RTAcpiTblNameAppend(m_hAcpiDsdt, "_UID");
     695    RTAcpiTblIntegerAppend(m_hAcpiDsdt, 0);
     696
    681697    RTAcpiTblNameAppend(m_hAcpiDsdt, "_CRS");
    682698    int vrc = systemTableAcpiMmioDevResource(m_hAcpiDsdt, m_hAcpiRes, GCPhysMmioStart, cbMmio, u32Irq + GIC_INTID_RANGE_SPI_START);
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