VirtualBox

Changeset 55859 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
May 14, 2015 9:20:05 AM (10 years ago)
Author:
vboxsync
Message:

SMAP paranoia.

Location:
trunk/src/VBox/Runtime/r0drv/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h

    r54802 r55859  
    379379#endif
    380380
     381/** @name Macros for preserving EFLAGS.AC on 3.19+/amd64  paranoid.
     382 * The AMD 64 switch_to in macro in arch/x86/include/asm/switch_to.h stopped
     383 * restoring flags.
     384 * @{ */
     385#ifdef CONFIG_X86_SMAP
     386# define IPRT_X86_EFL_AC                    RT_BIT(18)
     387# define IPRT_LINUX_SAVE_EFL_AC()           RTCCUINTREG fSavedEfl = ASMGetFlags();
     388# define IPRT_LINUX_RESTORE_EFL_AC()        ASMSetFlags(fSavedEfl)
     389# define IPRT_LINUX_RESTORE_EFL_ONLY_AC()   ASMSetFlags((ASMGetFlags() & ~IPRT_X86_EFL_AC) | (fSavedEfl & IPRT_X86_EFL_AC))
     390#else
     391# define IPRT_LINUX_SAVE_EFL_AC()           do { } while (0)
     392# define IPRT_LINUX_RESTORE_EFL_AC()        do { } while (0)
     393# define IPRT_LINUX_RESTORE_EFL_ONLY_AC()   do { } while (0)
     394#endif
     395/** @} */
     396
    381397/*
    382398 * There are some conflicting defines in iprt/param.h, sort them out here.
  • trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c

    r48935 r55859  
    200200{
    201201#ifdef CONFIG_PREEMPT
     202    IPRT_LINUX_SAVE_EFL_AC(); /* paranoia */
    202203    AssertPtr(pState);
    203204    Assert(pState->u32Reserved == 42);
    204205    RT_ASSERT_PREEMPT_CPUID_RESTORE(pState);
    205206    preempt_enable();
     207    IPRT_LINUX_RESTORE_EFL_ONLY_AC();  /* paranoia */
    206208
    207209#else
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