<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>
* " BUG: scheduling while atomic ... "<br>*/<br><br>spin_lock_bh(&xgr_learn_lock);<br>
if ( in_atomic())<br>
kvm_hypercall2 ( 6, (unsigned long)2 ,(unsigned long)piga_seq_cpt);<br>
spin_unlock_bh(&xgr_learn_lock); <br>
<br>
if (piga_on == 1) {<br>
/*<br>* Here my hypercall make a kernel panic with this error:<br>* " divide error: 0000 [#1] SMP"<br>*/<br> spin_lock_bh(&xgr_learn_lock);<br>
set_current_state(TASK_UNINTERRUPTIBLE);<br>
kvm_hypercall2 ( 6, (unsigned long)2 ,(unsigned long)piga_seq_cpt);<br>
set_current_state(TASK_RUNNING);<br>
spin_lock_bh(&xgr_learn_lock);<br>
}<br>
}<br><div>
<em><strong><font size="4"><font color="#993333"></font></font></strong></em> <BR>
<em><strong><font size="4"><font color="#993333"></font></font></strong></em> <BR>
</div><br><br><br>> Date: Wed, 8 Jun 2011 15:52:33 +0530<br>> Subject: Re: Problems with hypercalls<br>> From: fs.rajat@gmail.com<br>> To: mulyadi.santosa@gmail.com<br>> CC: tricheurs@hotmail.fr; kernelnewbies@kernelnewbies.org<br>> <br>> are you doing 64bit devision on 32 bit arch? If that is the case,<br>> do_div is worth considering.<br>> <br>> On Wed, Jun 8, 2011 at 3:25 PM, Mulyadi Santosa<br>> <mulyadi.santosa@gmail.com> wrote:<br>> > On Tue, Jun 7, 2011 at 15:39, emilie lefebvre <tricheurs@hotmail.fr> wrote:<br>> >> "divide error: 0000 [#1] SMP<br>> >> ...<br>> >> [<ffffffff813f8cdd>] panic+0x78/0x137<br>> >> [<ffffffff813fcb94>] oops_end+0xe4/0x100<br>> >> [<ffffffff8101021b>] die+0x5b/0x90<br>> >> [<ffffffff813fc444>] do_trap+0xc4/0x160<br>> >> [<ffffffff8100df2f>] do_divide_error+0x8f/0xb0<br>> >> [<ffffffff811f974c>] ? my_function+0xdc/0xe70 "<br>> >><br>> >> Could you have any suggestions ?<br>> ><br>> > Could you show us your code? perhaps by pasting them somewhere?<br>> ><br>> > >From what I guess, sounds like your code did some math (directly or<br>> > indirectly) that fiddle with floating point numbers?<br>> ><br>> ><br>> > --<br>> > regards,<br>> ><br>> > Mulyadi Santosa<br>> > Freelance Linux trainer and consultant<br>> ><br>> > blog: the-hydra.blogspot.com<br>> > training: mulyaditraining.blogspot.com<br>> ><br>> > _______________________________________________<br>> > Kernelnewbies mailing list<br>> > Kernelnewbies@kernelnewbies.org<br>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br>> ><br>> <br>> _______________________________________________<br>> Kernelnewbies mailing list<br>> Kernelnewbies@kernelnewbies.org<br>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br>                                            </body>
</html>