<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br>This is my function :<br>
<br>static spinlock_t xgr_learn_lock = SPIN_LOCK_UNLOCKED;<br>
static int piga_seq_cpt = 1;<br><br>/*<br>* Function called for each systemcall (Hook SELinux avc function)<br>*/<br>int piga_control(u32 ssid, ...., struct av_decision * avd) {<br><br>/*<br>* Here my hypercall work but block my vm with this error :<br>
* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " BUG: scheduling while atomic ... "<br>*/<br><br>spin_lock_bh(&amp;xgr_learn_lock);<br>
&nbsp; if ( in_atomic())<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kvm_hypercall2 ( 6, (unsigned long)2 ,(unsigned long)piga_seq_cpt);<br>
&nbsp; spin_unlock_bh(&amp;xgr_learn_lock);&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;if (piga_on == 1) {<br>
/*<br>* Here my hypercall make a kernel panic with this error:<br>* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " divide error: 0000 [#1] SMP"<br>*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spin_lock_bh(&amp;xgr_learn_lock);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set_current_state(TASK_UNINTERRUPTIBLE);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kvm_hypercall2 ( 6, (unsigned long)2 ,(unsigned long)piga_seq_cpt);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set_current_state(TASK_RUNNING);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spin_lock_bh(&amp;xgr_learn_lock);<br>
}<br>
}<br><div>
<em><strong><font size="4"><font color="#993333"></font></font></strong></em>&nbsp;<BR>
<em><strong><font size="4"><font color="#993333"></font></font></strong></em>&nbsp;<BR>

</div><br><br><br>&gt; Date: Wed, 8 Jun 2011 15:52:33 +0530<br>&gt; Subject: Re: Problems with hypercalls<br>&gt; From: fs.rajat@gmail.com<br>&gt; To: mulyadi.santosa@gmail.com<br>&gt; CC: tricheurs@hotmail.fr; kernelnewbies@kernelnewbies.org<br>&gt; <br>&gt; are you doing 64bit devision on 32 bit arch? If that is the case,<br>&gt; do_div is worth considering.<br>&gt; <br>&gt; On Wed, Jun 8, 2011 at 3:25 PM, Mulyadi Santosa<br>&gt; &lt;mulyadi.santosa@gmail.com&gt; wrote:<br>&gt; &gt; On Tue, Jun 7, 2011 at 15:39, emilie lefebvre &lt;tricheurs@hotmail.fr&gt; wrote:<br>&gt; &gt;&gt; "divide error: 0000 [#1] SMP<br>&gt; &gt;&gt; ...<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff813f8cdd&gt;] panic+0x78/0x137<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff813fcb94&gt;] oops_end+0xe4/0x100<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff8101021b&gt;] die+0x5b/0x90<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff813fc444&gt;] do_trap+0xc4/0x160<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff8100df2f&gt;] do_divide_error+0x8f/0xb0<br>&gt; &gt;&gt; &nbsp;[&lt;ffffffff811f974c&gt;] ? my_function+0xdc/0xe70 "<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Could you have any suggestions ?<br>&gt; &gt;<br>&gt; &gt; Could you show us your code? perhaps by pasting them somewhere?<br>&gt; &gt;<br>&gt; &gt; &gt;From what I guess, sounds like your code did some math (directly or<br>&gt; &gt; indirectly) that fiddle with floating point numbers?<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; regards,<br>&gt; &gt;<br>&gt; &gt; Mulyadi Santosa<br>&gt; &gt; Freelance Linux trainer and consultant<br>&gt; &gt;<br>&gt; &gt; blog: the-hydra.blogspot.com<br>&gt; &gt; training: mulyaditraining.blogspot.com<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Kernelnewbies mailing list<br>&gt; &gt; Kernelnewbies@kernelnewbies.org<br>&gt; &gt; http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br>&gt; &gt;<br>&gt; <br>&gt; _______________________________________________<br>&gt; Kernelnewbies mailing list<br>&gt; Kernelnewbies@kernelnewbies.org<br>&gt; http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br>                                               </body>
</html>