From patchwork Mon May 23 15:09:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 68397 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp144348qge; Mon, 23 May 2016 08:21:18 -0700 (PDT) X-Received: by 10.140.152.16 with SMTP id 16mr16679314qhy.77.1464016878738; Mon, 23 May 2016 08:21:18 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k8si30332151qge.108.2016.05.23.08.21.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 23 May 2016 08:21:18 -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=@gmail.com; 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 Received: from localhost ([::1]:48849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rfS-0002kn-8P for patch@linaro.org; Mon, 23 May 2016 11:21:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUs-0002Fx-Rj for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4rUn-00046X-EQ for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:21 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUn-00046D-7d for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:17 -0400 Received: by mail-wm0-x244.google.com with SMTP id f75so9713910wmf.2 for ; Mon, 23 May 2016 08:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rdtbq840RaVDDHs7uN0uKwUtDBa8zSbauPrZrf0h90Q=; b=M1CKc9eQpE9hcVAQEgXBKjt7iyCgfHf1VXdiwPfxt3y+kcNKgf67m97vKAGi+A6jTi 1x/hE/e6Zqkw2Divo5OvC94zgHzaPmlTFtyK27Zv6iZzNhO4NXHu0Yw0Alg2Pp/40wh4 4ZHHF/y+u6Z62tyZ0wT1XhFoDSoHi/lWluOhWploC8hUIjwxhwmdC2TuOAWE7bxfc7tq zbnDMcshjqDtTM4nE/KzD5UMIslbjmdLSsPk/4hWuDwewMkv48Fxq8B4vpwHwCSNb6t3 7jNyjRUvyza9tGtLjutXxnrtPZLfpnP6SOPvA+9QhiOJ6H3j40HWrjrrCT4wPAi6QMky B6+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=rdtbq840RaVDDHs7uN0uKwUtDBa8zSbauPrZrf0h90Q=; b=bGiTx/JoTwKJrCVJjETe2d8OZt0QP8w22oogdsuNhcF2BQA7vd3QeMgTlJzdSq8yBi xT80L08PqwkewJAL9xMtmCdxH6GXYuaocwgrackZCxkupPtSkGmZrxBmkzPNU+nzpRhs I/NCRYTkLK/6ryDafX0MCQTO6rGMlmSnx2F7MzCH4Zz5T9+9OYzln3ygNXqeaVqb5nya Lk8rQRSfzeYj+0xXxsYxTxox9Is26TtLbVDX8vEFOoz1rtXp6PeayhUgTwL3p7zYaKfJ nCg6/hEd3aAs8x7ficNdGn1KS2RoSu/VXqES4nulSRChVPaLMas0gcKL09lUNruLFp5I xZZA== X-Gm-Message-State: AOPr4FWs9vQCgAZiDB8ISkXWlcjEozuNVDZBc1QOq8V5LaLbUSNbH8l4rCgMHaIOEoyO2Q== X-Received: by 10.28.175.83 with SMTP id y80mr17226531wme.8.1464016216699; Mon, 23 May 2016 08:10:16 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id ac2sm19250359wjc.35.2016.05.23.08.10.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 08:10:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 23 May 2016 17:09:49 +0200 Message-Id: <1464016199-43768-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> References: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 14/24] cpus.c: Use pthread_sigmask() rather than sigprocmask() 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 On Linux, sigprocmask() and pthread_sigmask() are in practice the same thing (they only set the signal mask for the calling thread), but the documentation states that the behaviour of sigprocmask() in a multithreaded process is undefined. Use pthread_sigmask() instead (which is what we do in almost all places in QEMU that alter the signal mask already). Signed-off-by: Peter Maydell Message-Id: <1463420039-29761-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3.1 diff --git a/cpus.c b/cpus.c index eb34b4f..f8366c6 100644 --- a/cpus.c +++ b/cpus.c @@ -780,7 +780,7 @@ static void sigbus_reraise(void) raise(SIGBUS); sigemptyset(&set); sigaddset(&set, SIGBUS); - sigprocmask(SIG_UNBLOCK, &set, NULL); + pthread_sigmask(SIG_UNBLOCK, &set, NULL); } perror("Failed to re-raise SIGBUS!\n"); abort();