From: Anton Ivanov <aivanov@brocade.com>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Anton Ivanov <aivanov@brocade.com>
Subject: [uml-devel] [PATCH 3/3] Signal handling cleanup
Date: Fri, 20 Nov 2015 16:45:15 +0000 [thread overview]
Message-ID: <1448037915-921549-3-git-send-email-aivanov@brocade.com> (raw)
In-Reply-To: <1448037915-921549-1-git-send-email-aivanov@brocade.com>
Fix signal handling to use store/restore instead of block/unblock
as that may cause IRQ reentrancy
Signed-off-by: Anton Ivanov <aivanov@brocade.com>
---
arch/um/os-Linux/skas/process.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 13c5a2c..5916267 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -313,6 +313,7 @@ void userspace(struct uml_pt_regs *regs)
int err, status, op, pid = userspace_pid[0];
/* To prevent races if using_sysemu changes under us.*/
int local_using_sysemu;
+ unsigned long flags;
siginfo_t si;
/* Handle any immediate reschedules or signals */
@@ -396,9 +397,9 @@ void userspace(struct uml_pt_regs *regs)
case SIGBUS:
case SIGFPE:
case SIGWINCH:
- block_signals();
+ flags = set_signals(0);
(*sig_info[sig])(sig, (struct siginfo *)&si, regs);
- unblock_signals();
+ set_signals(flags);
break;
default:
printk(UM_KERN_ERR "userspace - child stopped "
@@ -586,15 +587,16 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf)
void initial_thread_cb_skas(void (*proc)(void *), void *arg)
{
jmp_buf here;
+ unsigned long int flags;
cb_proc = proc;
cb_arg = arg;
cb_back = &here;
- block_signals();
+ flags = set_signals(0);
if (UML_SETJMP(&here) == 0)
UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
- unblock_signals();
+ set_signals(flags);
cb_proc = NULL;
cb_arg = NULL;
--
2.1.4
------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
prev parent reply other threads:[~2015-11-20 16:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 16:45 [uml-devel] [PATCH 1/3] IRQ Reentrancy guard Anton Ivanov
2015-11-20 16:45 ` [uml-devel] [PATCH 2/3] Errata: HR Timer subsystem Anton Ivanov
2015-11-20 18:12 ` Anton Ivanov
2015-11-20 16:45 ` Anton Ivanov [this message]
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=1448037915-921549-3-git-send-email-aivanov@brocade.com \
--to=aivanov@brocade.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).