LCOV - code coverage report
Current view: top level - arch/x86/lib - usercopy.c (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 8 0.0 %
Date: 2022-03-28 15:32:58 Functions: 0 1 0.0 %
Branches: 0 8 0.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * User address space access functions.
       3                 :            :  *
       4                 :            :  *  For licencing details see kernel-base/COPYING
       5                 :            :  */
       6                 :            : 
       7                 :            : #include <linux/uaccess.h>
       8                 :            : #include <linux/export.h>
       9                 :            : 
      10                 :            : #include <asm/tlbflush.h>
      11                 :            : 
      12                 :            : /*
      13                 :            :  * We rely on the nested NMI work to allow atomic faults from the NMI path; the
      14                 :            :  * nested NMI paths are careful to preserve CR2.
      15                 :            :  */
      16                 :            : unsigned long
      17                 :          0 : copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
      18                 :            : {
      19                 :          0 :         unsigned long ret;
      20                 :            : 
      21   [ #  #  #  #  :          0 :         if (__range_not_ok(from, n, TASK_SIZE))
             #  #  #  # ]
      22                 :            :                 return n;
      23                 :            : 
      24                 :          0 :         if (!nmi_uaccess_okay())
      25                 :            :                 return n;
      26                 :            : 
      27                 :            :         /*
      28                 :            :          * Even though this function is typically called from NMI/IRQ context
      29                 :            :          * disable pagefaults so that its behaviour is consistent even when
      30                 :            :          * called form other contexts.
      31                 :            :          */
      32                 :          0 :         pagefault_disable();
      33                 :          0 :         ret = __copy_from_user_inatomic(to, from, n);
      34                 :          0 :         pagefault_enable();
      35                 :            : 
      36                 :          0 :         return ret;
      37                 :            : }
      38                 :            : EXPORT_SYMBOL_GPL(copy_from_user_nmi);

Generated by: LCOV version 1.14