From patchwork Tue Jan 15 19:47:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 1025410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=braap.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="iWkPF0cz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="gJj5fEdv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43fLZ04hwcz9sBQ for ; Wed, 16 Jan 2019 06:51:19 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjUjz-00021m-9U for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2019 14:51:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjUh0-000896-OG for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjUgy-0006y0-LP for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:10 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:44323) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjUgx-0006wy-Dc for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:07 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B10A028950; Tue, 15 Jan 2019 14:48:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 15 Jan 2019 14:48:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=gN5GlEXWmPdmFmr0aDDVVz23EWNCHWzxVnXT3LlUdSk=; b=iWkPF 0cztjsMABCvdmy9gpkqR8f0O4b7w7Zpp4ujNUXwayfIqo46sT6YeYCcQM1DhjXDp WdabUTRFhmCgUcIOtaSFnwAB7Tp6OQOPnmhoFeR1soTL+280YMzooPSl/+w8oJc4 GNEN3QoRH9ZU9/ZYIbG+nMwnH8ryspIDuegGRo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=gN5GlEXWmPdmFmr0aDDVVz23EWNCH WzxVnXT3LlUdSk=; b=gJj5fEdvXenGoBG9k9vYKsffwCToQJhO9bT4KiAhOGbJn bwWWBtg6/6fQeqm+u73h8bobwq+R9tKMGR34BpZiDvAZhZqaASQNL7UnR1IYyiJ3 Rd6rB0O58wnJRyh3VjNojpJz/unZM6z6DU6UnMF86OH57+GrDkxsyWyCsTyjU0Pf WsKjtmoiSeAt0gvwiIh5NEpsJFZ87Po+7dU/nTOU8eKJXLxlCCSq5L1gEIUEc1FL J6V1/GYc2bARrASwcthplRn3NWy/K77iVjM+Uble84khxvq+ZU8EHXwdLWFCCZJA onxUN3S4xs6OYcFtzCKEAFHYxRQZ6voIPCy4jSwnQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrgeefgdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhestddtredtredttdenucfhrhhomhepfdfgmhhilhhiohcuifdrucevohhtrgdfuceo tghothgrsegsrhgrrghprdhorhhgqeenucfkphepuddvkedrheelrddvtddrvdduieenuc frrghrrghmpehmrghilhhfrhhomheptghothgrsegsrhgrrghprdhorhhgnecuvehluhhs thgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 1A965E4394; Tue, 15 Jan 2019 14:48:05 -0500 (EST) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Tue, 15 Jan 2019 14:47:53 -0500 Message-Id: <20190115194754.7670-2-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115194754.7670-1-cota@braap.org> References: <20190115194754.7670-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH 1/2] cpu-exec: add assert_no_pages_locked() after longjmp 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: Paolo Bonzini , Richard Henderson , Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We forgot to add this check in faa9372c07 ("translate-all: introduce assert_no_pages_locked", 2018-06-15); we only added it after returning from a longjmp in cpu_exec_step_atomic. Fix it. Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 870027d435..55e0ca41c4 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -699,6 +699,7 @@ int cpu_exec(CPUState *cpu) if (qemu_mutex_iothread_locked()) { qemu_mutex_unlock_iothread(); } + assert_no_pages_locked(); } /* if an exception is pending, we execute it here */ From patchwork Tue Jan 15 19:47:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 1025407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=braap.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="TBVjGg+v"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RQFzmD60"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43fLWC2l6wz9sBQ for ; Wed, 16 Jan 2019 06:48:55 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjUhh-0008Bz-9h for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2019 14:48:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjUh2-0008A4-Ja for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjUgy-0006yS-QC for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:12 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42623) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjUgy-0006wx-I7 for qemu-devel@nongnu.org; Tue, 15 Jan 2019 14:48:08 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CAE5328A72; Tue, 15 Jan 2019 14:48:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 15 Jan 2019 14:48:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=Xjqflkzsm/KA4zxMJftg15BS6QHmhM0q3vVFDsmGv8Y=; b=TBVjG g+vH9eI8gaxfDvCNwS7kRBcShDcdOcwKS0wICWqsvzdDh2aeYbVvry5ZqOfc2egA xsTBbmxo2kn8olloUQCdfZNSkFTEbHgIHvrg90OfiDiLvJCmryUM4ZVkG2mFyJ6n cyH6En1EfCoCGcO2VEkMVLv6vNt2zlZJgswR3I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=Xjqflkzsm/KA4zxMJftg15BS6QHmh M0q3vVFDsmGv8Y=; b=RQFzmD60qc75BIrzotnPgC5fWnv8WENoft8b8d1e+3Xkb AUeRH8AiQeOeRc1gy4C0E17p2wl93mULxNFpRIpbl0mbn/NBzT7nkd1or5ex1/uD zD8BaeMxFaO+kewW+6n1vG5VZfNzgK4MHsAhrWqvc8tzj9BPKdt2dKN2+47yhSoI lwqTHBjg4IjQ+6pgReF3jlpcTAbuY2Viqgbp9ho4jHNR85NmL1+j3jk9oAKnP3jm dOQFNT19l7gZ4QDTA8dWktgj631tNsb73jEx1Zr52vtvSPxHl7SzythLxRlE3icR HbouywJo+ZkQ0t2wQ+qME+sZdW4XzXqSuCLo9ZDhg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrgeefgdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhestddtredtredttdenucfhrhhomhepfdfgmhhilhhiohcuifdrucevohhtrgdfuceo tghothgrsegsrhgrrghprdhorhhgqeenucfkphepuddvkedrheelrddvtddrvdduieenuc frrghrrghmpehmrghilhhfrhhomheptghothgrsegsrhgrrghprdhorhhgnecuvehluhhs thgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 5C50CE4511; Tue, 15 Jan 2019 14:48:05 -0500 (EST) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Tue, 15 Jan 2019 14:47:54 -0500 Message-Id: <20190115194754.7670-3-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115194754.7670-1-cota@braap.org> References: <20190115194754.7670-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH 2/2] cpu-exec: reset BQL after longjmp in cpu_exec_step_atomic 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: Paolo Bonzini , Richard Henderson , Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Just like we do in cpu_exec(). Reported-by: Max Filippov Tested-by: Max Filippov Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 55e0ca41c4..fefd955d66 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -266,6 +266,9 @@ void cpu_exec_step_atomic(CPUState *cpu) #ifndef CONFIG_SOFTMMU tcg_debug_assert(!have_mmap_lock()); #endif + if (qemu_mutex_iothread_locked()) { + qemu_mutex_unlock_iothread(); + } assert_no_pages_locked(); }