[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/35] Implement qemu_kvm_eat_signals only for CONFI
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 18/35] Implement qemu_kvm_eat_signals only for CONFIG_LINUX |
Date: |
Tue, 15 Mar 2011 18:50:32 -0300 |
From: Jan Kiszka <address@hidden>
qemu_kvm_eat_signals requires POSIX support with realtime extensions for
sigtimedwait. Not all our target platforms provide this. Moreover,
undefined sigbus_reraise was referenced on non-Linux as well.
Signed-off-by: Jan Kiszka <address@hidden>
CC: Andreas Färber <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
cpus.c | 94 ++++++++++++++++++++++++++++++++--------------------------------
1 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/cpus.c b/cpus.c
index 077729c..26e5bba 100644
--- a/cpus.c
+++ b/cpus.c
@@ -245,11 +245,58 @@ static void qemu_init_sigbus(void)
prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0);
}
+static void qemu_kvm_eat_signals(CPUState *env)
+{
+ struct timespec ts = { 0, 0 };
+ siginfo_t siginfo;
+ sigset_t waitset;
+ sigset_t chkset;
+ int r;
+
+ sigemptyset(&waitset);
+ sigaddset(&waitset, SIG_IPI);
+ sigaddset(&waitset, SIGBUS);
+
+ do {
+ r = sigtimedwait(&waitset, &siginfo, &ts);
+ if (r == -1 && !(errno == EAGAIN || errno == EINTR)) {
+ perror("sigtimedwait");
+ exit(1);
+ }
+
+ switch (r) {
+ case SIGBUS:
+ if (kvm_on_sigbus_vcpu(env, siginfo.si_code, siginfo.si_addr)) {
+ sigbus_reraise();
+ }
+ break;
+ default:
+ break;
+ }
+
+ r = sigpending(&chkset);
+ if (r == -1) {
+ perror("sigpending");
+ exit(1);
+ }
+ } while (sigismember(&chkset, SIG_IPI) || sigismember(&chkset, SIGBUS));
+
+#ifndef CONFIG_IOTHREAD
+ if (sigismember(&chkset, SIGIO) || sigismember(&chkset, SIGALRM)) {
+ qemu_notify_event();
+ }
+#endif
+}
+
#else /* !CONFIG_LINUX */
static void qemu_init_sigbus(void)
{
}
+
+static void qemu_kvm_eat_signals(CPUState *env)
+{
+}
#endif /* !CONFIG_LINUX */
#ifndef _WIN32
@@ -455,49 +502,6 @@ static void qemu_tcg_init_cpu_signals(void)
#endif
}
-static void qemu_kvm_eat_signals(CPUState *env)
-{
- struct timespec ts = { 0, 0 };
- siginfo_t siginfo;
- sigset_t waitset;
- sigset_t chkset;
- int r;
-
- sigemptyset(&waitset);
- sigaddset(&waitset, SIG_IPI);
- sigaddset(&waitset, SIGBUS);
-
- do {
- r = sigtimedwait(&waitset, &siginfo, &ts);
- if (r == -1 && !(errno == EAGAIN || errno == EINTR)) {
- perror("sigtimedwait");
- exit(1);
- }
-
- switch (r) {
- case SIGBUS:
- if (kvm_on_sigbus_vcpu(env, siginfo.si_code, siginfo.si_addr)) {
- sigbus_reraise();
- }
- break;
- default:
- break;
- }
-
- r = sigpending(&chkset);
- if (r == -1) {
- perror("sigpending");
- exit(1);
- }
- } while (sigismember(&chkset, SIG_IPI) || sigismember(&chkset, SIGBUS));
-
-#ifndef CONFIG_IOTHREAD
- if (sigismember(&chkset, SIGIO) || sigismember(&chkset, SIGALRM)) {
- qemu_notify_event();
- }
-#endif
-}
-
#else /* _WIN32 */
HANDLE qemu_event_handle;
@@ -526,10 +530,6 @@ static void qemu_event_increment(void)
}
}
-static void qemu_kvm_eat_signals(CPUState *env)
-{
-}
-
static int qemu_signal_init(void)
{
return 0;
--
1.7.4
- [Qemu-devel] [PATCH 00/35] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 23/35] kvm: x86: Do not leave halt if interrupts are disabled, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 20/35] s390: Detect invalid invocations of qemu_ram_free/remap, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 18/35] Implement qemu_kvm_eat_signals only for CONFIG_LINUX,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 02/35] kvm: Fix build warning when KVM_CAP_SET_GUEST_DEBUG is lacking, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 04/35] x86: Perform implicit mcg_status reset, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 12/35] x86: Run qemu_inject_x86_mce on target VCPU, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 14/35] kvm: x86: Clean up kvm_setup_mce, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 08/35] Synchronize VCPU states before reset, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 07/35] x86: Optionally avoid injecting AO MCEs while others are pending, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 22/35] kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 03/35] x86: Account for MCE in cpu_has_work, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 06/35] x86: Refine error reporting of MCE injection services, Marcelo Tosatti, 2011/03/15
- [Qemu-devel] [PATCH 24/35] kvm: Mark VCPU state dirty on creation, Marcelo Tosatti, 2011/03/15