VirtualBox

Ignore:
Timestamp:
Jan 16, 2025 12:21:46 AM (5 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166942
Message:

SUPLib: Implemented fallback for SUPR3QueryMicrocodeRev in driverless mode on darwin (todo: linux). jiraref:VBP-947

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r106061 r107800  
    17851785
    17861786
    1787 SUPR3DECL(int) SUPR3QueryMicrocodeRev(uint32_t *uMicrocodeRev)
    1788 {
    1789     AssertPtrReturn(uMicrocodeRev, VERR_INVALID_POINTER);
    1790 
    1791     *uMicrocodeRev = 0;
     1787SUPR3DECL(int) SUPR3QueryMicrocodeRev(uint32_t *puMicrocodeRev)
     1788{
     1789    AssertPtrReturn(puMicrocodeRev, VERR_INVALID_POINTER);
     1790
     1791    *puMicrocodeRev = 0;
    17921792
    17931793    int rc;
     
    18101810            rc = Req.Hdr.rc;
    18111811            if (RT_SUCCESS(rc))
    1812                 *uMicrocodeRev = Req.u.Out.MicrocodeRev;
     1812                *puMicrocodeRev = Req.u.Out.MicrocodeRev;
    18131813        }
    18141814    }
    18151815    /*
    1816      * Just fail the call in driverless mode.
     1816     * Just fail the call in driverless mode if there is a host specific way of
     1817     * getting the information.
    18171818     */
    18181819    else
     1820#if defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64)
     1821        rc = suplibOsQueryMicrocodeRev(puMicrocodeRev);
     1822#else
    18191823        rc = VERR_SUP_DRIVERLESS;
     1824#endif
    18201825    return rc;
    18211826}
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r106061 r107800  
    381381DECLHIDDEN(int)     suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages);
    382382DECLHIDDEN(int)     suplibOsQueryVTxSupported(const char **ppszWhy);
     383DECLHIDDEN(int)     suplibOsQueryMicrocodeRev(uint32_t *puMicrocodeRev);
    383384DECLHIDDEN(bool)    suplibOsIsNemSupportedWhenNoVtxOrAmdV(void);
    384385
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp

    r106061 r107800  
    335335
    336336
     337# ifdef RT_ARCH_AMD64
     338DECLHIDDEN(int)  suplibOsQueryMicrocodeRev(uint32_t *puMicrocodeRev)
     339{
     340    size_t cb = sizeof(*puMicrocodeRev);
     341    int rc = sysctlbyname("machdep.cpu.microcode_version", puMicrocodeRev, &cb, NULL, 0);
     342    if (!rc)
     343    {
     344        if (cb == sizeof(uint32_t))
     345            return VINF_SUCCESS;
     346        AssertMsgFailed(("cb=%d\n", cb));
     347        rc = VERR_INTERNAL_ERROR_3;
     348    }
     349    else
     350        rc = RTErrConvertFromErrno(errno);
     351    *puMicrocodeRev = 0;
     352    return rc;
     353}
     354# endif
     355
     356
    337357DECLHIDDEN(bool) suplibOsIsNemSupportedWhenNoVtxOrAmdV(void)
    338358{
     
    348368# else
    349369    return false;
    350 #endif
     370# endif
    351371}
    352372
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