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: 76759 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp3721qgf; Thu, 22 Sep 2016 05:30:23 -0700 (PDT) X-Received: by 10.200.55.221 with SMTP id e29mr1667062qtc.29.1474547423777; Thu, 22 Sep 2016 05:30:23 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k36si984783qtd.3.2016.09.22.05.30.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn38x-0004vk-9Y for patch@linaro.org; Thu, 22 Sep 2016 08:30:23 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.1.4 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; } }