title: SSE register return with SSE disabled error
body: <p>I have written the following command for kernel level thread:</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;linux/module.h&gt;
  #include &lt;linux/times.h&gt;
  #include &lt;linux/kthread.h&gt;
  #include &lt;linux/kernel.h&gt;
  #include &lt;linux/delay.h&gt;
  #include &lt;linux/init.h&gt;
  #include &lt;linux/time.h&gt;
  
  static struct task_struct *thread_st;
  // Function executed by kernel thread
  static int thread_fn(void *unused)
  {
  allow_signal(SIGKILL);
  while (!kthread_should_stop())
  {
  printk(KERN_INFO "Thread is Running\n");
  ssleep(3);
  if(signal_pending(thread_st))
  break;
  }
  printk(KERN_INFO "Thread has Stopped\n");
  do_exit(0);
  return 0;
  }
  // Module Initialization
  static int __init init_thread(void)
  {
  struct timeval t0,t1;
  double temp;
  //for calculating time take to create a thread
  do_gettimeofday(&amp;t0);
  printk(KERN_INFO "Creating Thread\n");
  thread_st = kthread_run(thread_fn, NULL, "mythread");
  do_gettimeofday(&amp;t1);
  if (thread_st){
  temp = ((t1.tv_sec - t0.tv_sec)*1000000 + (t1.tv_usec - t0.tv_usec));
  printk(KERN_INFO "Thread Created successfully \n Time Taken %.2f \n",temp);
  }
  else
  printk(KERN_ERR "Thread creation failed\n");
  return 0;
  }
  // Module Exit
  static void __exit cleanup_thread(void)
  {
  printk(KERN_INFO "Cleaning Up\n");
  if (thread_st)
  {
  kthread_stop(thread_st);
  printk(KERN_INFO "Thread stopped");
  }
  }
  MODULE_LICENSE("GPL");
  MODULE_AUTHOR("OSHO AGYEYA");
  MODULE_DESCRIPTION("kernel.threads");
  module_init(init_thread);
  module_exit(cleanup_thread);
  </code></pre>
  
  <p>Makefile is as follows:</p>
  
  <pre><code>obj-m += kt.o
  
  all:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
  
  clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  </code></pre>
  
  <p>I am getting this error while using make command:</p>
  
  <pre><code>make -C /lib/modules/4.4.0-31-generic/build M=/home/osho/Desktop/15BCE1326_OSHO modules
  make[1]: Entering directory '/usr/src/linux-headers-4.4.0-31-generic'
    CC [M]  /home/osho/Desktop/15BCE1326_OSHO/kernelthread.o
  /home/osho/Desktop/15BCE1326_OSHO/kernelthread.c: In function ‘init_thread’:
  /home/osho/Desktop/15BCE1326_OSHO/kernelthread.c:44:1: error: SSE register return with SSE disabled
   printk(KERN_INFO "Thread Created successfully \n Time Taken %.2f \n",temp);
   ^
  scripts/Makefile.build:264: recipe for target '/home/osho/Desktop/15BCE1326_OSHO/kernelthread.o' failed
  make[2]: *** [/home/osho/Desktop/15BCE1326_OSHO/kernelthread.o] Error 1
  Makefile:1403: recipe for target '_module_/home/osho/Desktop/15BCE1326_OSHO' failed
  make[1]: *** [_module_/home/osho/Desktop/15BCE1326_OSHO] Error 2
  make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-31-generic'
  Makefile:4: recipe for target 'all' failed
  make: *** [all] Error 2
  </code></pre>
  
  <p>I have tried all the possible ways but this error doesn't seem to go. What to do about it?</p>