From patchwork Thu Jan 27 13:09:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 80675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CD9C4B7139 for ; Fri, 28 Jan 2011 00:13:36 +1100 (EST) Received: from localhost ([127.0.0.1]:35482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRfJ-0002tp-FZ for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 08:13:33 -0500 Received: from [140.186.70.92] (port=49401 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRcA-0001Sp-DO for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiRc7-0000kg-1c for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:18 -0500 Received: from thoth.sbs.de ([192.35.17.2]:19817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiRc6-0000im-82 for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:14 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id p0RDABYR023234; Thu, 27 Jan 2011 14:10:11 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p0RDA72u009974; Thu, 27 Jan 2011 14:10:11 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Thu, 27 Jan 2011 14:09:54 +0100 Message-Id: <62151287710d788ebae642df9c4451bafaf8fd23.1296133797.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 10/22] kvm: Set up signal mask also for !CONFIG_IOTHREAD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Block SIG_IPI, unblock it during KVM_RUN, just like in io-thread mode. It's unused so far, but this infrastructure will be required for self-IPIs and to process SIGBUS plus, in KVM mode, SIGIO and SIGALRM. As Windows doesn't support signal services, we need to provide a stub for the init function. Signed-off-by: Jan Kiszka Reviewed-by: Paolo Bonzini --- cpus.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 16bd8fa..03c89b4 100644 --- a/cpus.c +++ b/cpus.c @@ -231,7 +231,6 @@ fail: return err; } -#ifdef CONFIG_IOTHREAD static void dummy_signal(int sig) { } @@ -246,6 +245,12 @@ static void qemu_kvm_init_cpu_signals(CPUState *env) sigact.sa_handler = dummy_signal; sigaction(SIG_IPI, &sigact, NULL); +#ifndef CONFIG_IOTHREAD + sigemptyset(&set); + sigaddset(&set, SIG_IPI); + pthread_sigmask(SIG_BLOCK, &set, NULL); +#endif + pthread_sigmask(SIG_BLOCK, NULL, &set); sigdelset(&set, SIG_IPI); sigdelset(&set, SIGBUS); @@ -255,7 +260,6 @@ static void qemu_kvm_init_cpu_signals(CPUState *env) exit(1); } } -#endif #else /* _WIN32 */ @@ -284,6 +288,10 @@ static void qemu_event_increment(void) exit (1); } } + +static void qemu_kvm_init_cpu_signals(CPUState *env) +{ +} #endif /* _WIN32 */ #ifndef CONFIG_IOTHREAD @@ -312,6 +320,7 @@ void qemu_init_vcpu(void *_env) fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); exit(1); } + qemu_kvm_init_cpu_signals(env); } }