VirtualBox

Changeset 87373 in vbox


Ignore:
Timestamp:
Jan 22, 2021 3:08:37 PM (4 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0.cpp: Applied function pointer array workaround for annoying clang compilers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r87372 r87373  
    720720static void hmR0SvmUpdateVmRunFunction(PVMCPUCC pVCpu)
    721721{
    722     static const PFNHMSVMVMRUN s_apfnHmR0SvmVmRunFunctions[] =
    723     {
    724         hmR0SvmVmRun_SansXcr0_SansIbpbEntry_SansIbpbExit,
    725         hmR0SvmVmRun_WithXcr0_SansIbpbEntry_SansIbpbExit,
    726         hmR0SvmVmRun_SansXcr0_WithIbpbEntry_SansIbpbExit,
    727         hmR0SvmVmRun_WithXcr0_WithIbpbEntry_SansIbpbExit,
    728         hmR0SvmVmRun_SansXcr0_SansIbpbEntry_WithIbpbExit,
    729         hmR0SvmVmRun_WithXcr0_SansIbpbEntry_WithIbpbExit,
    730         hmR0SvmVmRun_SansXcr0_WithIbpbEntry_WithIbpbExit,
    731         hmR0SvmVmRun_WithXcr0_WithIbpbEntry_WithIbpbExit,
     722    static const struct CLANGWORKAROUND { PFNHMSVMVMRUN pfn; } s_aHmR0SvmVmRunFunctions[] =
     723    {
     724        { hmR0SvmVmRun_SansXcr0_SansIbpbEntry_SansIbpbExit },
     725        { hmR0SvmVmRun_WithXcr0_SansIbpbEntry_SansIbpbExit },
     726        { hmR0SvmVmRun_SansXcr0_WithIbpbEntry_SansIbpbExit },
     727        { hmR0SvmVmRun_WithXcr0_WithIbpbEntry_SansIbpbExit },
     728        { hmR0SvmVmRun_SansXcr0_SansIbpbEntry_WithIbpbExit },
     729        { hmR0SvmVmRun_WithXcr0_SansIbpbEntry_WithIbpbExit },
     730        { hmR0SvmVmRun_SansXcr0_WithIbpbEntry_WithIbpbExit },
     731        { hmR0SvmVmRun_WithXcr0_WithIbpbEntry_WithIbpbExit },
    732732    };
    733733    uintptr_t const idx = (pVCpu->hm.s.fLoadSaveGuestXcr0                             ? 1 : 0)
    734734                        | (pVCpu->cpum.GstCtx.fWorldSwitcher & CPUMCTX_WSF_IBPB_ENTRY ? 2 : 0)
    735735                        | (pVCpu->cpum.GstCtx.fWorldSwitcher & CPUMCTX_WSF_IBPB_EXIT  ? 4 : 0);
    736     PFNHMSVMVMRUN const pfnVMRun = s_apfnHmR0SvmVmRunFunctions[idx];
     736    PFNHMSVMVMRUN const pfnVMRun = s_aHmR0SvmVmRunFunctions[idx].pfn;
    737737    if (pVCpu->hm.s.svm.pfnVMRun != pfnVMRun)
    738738        pVCpu->hm.s.svm.pfnVMRun = pfnVMRun;
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