send_sig_info() in __switch_to() Ok or not?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Mikael Pettersson
I have a kernel extension (the x86 perfctr driver) that needs, in a specific but unlikely
case(*), to send a SIGILL to current (next) in__switch_to(). Is this permitted or not?I suspect it might not be because
send_sig_info()eventually doeswake_up_process_kick(), and there's this warning in__switch_to()not to callprintk()since it callswake_up()...If I can't call
send_sig_info()in__switch_to(), is there another way to post a SIGILL to current from__switch_to()?
You can just do it manually. Fill in the signal in the signal mask of the process. The next time the process checks for signals it will kill itself. As it is already running or going to run it doesn't need a wake up.
You could also forcibly call do_exit with the right signal, but that cannot be blocked.
-Andi
Quoted 10 lines · Andi Kleen
Quoted 7 lines · Mikael Pettersson
I have a kernel extension (the x86 perfctr driver) that needs, in a specific but unlikely
case(*), to send a SIGILL to current (next) in__switch_to(). Is this permitted or not?I suspect it might not be because
send_sig_info()eventually doeswake_up_process_kick(), and there's this warning in__switch_to()not to callprintk()since it callswake_up()...
Quoted 7 lines
Quoted 2 lines
If I can't call
send_sig_info()in__switch_to(), is there another way to post a SIGILL to current from__switch_to()?You can just do it manually. Fill in the signal in the signal mask of the process. The next time the process checks for signals it will kill itself. As it is already running or going to run it doesn't need a wake up.
Sorry about the delay in responding to this.
Anyway, I started doing it manually, but gave up since it would mean copying/duplicating quite a bit of code from signal.c. Instead I now do:
BUG_ON(current->state != TASK_RUNNING); send_sig(SIG_ILL, current, 1);
I've checked sched.c and done runtime testing, and this does seem to be true and work Ok. (Fingers crossed, knock on wood, etc.)
/Mikael