LCOV - code coverage report
Current view: top level - arch/x86/include/asm - sync_core.h (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 4 0.0 %
Date: 2022-03-28 13:20:08 Functions: 0 1 0.0 %
Branches: 0 7 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: GPL-2.0 */
       2                 :            : #ifndef _ASM_X86_SYNC_CORE_H
       3                 :            : #define _ASM_X86_SYNC_CORE_H
       4                 :            : 
       5                 :            : #include <linux/preempt.h>
       6                 :            : #include <asm/processor.h>
       7                 :            : #include <asm/cpufeature.h>
       8                 :            : 
       9                 :            : /*
      10                 :            :  * Ensure that a core serializing instruction is issued before returning
      11                 :            :  * to user-mode. x86 implements return to user-space through sysexit,
      12                 :            :  * sysrel, and sysretq, which are not core serializing.
      13                 :            :  */
      14                 :          0 : static inline void sync_core_before_usermode(void)
      15                 :            : {
      16                 :            :         /* With PTI, we unconditionally serialize before running user code. */
      17      [ #  #  # ]:          0 :         if (static_cpu_has(X86_FEATURE_PTI))
      18                 :            :                 return;
      19                 :            :         /*
      20                 :            :          * Return from interrupt and NMI is done through iret, which is core
      21                 :            :          * serializing.
      22                 :            :          */
      23   [ -  -  -  - ]:          0 :         if (in_irq() || in_nmi())
      24                 :            :                 return;
      25                 :          0 :         sync_core();
      26                 :            : }
      27                 :            : 
      28                 :            : #endif /* _ASM_X86_SYNC_CORE_H */

Generated by: LCOV version 1.14