From nobody Mon Feb 9 08:16:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549903107312567.5351825041405; Mon, 11 Feb 2019 08:38:27 -0800 (PST) Received: from localhost ([127.0.0.1]:52505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtEb7-0006Jo-9H for importer@patchew.org; Mon, 11 Feb 2019 11:38:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtEW8-0002do-1M for qemu-devel@nongnu.org; Mon, 11 Feb 2019 11:33:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtEW5-0003dk-QV for qemu-devel@nongnu.org; Mon, 11 Feb 2019 11:33:11 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:49606 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtEW1-0002pL-QP for qemu-devel@nongnu.org; Mon, 11 Feb 2019 11:33:07 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 725721A216F; Mon, 11 Feb 2019 17:32:02 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 3B41F1A2131; Mon, 11 Feb 2019 17:32:02 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 17:31:22 +0100 Message-Id: <1549902684-21740-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549902684-21740-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1549902684-21740-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v3 4/6] target/mips: hold BQL in mips_vpe_wake() 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: pburton@wavecomp.com, arikalo@wavecomp.com, cota@braap.org, amarkovic@wavecomp.com, alex.bennee@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Goran Ferenc Hold BQL whenever mips_vpe_wake() is invoked. Without this patch, MIPS MT with MTTCG enabled triggers an abort in tcg_handle_interrupt() due to an unlocked access to cpu_interrupt(). This patch makes sure that the BQL is held in this case. Signed-off-by: Goran Ferenc Signed-off-by: Miodrag Dinic Signed-off-by: Aleksandar Markovic Acked-by: Alex Benn=C3=A9e Reviewed-by: Alex Benn=C3=A9e --- target/mips/op_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 8c53b3b..0f272a5 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -17,6 +17,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "cpu.h" #include "internal.h" #include "qemu/host-utils.h" @@ -638,7 +639,9 @@ static inline void mips_vpe_wake(MIPSCPU *c) /* Don't set ->halted =3D 0 directly, let it be done via cpu_has_work because there might be other conditions that state that c should be sleeping. */ + qemu_mutex_lock_iothread(); cpu_interrupt(CPU(c), CPU_INTERRUPT_WAKE); + qemu_mutex_unlock_iothread(); } =20 static inline void mips_vpe_sleep(MIPSCPU *cpu) --=20 2.7.4