VirtualBox

Ignore:
Timestamp:
Aug 11, 2015 2:39:19 PM (9 years ago)
Author:
vboxsync
Message:

iprt/r0drv/linux: Preserve EFLAGS/AC where ever it may possibly be thought to change when calling kernel code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c

    r56955 r57276  
    167167RTDECL(int) RTThreadCtxHookCreate(PRTTHREADCTXHOOK phCtxHook, uint32_t fFlags, PFNRTTHREADCTXHOOK pfnCallback, void *pvUser)
    168168{
     169    IPRT_LINUX_SAVE_EFL_AC();
     170
    169171    /*
    170172     * Validate input.
     
    181183    pThis = (PRTTHREADCTXHOOKINT)RTMemAllocZ(sizeof(*pThis));
    182184    if (RT_UNLIKELY(!pThis))
     185    {
     186        IPRT_LINUX_RESTORE_EFL_AC();
    183187        return VERR_NO_MEMORY;
     188    }
    184189    pThis->u32Magic     = RTTHREADCTXHOOKINT_MAGIC;
    185190    pThis->hOwner       = RTThreadNativeSelf();
     
    196201
    197202    *phCtxHook = pThis;
     203    IPRT_LINUX_RESTORE_EFL_AC();
    198204    return VINF_SUCCESS;
    199205}
     
    203209RTDECL(int ) RTThreadCtxHookDestroy(RTTHREADCTXHOOK hCtxHook)
    204210{
     211    IPRT_LINUX_SAVE_EFL_AC();
     212
    205213    /*
    206214     * Validate input.
     
    232240    RTMemFree(pThis);
    233241
     242    IPRT_LINUX_RESTORE_EFL_AC();
    234243    return VINF_SUCCESS;
    235244}
     
    250259    if (!pThis->fEnabled)
    251260    {
     261        IPRT_LINUX_SAVE_EFL_AC();
    252262        Assert(pThis->PreemptOps.sched_out == rtThreadCtxHooksLnxSchedOut);
    253263        Assert(pThis->PreemptOps.sched_in == rtThreadCtxHooksLnxSchedIn);
     
    260270        preempt_notifier_register(&pThis->LnxPreemptNotifier);
    261271        preempt_enable();
     272
     273        IPRT_LINUX_RESTORE_EFL_AC();
    262274    }
    263275
     
    284296         */
    285297        if (pThis->fEnabled)
     298        {
     299            IPRT_LINUX_SAVE_EFL_AC();
    286300            rtThreadCtxHookDisable(pThis);
     301            IPRT_LINUX_RESTORE_EFL_AC();
     302        }
    287303    }
    288304    return VINF_SUCCESS;
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