title: Why do i get "Unhandled fault: imprecise external abort" while trying to access shared memory from my kernel module?
body: <p>I have this in a kernel module:</p>
  
  <pre><code>/*global scope declared*/ 
  static int array[10]={1,2,3,4,5,6,7,8,9,10};
  </code></pre>
  
  <p>and I have functions for open close read and write works perfectly, i want to share the <code>array[8]</code> with the user space application in the bottom of this page.</p>
  
  <p><strong>in the kernel module:</strong></p>
  
  <pre><code>static int *my_mmap (struct file *filep, struct vm_area_struct *vma ) {
  
      if (remap_pfn_range(vma,
                  vma-&gt;vm_start,
                  virt_to_phys(array)&gt;&gt; PAGE_SHIFT,
                  10,
                  vma-&gt;vm_page_prot) &lt; 0) {
          printk("remap_pfn_range failed\n");
          return -EIO;
      }
  
  
      return 0;
  </code></pre>
  
  <p><strong>the application in user-space's source code:</strong></p>
  
  <pre><code>#define LEN (64*1024)
  /* prototype for thread routine */
  
  #define FILE_PATH "/dev/my_module"
  
  
  int main() 
  {
      int i=0;
      int fd = open(FILE_PATH,O_RDWR);    
      int* vadr = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
  
      for (i=0;i&lt;10;++i){
  
          printf("%d",*(vadr+i));
      }
  
      return 0;
  }
  </code></pre>