From nobody Thu May 2 07:48:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490004999207322.52226367783726; Mon, 20 Mar 2017 03:16:39 -0700 (PDT) Received: from localhost ([::1]:60134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpuMf-0003Yv-Gw for importer@patchew.org; Mon, 20 Mar 2017 06:16:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpuMA-0003Ya-Kz for qemu-devel@nongnu.org; Mon, 20 Mar 2017 06:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpuM9-0007Lv-Kx for qemu-devel@nongnu.org; Mon, 20 Mar 2017 06:16:06 -0400 Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:34317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpuM9-0007KB-69 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 06:16:05 -0400 Received: by mail-wr0-x22b.google.com with SMTP id l37so88871516wrc.1 for ; Mon, 20 Mar 2017 03:16:03 -0700 (PDT) Received: from vpalatin.zrh.corp.google.com ([172.16.114.40]) by smtp.gmail.com with ESMTPSA id s18sm12904749wmb.18.2017.03.20.03.16.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 03:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=kGQH6pgtsDKsi87XpJfLgzBR7L3+JEX9PA8JJFaqRbg=; b=Jd+qDGpWzS93OVw3wzOlENmTI5a2DOtRmEpPDH41WUHEblsgEc1yqbDaBTlnQn7egW kDJ+es3cugE7bj/8Gz4/r+I3jqo8KjpWLHUJCwJ2OSTBvMSSsZz6ZsQMoxpRDS0sKuAz F9S2PlKJHun439gREne+J4qy/JrA5ukDijX/jV6YOfydNCxhPb9hFfHuVioEI88UK12f UNe6iXPjIJ1Nh4TYh+wJRDDPo/ouWhI0Z3fE2/lwosHdp2Yufagu5TbI93C0nvhpDJyk qNZhFVwU4UY+sikZ0YSjRkC1aLAIicP5Pw2fSLZfi/pomVvN2dJ8H6WHTXgOzYbTOjXe 0lYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=kGQH6pgtsDKsi87XpJfLgzBR7L3+JEX9PA8JJFaqRbg=; b=OITp5x4aBgtPgzc1j3noeBcPOU37X3lF0ZZOOYUZJYFKbEn4nzypmNpTfDjBQBNBF+ 2vYHIQ147grOrSZYQpne246op2zLjKNmxtWZCOu/cR9G1O3tYSM4GYGYAb1xN5M9PD0v G7hQ9He1X0CX5H8WbP7D+8v4TLWGfPloWTEfbMETdUtO8+jbbw+dxChO9uvf1eFOZqOE jZ6ySd3x92ihK/C4t1x2imKWPsd8/4K7P9QU0J/JWy1DuB195gCY9i8njHRxgcz5+8Pn DmPanrTMGCrZisQmbmIuUfrY33eGhcikWFcW20Fh/XQAvEiWV78bZzQ4t+GyXBIAo9Iq MkLQ== X-Gm-Message-State: AFeK/H1lRboS680DUSyIAl+cHCij97tZ/qGFVFAIbPTPhMldl84B12NV1gpdRJbCgYERv2o/ X-Received: by 10.223.162.212 with SMTP id t20mr23520322wra.122.1490004962544; Mon, 20 Mar 2017 03:16:02 -0700 (PDT) From: Vincent Palatin To: qemu-devel Date: Mon, 20 Mar 2017 11:15:49 +0100 Message-Id: <20170320101549.150076-1-vpalatin@chromium.org> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22b Subject: [Qemu-devel] [PATCH] hax: fix breakage in locking 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: Yu Ning , Stefan Weil , Vincent Palatin , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" use qemu_mutex_lock_iothread consistently in qemu_hax_cpu_thread_fn() as done in other _thread_fn functions, instead of grabbing directly the BQL. This way we ensure that iothread_locked is properly set. On v2.9.0-rc0, QEMU was dying in an assertion in the mutex code when running with '--enable-hax' either on OSX or Windows. This bug was triggered since the code modification for multithreading added new usages of qemu_mutex_iothread_locked. This fixes the breakage on both platforms, I can now run again a full Chromium OS image with HAX kernel acceleration. Signed-off-by: Vincent Palatin --- cpus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index b84a392dda..167d9615e1 100644 --- a/cpus.c +++ b/cpus.c @@ -1344,8 +1344,9 @@ static void *qemu_hax_cpu_thread_fn(void *arg) { CPUState *cpu =3D arg; int r; + + qemu_mutex_lock_iothread(); qemu_thread_get_self(cpu->thread); - qemu_mutex_lock(&qemu_global_mutex); =20 cpu->thread_id =3D qemu_get_thread_id(); cpu->created =3D true; --=20 2.12.0.367.g23dc2f6d3c-goog