Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: [patch 3/7] mips: Enable interrupts in do_signal()
Date: Sat, 23 Jul 2011 12:41:23 -0000	[thread overview]
Message-ID: <20110723124016.118094411@linutronix.de> (raw)
In-Reply-To: 20110723123948.573545817@linutronix.de

[-- Attachment #1: mips-enable-interrupts-in-signal.patch --]
[-- Type: text/plain, Size: 1717 bytes --]

do_signal() does __put_user() which can fault, resulting in a
might_sleep() warning in down_read(&mm->mmap_sem) and a "scheduling
while atomic" warning when mmap_sem is contented. On swarm this also
results in:

WARNING: at kernel/smp.c:459 smp_call_function_many+0x148/0x398()
Modules linked in:
Call Trace:

[<ffffffff804b48a4>] dump_stack+0x1c/0x50
[<ffffffff8013dc94>] warn_slowpath_common+0x8c/0xc8
[<ffffffff8013dcfc>] warn_slowpath_null+0x2c/0x40
[<ffffffff801864a0>] smp_call_function_many+0x148/0x398
[<ffffffff80186748>] smp_call_function+0x58/0xa8
[<ffffffff80119b5c>] r4k_flush_data_cache_page+0x54/0xd8
[<ffffffff801f39bc>] handle_pte_fault+0xa9c/0xad0
[<ffffffff801f40d0>] handle_mm_fault+0x158/0x200
[<ffffffff80115548>] do_page_fault+0x218/0x3b0
[<ffffffff80102744>] ret_from_exception+0x0/0x10
[<ffffffff8010eb18>] copy_siginfo_to_user32+0x50/0x298
[<ffffffff8010edf0>] setup_rt_frame_32+0x90/0x250
[<ffffffff80106414>] do_notify_resume+0x154/0x358
[<ffffffff80102930>] work_notifysig+0xc/0x14

Enable interrupts in do_signal() before delivering signals. Might be
done in the entry code before calling do_notify_resume(), but I leave
that for the MIPS ASM wizards.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/mips/kernel/signal.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/arch/mips/kernel/signal.c
===================================================================
--- linux-2.6.orig/arch/mips/kernel/signal.c
+++ linux-2.6/arch/mips/kernel/signal.c
@@ -603,6 +603,8 @@ static void do_signal(struct pt_regs *re
 	if (!user_mode(regs))
 		return;
 
+	local_irq_enable();
+
 	if (test_thread_flag(TIF_RESTORE_SIGMASK))
 		oldset = &current->saved_sigmask;
 	else

  parent reply	other threads:[~2011-07-23 12:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23 12:41 [patch 0/7] MIPS: Assorted fixlets and annotation patches Thomas Gleixner
2011-07-23 12:41 ` [patch 1/7] mips: sibyte: Add missing irq_mask function Thomas Gleixner
2011-07-27  8:41   ` Ralf Baechle
2011-07-27 14:49   ` Ralf Baechle
2011-07-23 12:41 ` [patch 2/7] mips: ftrace: Fix the CONFIG_DYNAMIC_FTRACE=n compile Thomas Gleixner
2011-07-27  9:23   ` Ralf Baechle
2011-07-23 12:41 ` Thomas Gleixner [this message]
2011-07-27 13:06   ` [patch 3/7] mips: Enable interrupts in do_signal() Ralf Baechle
2011-07-23 12:41 ` [patch 6/7] MIPS: Loongson: Mark cascade interrupts IRQF_NO_THREAD Thomas Gleixner
2011-07-27  9:55   ` Ralf Baechle
2011-07-23 12:41 ` [patch 4/7] MIPS: Make the die_lock be raw Thomas Gleixner
2011-07-27  9:51   ` Ralf Baechle
2011-07-23 12:41 ` [patch 5/7] MIPS: Mark cascade and low level interrupts IRQF_NO_THREAD Thomas Gleixner
2011-07-27  9:53   ` Ralf Baechle
2011-07-23 12:41 ` [patch 7/7] mips: Allow forced irq threading Thomas Gleixner
2011-07-27  9:56   ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110723124016.118094411@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox