summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/signal.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-26 18:28:36 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-01-26 18:28:36 +0300
commitb8bc3bde9c8c90500c648627d53f846642ff8639 (patch)
tree0c3ed82848a25948206556bc699a10d30bd18d07 /arch/um/os-Linux/signal.c
parent171b5682aa8597174e80ec4128c87538103f2213 (diff)
parent9abc2a08a7d665b02bdde974fd6c44aae86e923e (diff)
downloadlinux-b8bc3bde9c8c90500c648627d53f846642ff8639.tar.xz
Merge tag 'kvm-s390-master-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
KVM: s390: Fixes for kvm/master (targeting 4.5) 1. Fallout of some bigger floating point/vector rework in s390 - memory leak -> stable 4.3+ - memory overwrite -> stable 4.4+ 2. enable KVM-VFIO for s390
Diffstat (limited to 'arch/um/os-Linux/signal.c')
-rw-r--r--arch/um/os-Linux/signal.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index c211153ca69a..7801666514ed 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -62,6 +62,7 @@ static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
static int signals_enabled;
static unsigned int signals_pending;
+static unsigned int signals_active = 0;
void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
{
@@ -101,7 +102,12 @@ void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
block_signals();
+ signals_active |= SIGALRM_MASK;
+
timer_real_alarm_handler(mc);
+
+ signals_active &= ~SIGALRM_MASK;
+
set_signals(enabled);
}
@@ -286,8 +292,16 @@ void unblock_signals(void)
if (save_pending & SIGIO_MASK)
sig_handler_common(SIGIO, NULL, NULL);
- if (save_pending & SIGALRM_MASK)
+ /* Do not reenter the handler */
+
+ if ((save_pending & SIGALRM_MASK) && (!(signals_active & SIGALRM_MASK)))
timer_real_alarm_handler(NULL);
+
+ /* Rerun the loop only if there is still pending SIGIO and not in TIMER handler */
+
+ if (!(signals_pending & SIGIO_MASK) && (signals_active & SIGALRM_MASK))
+ return;
+
}
}