VirtualBox

Changeset 54872 in vbox


Ignore:
Timestamp:
Mar 20, 2015 2:16:39 PM (10 years ago)
Author:
vboxsync
Message:

threadctxhooks-r0drv-linux.c: Looks like 3.19 stopped restoring kernel RFLAGS during context switches, so we need to handle RFLAGS.AC our selves.

File:
1 edited

Legend:

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

    r54866 r54872  
    55
    66/*
    7  * Copyright (C) 2013 Oracle Corporation
     7 * Copyright (C) 2013-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7272    /** The reference count for this object. */
    7373    uint32_t volatile           cRefs;
     74#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
     75    /** Starting with 3.1.19, the linux kernel doesn't restore kernel RFLAGS during
     76     * task switch, so we have to do that ourselves. (x86 code is not affected.) */
     77    RTCCUINTREG                 fSavedRFlags;
     78#endif
    7479} RTTHREADCTXINT, *PRTTHREADCTXINT;
    7580
     
    101106
    102107#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    103     clac();
    104108    ASMSetFlags(fSavedEFlags);
     109# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
     110    pThis->fSavedRFlags = fSavedEFlags;
     111# endif
    105112#endif
    106113}
     
    128135    Assert(pThis->fRegistered);
    129136
    130 
    131137    pThis->pfnThreadCtxHook(RTTHREADCTXEVENT_RESUMED, pThis->pvUser);
    132138
    133139#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    134     clac();
     140# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
     141    fSavedEFlags &= ~RT_BIT_64(18) /*X86_EFL_AC*/;
     142    fSavedEFlags |= pThis->fSavedRFlags & RT_BIT_64(18) /*X86_EFL_AC*/;
     143# endif
    135144    ASMSetFlags(fSavedEFlags);
    136145#endif
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