From: Andi Kleen Date: Thu, 16 Feb 2006 22:42:01 +0000 (+0100) Subject: [PATCH] x86_64: Don't call do_exit with interrupts disabled after IRET exception X-Git-Tag: v2.6.16-rc4~36 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2391c4b594eb28abd58102de8f4e5d7a4fa39f4c;p=~shefty%2Frdma-dev.git [PATCH] x86_64: Don't call do_exit with interrupts disabled after IRET exception This caused a sigreturn with bad argument on a preemptible kernel to complain with Debug: sleeping function called from invalid context at /home/lsrc/quilt/linux/include/linux/rwsem.h:43 in_atomic():0, irqs_disabled():1 Call Trace: {__might_sleep+190} {profile_task_exit+21} {__do_exit+34} {do_wait+0} Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index b150c87a08c..7c10e9009d6 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S @@ -554,6 +554,7 @@ iret_label: /* running with kernel gs */ bad_iret: movq $-9999,%rdi /* better code? */ + sti jmp do_exit .previous