VirtualBox

Changeset 91137 in vbox


Ignore:
Timestamp:
Sep 7, 2021 11:12:01 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146790
Message:

include/VBox/log.h,Devices/Security,pdmtpmifs.h: Remove the startup, shutdown and reset callbacks in the interface and implement directly using the power on and power off the appropriate drivers, add new logging groups, bugref:10075

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/log.h

    r90676 r91137  
    163163    /** System Management Controller Device group. */
    164164    LOG_GROUP_DEV_SMC,
     165    /** Trusted Platform Module Device group. */
     166    LOG_GROUP_DEV_TPM,
    165167    /** VGA Device group. */
    166168    LOG_GROUP_DEV_VGA,
     
    235237    /** TCP socket stream driver group. */
    236238    LOG_GROUP_DRV_TCP,
     239    /** Trusted Platform Module Emulation driver group. */
     240    LOG_GROUP_DRV_TPM_EMU,
     241    /** Trusted Platform Module Host driver group. */
     242    LOG_GROUP_DRV_TPM_HOST,
    237243    /** Async transport driver group */
    238244    LOG_GROUP_DRV_TRANSPORT_ASYNC,
     
    842848    "DEV_SERIAL", \
    843849    "DEV_SMC", \
     850    "DEV_TPM", \
    844851    "DEV_VGA", \
    845852    "DEV_VIRTIO", \
     
    878885    "DRV_SCSIHOST", \
    879886    "DRV_TCP", \
     887    "DRV_TPM_EMU", \
     888    "DRV_TPM_HOST", \
    880889    "DRV_TRANSPORT_ASYNC", \
    881890    "DRV_TUN", \
  • trunk/include/VBox/vmm/pdmtpmifs.h

    r91019 r91137  
    8282{
    8383    /**
    84      * Starts the TPM.
    85      *
    86      * @returns VBox status code.
    87      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    88      */
    89     DECLR3CALLBACKMEMBER(int, pfnStartup, (PPDMITPMCONNECTOR pInterface));
    90 
    91     /**
    92      * Shuts down the TPM.
    93      *
    94      * @returns VBox status code.
    95      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    96      */
    97     DECLR3CALLBACKMEMBER(int, pfnShutdown, (PPDMITPMCONNECTOR pInterface));
    98 
    99     /**
    100      * Resets the TPM.
    101      *
    102      * @returns VBox status code.
    103      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    104      */
    105     DECLR3CALLBACKMEMBER(int, pfnReset, (PPDMITPMCONNECTOR pInterface));
    106 
    107     /**
    10884     * Returns the version of the TPM implemented by the driver below.
    10985     *
  • trunk/src/VBox/Devices/Security/DevTpm.cpp

    r91116 r91137  
    2323*   Header Files                                                                                                                 *
    2424*********************************************************************************************************************************/
    25 #define LOG_GROUP LOG_GROUP_DEFAULT /** @todo DEV_TPM */
     25#define LOG_GROUP LOG_GROUP_DEV_TPM
    2626#include <VBox/vmm/pdmdev.h>
    2727#include <VBox/vmm/pdmtpmifs.h>
     
    15991599
    16001600/**
    1601  * @interface_method_impl{PDMDEVREG,pfnPowerOff}
    1602  */
    1603 static DECLCALLBACK(void) tpmR3PowerOff(PPDMDEVINS pDevIns)
    1604 {
    1605     PDEVTPMCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PDEVTPMCC);
    1606 
    1607     if (pThisCC->pDrvTpm)
    1608     {
    1609         int rc = pThisCC->pDrvTpm->pfnShutdown(pThisCC->pDrvTpm);
    1610         AssertRC(rc);
    1611     }
    1612 }
    1613 
    1614 
    1615 /**
    16161601 * @interface_method_impl{PDMDEVREG,pfnReset}
    16171602 */
     
    16191604{
    16201605    PDEVTPM   pThis   = PDMDEVINS_2_DATA(pDevIns, PDEVTPM);
    1621     PDEVTPMCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PDEVTPMCC);
    16221606
    16231607    pThis->enmState       = DEVTPMSTATE_IDLE;
     
    16331617        pLoc->uRegIntEn  = 0;
    16341618        pLoc->uRegIntSts = 0;
    1635     }
    1636 
    1637     if (pThisCC->pDrvTpm)
    1638     {
    1639         int rc = pThisCC->pDrvTpm->pfnReset(pThisCC->pDrvTpm);
    1640         AssertRC(rc);
    16411619    }
    16421620}
     
    17341712        pThis->fEstablishmentSet = pThisCC->pDrvTpm->pfnGetEstablishedFlag(pThisCC->pDrvTpm);
    17351713        pThis->cbCmdResp         = RT_MIN(pThisCC->pDrvTpm->pfnGetBufferSize(pThisCC->pDrvTpm), TPM_DATA_BUFFER_SIZE_MAX);
    1736 
    1737         /* Startup the TPM here instead of in the power on callback as we can convey errors here to the upper layer. */
    1738         rc = pThisCC->pDrvTpm->pfnStartup(pThisCC->pDrvTpm);
    1739         if (RT_FAILURE(rc))
    1740             return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to startup the TPM"));
    17411714
    17421715        pThis->enmTpmVers = pThisCC->pDrvTpm->pfnGetVersion(pThisCC->pDrvTpm);
     
    18161789    /* .pfnMemSetup = */            NULL,
    18171790    /* .pfnPowerOn = */             NULL,
    1818     /* .pfnReset = */               tpmR3Reset,
     1791    /* .pfnReset = */               NULL,
    18191792    /* .pfnSuspend = */             NULL,
    18201793    /* .pfnResume = */              NULL,
     
    18231796    /* .pfnQueryInterface = */      NULL,
    18241797    /* .pfnInitComplete = */        NULL,
    1825     /* .pfnPowerOff = */            tpmR3PowerOff,
     1798    /* .pfnPowerOff = */            NULL,
    18261799    /* .pfnSoftReset = */           NULL,
    18271800    /* .pfnReserved0 = */           NULL,
  • trunk/src/VBox/Devices/Security/DrvTpmEmu.cpp

    r91093 r91137  
    2020*   Header Files                                                                                                                 *
    2121*********************************************************************************************************************************/
    22 #define LOG_GROUP LOG_GROUP_DRV_TCP /** @todo */
     22#define LOG_GROUP LOG_GROUP_DRV_TPM_EMU
    2323#include <VBox/vmm/pdmdrv.h>
    2424#include <VBox/vmm/pdmtpmifs.h>
     
    629629
    630630
    631 /** @interface_method_impl{PDMITPMCONNECTOR,pfnStartup} */
    632 static DECLCALLBACK(int) drvTpmEmuStartup(PPDMITPMCONNECTOR pInterface)
    633 {
    634     PDRVTPMEMU pThis = RT_FROM_MEMBER(pInterface, DRVTPMEMU, ITpmConnector);
    635 
    636     SWTPMCMDTPMINIT Cmd;
    637     uint32_t u32Resp = 0;
    638 
    639     RT_ZERO(Cmd);
    640     Cmd.u32Flags = 0;
    641     return drvTpmEmuExecCtrlCmdEx(pThis, SWTPMCMD_INIT, &Cmd, sizeof(Cmd), &u32Resp,
    642                                   NULL, 0, RT_MS_10SEC);
    643 }
    644 
    645 
    646 /** @interface_method_impl{PDMITPMCONNECTOR,pfnShutdown} */
    647 static DECLCALLBACK(int) drvTpmEmuShutdown(PPDMITPMCONNECTOR pInterface)
    648 {
    649     PDRVTPMEMU pThis = RT_FROM_MEMBER(pInterface, DRVTPMEMU, ITpmConnector);
    650 
    651     return drvTpmEmuExecCtrlCmdNoPayload(pThis, SWTPMCMD_SHUTDOWN, NULL, 0, RT_MS_10SEC);
    652 }
    653 
    654 
    655 /** @interface_method_impl{PDMITPMCONNECTOR,pfnReset} */
    656 static DECLCALLBACK(int) drvTpmEmuReset(PPDMITPMCONNECTOR pInterface)
    657 {
    658     RT_NOREF(pInterface);
    659     return VINF_SUCCESS;
    660 }
    661 
    662 
    663631/** @interface_method_impl{PDMITPMCONNECTOR,pfnGetVersion} */
    664632static DECLCALLBACK(TPMVERSION) drvTpmEmuGetVersion(PPDMITPMCONNECTOR pInterface)
     
    782750/* -=-=-=-=- PDMDRVREG -=-=-=-=- */
    783751
     752/**
     753 * @interface_method_impl{PDMDRVREG,pfnPowerOn}
     754 */
     755static DECLCALLBACK(void) drvTpmEmuPowerOn(PPDMDRVINS pDrvIns)
     756{
     757    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     758    PDRVTPMEMU pThis = PDMINS_2_DATA(pDrvIns, PDRVTPMEMU);
     759
     760    SWTPMCMDTPMINIT Cmd;
     761    uint32_t u32Resp = 0;
     762
     763    RT_ZERO(Cmd);
     764    Cmd.u32Flags = 0;
     765    int rc = drvTpmEmuExecCtrlCmdEx(pThis, SWTPMCMD_INIT, &Cmd, sizeof(Cmd), &u32Resp,
     766                                    NULL, 0, RT_MS_10SEC);
     767    if (RT_FAILURE(rc))
     768        PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, "Failed to startup the TPM with %Rrc", rc);
     769}
     770
     771
     772/**
     773 * @interface_method_impl{PDMDRVREG,pfnPowerOff}
     774 */
     775static DECLCALLBACK(void) drvTpmEmuPowerOff(PPDMDRVINS pDrvIns)
     776{
     777    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     778    PDRVTPMEMU pThis = PDMINS_2_DATA(pDrvIns, PDRVTPMEMU);
     779
     780    int rc = drvTpmEmuExecCtrlCmdNoPayload(pThis, SWTPMCMD_SHUTDOWN, NULL, 0, RT_MS_10SEC);
     781    if (RT_FAILURE(rc))
     782        PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, "Failed to shutdown the TPM with %Rrc", rc);
     783}
     784
     785
    784786/** @copydoc FNPDMDRVDESTRUCT */
    785787static DECLCALLBACK(void) drvTpmEmuDestruct(PPDMDRVINS pDrvIns)
     
    832834    pDrvIns->IBase.pfnQueryInterface                = drvTpmEmuQueryInterface;
    833835    /* ITpmConnector */
    834     pThis->ITpmConnector.pfnStartup                 = drvTpmEmuStartup;
    835     pThis->ITpmConnector.pfnShutdown                = drvTpmEmuShutdown;
    836     pThis->ITpmConnector.pfnReset                   = drvTpmEmuReset;
    837836    pThis->ITpmConnector.pfnGetVersion              = drvTpmEmuGetVersion;
    838837    pThis->ITpmConnector.pfnGetLocalityMax          = drvTpmEmuGetLocalityMax;
     
    991990    NULL,
    992991    /* pfnPowerOn */
    993     NULL,
     992    drvTpmEmuPowerOn,
    994993    /* pfnReset */
    995994    NULL,
     
    10031002    NULL,
    10041003    /* pfnPowerOff */
    1005     NULL,
     1004    drvTpmEmuPowerOff,
    10061005    /* pfnSoftReset */
    10071006    NULL,
  • trunk/src/VBox/Devices/Security/DrvTpmEmuTpms.cpp

    r91093 r91137  
    2020*   Header Files                                                                                                                 *
    2121*********************************************************************************************************************************/
    22 #define LOG_GROUP LOG_GROUP_DRV_TCP /** @todo */
     22#define LOG_GROUP LOG_GROUP_DRV_TPM_EMU
    2323#include <VBox/vmm/pdmdrv.h>
    2424#include <VBox/vmm/pdmtpmifs.h>
     
    4949*********************************************************************************************************************************/
    5050
     51/** The TPMS saved state version. */
     52#define TPMS_SAVED_STATE_VERSION                        1
     53
    5154
    5255/*********************************************************************************************************************************
     
    7275    /** Currently set locality. */
    7376    uint8_t             bLoc;
     77    /** Flag whether the TPM state was saved in  save state operation (skips writing the state to the NVRAM file). */
     78    bool                fSsmCalled;
    7479
    7580    /** NVRAM file path. */
     
    257262
    258263
    259 /** @interface_method_impl{PDMITPMCONNECTOR,pfnStartup} */
    260 static DECLCALLBACK(int) drvTpmEmuTpmsStartup(PPDMITPMCONNECTOR pInterface)
    261 {
    262     PDRVTPMEMU pThis = RT_FROM_MEMBER(pInterface, DRVTPMEMU, ITpmConnector);
    263 
    264     TPM_RESULT rcTpm = TPMLIB_MainInit();
    265     if (RT_LIKELY(rcTpm == TPM_SUCCESS))
    266         return VINF_SUCCESS;
    267 
    268     LogRel(("DrvTpmEmuTpms#%u: Failed to initialize TPM emulation with %#x\n",
    269             pThis->pDrvIns->iInstance, rcTpm));
    270     return VERR_DEV_IO_ERROR;
    271 }
    272 
    273 
    274 /** @interface_method_impl{PDMITPMCONNECTOR,pfnShutdown} */
    275 static DECLCALLBACK(int) drvTpmEmuTpmsShutdown(PPDMITPMCONNECTOR pInterface)
    276 {
    277     RT_NOREF(pInterface);
    278 
    279     TPMLIB_Terminate();
    280     return VINF_SUCCESS;
    281 }
    282 
    283 
    284 /** @interface_method_impl{PDMITPMCONNECTOR,pfnReset} */
    285 static DECLCALLBACK(int) drvTpmEmuTpmsReset(PPDMITPMCONNECTOR pInterface)
    286 {
    287     PDRVTPMEMU pThis = RT_FROM_MEMBER(pInterface, DRVTPMEMU, ITpmConnector);
    288 
    289     TPMLIB_Terminate();
    290     TPM_RESULT rcTpm = TPMLIB_MainInit();
    291     if (RT_LIKELY(rcTpm == TPM_SUCCESS))
    292         return VINF_SUCCESS;
    293 
    294 
    295     LogRel(("DrvTpmEmuTpms#%u: Failed to reset TPM emulation with %#x\n",
    296             pThis->pDrvIns->iInstance, rcTpm));
    297     return VERR_DEV_IO_ERROR;
    298 }
    299 
    300 
    301264/** @interface_method_impl{PDMITPMCONNECTOR,pfnGetVersion} */
    302265static DECLCALLBACK(TPMVERSION) drvTpmEmuTpmsGetVersion(PPDMITPMCONNECTOR pInterface)
     
    562525
    563526
     527/* -=-=-=-=-=-=-=-=- Saved State -=-=-=-=-=-=-=-=- */
     528
     529/**
     530 * @callback_method_impl{FNSSMDEVSAVEEXEC}
     531 */
     532static DECLCALLBACK(int) drvTpmEmuTpmsSaveExec(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM)
     533{
     534    PDRVTPMEMU pThis = PDMINS_2_DATA(pDrvIns, PDRVTPMEMU);
     535    uint8_t *pbTpmStatePerm = NULL;
     536    uint32_t cbTpmStatePerm = 0;
     537    uint8_t *pbTpmStateVol = NULL;
     538    uint32_t cbTpmStateVol = 0;
     539
     540    TPM_RESULT rcTpm = TPMLIB_GetState(TPMLIB_STATE_PERMANENT, &pbTpmStatePerm, &cbTpmStatePerm);
     541    if (rcTpm == TPM_SUCCESS)
     542        rcTpm = TPMLIB_GetState(TPMLIB_STATE_VOLATILE, &pbTpmStateVol, &cbTpmStateVol);
     543    if (rcTpm == TPM_SUCCESS)
     544    {
     545        SSMR3PutU32(pSSM, cbTpmStatePerm);
     546        int rc = SSMR3PutU32(pSSM, cbTpmStateVol);
     547        AssertRCReturn(rc, rc);
     548
     549        SSMR3PutMem(pSSM, pbTpmStatePerm, cbTpmStatePerm);
     550        SSMR3PutMem(pSSM, pbTpmStateVol, cbTpmStateVol);
     551
     552        free(pbTpmStatePerm);
     553        free(pbTpmStateVol);
     554        rc = SSMR3PutU32(pSSM, UINT32_MAX); /* sanity/terminator */
     555        if (RT_SUCCESS(rc))
     556            pThis->fSsmCalled = true;
     557        return rc;
     558    }
     559
     560    if (pbTpmStatePerm)
     561        free(pbTpmStatePerm);
     562
     563    return VERR_NO_MEMORY;
     564}
     565
     566
     567/**
     568 * @callback_method_impl{FNSSMDEVLOADEXEC}
     569 */
     570static DECLCALLBACK(int) drvTpmEmuTpmsLoadExec(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     571{
     572    PDRVTPMEMU pThis = PDMINS_2_DATA(pDrvIns, PDRVTPMEMU);
     573
     574    Assert(uPass == SSM_PASS_FINAL); RT_NOREF(uPass);
     575    AssertMsgReturn(uVersion == TPMS_SAVED_STATE_VERSION, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION);
     576
     577    uint8_t *pbTpmStatePerm = NULL;
     578    uint32_t cbTpmStatePerm = 0;
     579    uint8_t *pbTpmStateVol = NULL;
     580    uint32_t cbTpmStateVol = 0;
     581
     582    int rc = SSMR3GetU32(pSSM, &cbTpmStatePerm);
     583    AssertRCReturn(rc, rc);
     584
     585    rc = SSMR3GetU32(pSSM, &cbTpmStateVol);
     586    AssertRCReturn(rc, rc);
     587
     588    pbTpmStatePerm = (uint8_t *)RTMemAllocZ(cbTpmStatePerm);
     589    if (pbTpmStatePerm)
     590    {
     591        pbTpmStateVol = (uint8_t *)RTMemAllocZ(cbTpmStateVol);
     592        if (pbTpmStateVol)
     593        {
     594            rc = SSMR3GetMem(pSSM, pbTpmStatePerm, cbTpmStatePerm);
     595            if (RT_SUCCESS(rc))
     596                rc = SSMR3GetMem(pSSM, pbTpmStateVol, cbTpmStateVol);
     597
     598            if (RT_SUCCESS(rc))
     599            {
     600                TPM_RESULT rcTpm = TPMLIB_SetState(TPMLIB_STATE_PERMANENT, pbTpmStatePerm, cbTpmStatePerm);
     601                if (rcTpm == TPM_SUCCESS)
     602                {
     603                    rcTpm = TPMLIB_SetState(TPMLIB_STATE_VOLATILE, pbTpmStateVol, cbTpmStateVol);
     604                    if (rcTpm == TPM_SUCCESS)
     605                    {
     606                        uint32_t u32 = 0;
     607
     608                        /* The marker. */
     609                        rc = SSMR3GetU32(pSSM, &u32);
     610                        AssertRCReturn(rc, rc);
     611                        AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
     612
     613                        pThis->fSsmCalled = true;
     614                    }
     615                    else
     616                        rc = VERR_INVALID_PARAMETER;
     617                }
     618                else
     619                    rc = VERR_INVALID_PARAMETER;
     620            }
     621
     622            RTMemFree(pbTpmStateVol);
     623        }
     624
     625        RTMemFree(pbTpmStatePerm);
     626    }
     627    else
     628        rc = VERR_NO_MEMORY;
     629
     630    return rc;
     631}
     632
     633
     634/**
     635 * @callback_method_impl{FNSSMDEVLOADDONE}
     636 */
     637static DECLCALLBACK(int) drvTpmEmuTpmsLoadDone(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM)
     638{
     639    PDRVTPMEMU    pThis = PDMINS_2_DATA(pDrvIns, PDRVTPMEMU);
     640    RT_NOREF(pSSM);
     641
     642    if (!pThis->fSsmCalled)
     643    {
     644        /* Issue a warning as restoring a saved state without loading the TPM state will most likely cause issues in the guest. */
     645    }
     646
     647    pThis->fSsmCalled = false;
     648    return VINF_SUCCESS;
     649}
     650
     651
    564652/* -=-=-=-=- PDMDRVREG -=-=-=-=- */
     653
     654/**
     655 * @interface_method_impl{PDMDRVREG,pfnPowerOn}
     656 */
     657static DECLCALLBACK(void) drvTpmEmuTpmsPowerOn(PPDMDRVINS pDrvIns)
     658{
     659    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     660
     661    TPM_RESULT rcTpm = TPMLIB_MainInit();
     662    if (RT_UNLIKELY(rcTpm != TPM_SUCCESS))
     663    {
     664        LogRel(("DrvTpmEmuTpms#%u: Failed to initialize TPM emulation with %#x\n",
     665                pDrvIns->iInstance, rcTpm));
     666        PDMDrvHlpVMSetError(pDrvIns, VERR_INVALID_PARAMETER, RT_SRC_POS, "Failed to startup the TPM with %u", rcTpm);
     667    }
     668}
     669
     670
     671/**
     672 * @interface_method_impl{PDMDRVREG,pfnPowerOff}
     673 */
     674static DECLCALLBACK(void) drvTpmEmuTpmsPowerOff(PPDMDRVINS pDrvIns)
     675{
     676    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     677
     678    TPMLIB_Terminate();
     679}
     680
    565681
    566682/** @copydoc FNPDMDRVDESTRUCT */
     
    572688    LogFlow(("%s\n", __FUNCTION__));
    573689
    574     int rc = drvTpmEmuTpmsNvramStore(pThis);
    575     AssertRC(rc);
     690    if (!pThis->fSsmCalled)
     691    {
     692        int rc = drvTpmEmuTpmsNvramStore(pThis);
     693        AssertRC(rc);
     694    }
    576695
    577696    if (pThis->pvNvPermall)
     
    610729    pThis->enmVersion                               = TPMVERSION_UNKNOWN;
    611730    pThis->bLoc                                     = TPM_NO_LOCALITY_SELECTED;
     731    pThis->fSsmCalled                               = false;
    612732    pThis->pvNvPermall                              = NULL;
    613733    pThis->cbNvPermall                              = 0;
     
    618738    pDrvIns->IBase.pfnQueryInterface                = drvTpmEmuTpmsQueryInterface;
    619739    /* ITpmConnector */
    620     pThis->ITpmConnector.pfnStartup                 = drvTpmEmuTpmsStartup;
    621     pThis->ITpmConnector.pfnShutdown                = drvTpmEmuTpmsShutdown;
    622     pThis->ITpmConnector.pfnReset                   = drvTpmEmuTpmsReset;
    623740    pThis->ITpmConnector.pfnGetVersion              = drvTpmEmuTpmsGetVersion;
    624741    pThis->ITpmConnector.pfnGetLocalityMax          = drvTpmEmuGetLocalityMax;
     
    706823                                   N_("Failed to register callbacks with the TPM emulation: %u"),
    707824                                   rcTpm);
     825
     826    rc = PDMDrvHlpSSMRegisterEx(pDrvIns, TPMS_SAVED_STATE_VERSION, 0 /*cbGuess*/,
     827                                NULL /*pfnLivePrep*/, NULL /*pfnLiveExec*/,  NULL /*pfnLiveVote*/,
     828                                NULL /*pfnSavePrep*/, drvTpmEmuTpmsSaveExec, NULL /*pfnSaveDone*/,
     829                                NULL /*pfnLoadPrep*/, drvTpmEmuTpmsLoadExec, drvTpmEmuTpmsLoadDone);
     830    if (RT_FAILURE(rc))
     831        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
     832                                   N_("Failed to register saved state handlers"));
    708833
    709834    /* We can only have one instance of the TPM emulation and require the global variable for the callbacks unfortunately. */
     
    745870    NULL,
    746871    /* pfnPowerOn */
    747     NULL,
     872    drvTpmEmuTpmsPowerOn,
    748873    /* pfnReset */
    749874    NULL,
     
    757882    NULL,
    758883    /* pfnPowerOff */
    759     NULL,
     884    drvTpmEmuTpmsPowerOff,
    760885    /* pfnSoftReset */
    761886    NULL,
  • trunk/src/VBox/Devices/Security/DrvTpmHost.cpp

    r91049 r91137  
    2020*   Header Files                                                                                                                 *
    2121*********************************************************************************************************************************/
    22 #define LOG_GROUP LOG_GROUP_DRV_TCP /** @todo */
     22#define LOG_GROUP LOG_GROUP_DRV_TPM_HOST
    2323#include <VBox/vmm/pdmdrv.h>
    2424#include <VBox/vmm/pdmtpmifs.h>
     
    182182
    183183
    184 /** @interface_method_impl{PDMITPMCONNECTOR,pfnStartup} */
    185 static DECLCALLBACK(int) drvTpmHostStartup(PPDMITPMCONNECTOR pInterface)
    186 {
    187     RT_NOREF(pInterface);
    188     return VINF_SUCCESS;
    189 }
    190 
    191 
    192 /** @interface_method_impl{PDMITPMCONNECTOR,pfnShutdown} */
    193 static DECLCALLBACK(int) drvTpmHostShutdown(PPDMITPMCONNECTOR pInterface)
    194 {
    195     RT_NOREF(pInterface);
    196     return VINF_SUCCESS;
    197 }
    198 
    199 
    200 /** @interface_method_impl{PDMITPMCONNECTOR,pfnReset} */
    201 static DECLCALLBACK(int) drvTpmHostReset(PPDMITPMCONNECTOR pInterface)
    202 {
    203     RT_NOREF(pInterface);
    204     return VINF_SUCCESS;
    205 }
    206 
    207 
    208184/** @interface_method_impl{PDMITPMCONNECTOR,pfnGetVersion} */
    209185static DECLCALLBACK(TPMVERSION) drvTpmHostGetVersion(PPDMITPMCONNECTOR pInterface)
     
    312288    pDrvIns->IBase.pfnQueryInterface                = drvTpmHostQueryInterface;
    313289    /* ITpmConnector */
    314     pThis->ITpmConnector.pfnStartup                 = drvTpmHostStartup;
    315     pThis->ITpmConnector.pfnShutdown                = drvTpmHostShutdown;
    316     pThis->ITpmConnector.pfnReset                   = drvTpmHostReset;
    317290    pThis->ITpmConnector.pfnGetVersion              = drvTpmHostGetVersion;
    318291    pThis->ITpmConnector.pfnGetLocalityMax          = drvTpmHostGetLocalityMax;
Note: See TracChangeset for help on using the changeset viewer.

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