From patchwork Thu Sep 22 12:13:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9345193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E1A9607D0 for ; Thu, 22 Sep 2016 12:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 303E02AA5D for ; Thu, 22 Sep 2016 12:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 243322AA5F; Thu, 22 Sep 2016 12:28:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A69072AA5D for ; Thu, 22 Sep 2016 12:28:31 +0000 (UTC) Received: from localhost ([::1]:43079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn378-0003P1-AK for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 08:28:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uO-00009Y-Gd for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn2uJ-0006f4-Bz for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:19 -0400 Received: from mail-lf0-f51.google.com ([209.85.215.51]:36595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uJ-0006eX-4t for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:15 -0400 Received: by mail-lf0-f51.google.com with SMTP id g62so65200117lfe.3 for ; Thu, 22 Sep 2016 05:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=57yhnsVlLZNn1O4k2CRjrBfShFAiUPwtCTVZxzj7o24=; b=ALxeHcGSTYE6sxvZi85TFgckvOXt4aqTip41RFOGhobx5HKj4jMrRYNFXGFuCdqgpg UflWWJBf3vSuNPcG8ehXOtBboLlUK4EzRgYReB800WJANL6U6FgSfbXBLnezOdvRPVs/ R7NnvEr+nav7pGLQ7vlth+TT2H3pe0kfDrtm0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=57yhnsVlLZNn1O4k2CRjrBfShFAiUPwtCTVZxzj7o24=; b=L9SQuEVU30I9ZfImrVmGmxoPd+gPYIUeZmUeN+aJW5U1HB7QPsZWtSDI/qZ5KHhU1T MeX+t9x15woUiekU1/3pAIVvPhfmaoaNKyM8r/wEPsBmO71n3lK0VupdKVf/nijPhsIx wZ10Fhjn+rKoACddLC0VZq0ZGMkmgSzlt2G9U61k/9Jmu9mzsCZAy/xRgYw2DXTJPVrn gu32UWS39lvsR5XmZYx2xkDB+IogSxc4nlt2rCQLxTZ1zNuGVoXtpHdDBBVnBZCpYqtf U34H/2aF6Ny+hYAVoM9B2UIQsCtp76wSJh94blOSBUJVxVQKDxlQ9QfQZZ0QFX2LBo8x ir+A== X-Gm-Message-State: AE9vXwMFGtjSqyLlIshsiUQ/iyyyDqRMoJdZiHurE6iKEziF2jbnX+rScpbdKfXukJavD72f X-Received: by 10.25.24.101 with SMTP id o98mr607337lfi.3.1474546453954; Thu, 22 Sep 2016 05:14:13 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id u14sm294378lja.11.2016.09.22.05.14.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:14:12 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 15:13:37 +0300 Message-Id: <8bd3773cce1885c46e5cf09a72b9138ccba5fbf2.1474546244.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.51 Subject: [Qemu-devel] [PULL 17/26] linux-user: Recheck for pending synchronous signals too X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell In process_pending_signals() we restart the scan of possible pending signals after calling handle_pending_signal() in case some other signal has been generated. This rescan should also include a check for a new synchronous signal since those are in fact the only kind of new signal that the signal frame setup process might produce. Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/signal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 3337f1e..f2c9f8e 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5925,6 +5925,7 @@ void process_pending_signals(CPUArchState *cpu_env) sigfillset(&set); sigprocmask(SIG_SETMASK, &set, 0); + restart_scan: sig = ts->sync_signal.pending; if (sig) { /* Synchronous signals are forced, @@ -5952,8 +5953,10 @@ void process_pending_signals(CPUArchState *cpu_env) (!sigismember(blocked_set, target_to_host_signal_table[sig]))) { handle_pending_signal(cpu_env, sig, &ts->sigtab[sig - 1]); - /* Restart scan from the beginning */ - sig = 1; + /* Restart scan from the beginning, as handle_pending_signal + * might have resulted in a new synchronous signal (eg SIGSEGV). + */ + goto restart_scan; } }