From nobody Sat Nov 8 10:26:46 2025 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550167139453617.2645126180421; Thu, 14 Feb 2019 09:58:59 -0800 (PST) Received: from localhost ([127.0.0.1]:52538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guLHj-0003xT-9k for importer@patchew.org; Thu, 14 Feb 2019 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guL73-0004ap-AE for qemu-devel@nongnu.org; Thu, 14 Feb 2019 12:47:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guL6w-0004BG-Sx for qemu-devel@nongnu.org; Thu, 14 Feb 2019 12:47:51 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:52221 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 1guL6v-0003xt-Lc for qemu-devel@nongnu.org; Thu, 14 Feb 2019 12:47:45 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 4FA2F1A2272; Thu, 14 Feb 2019 18:47:32 +0100 (CET) Received: from rtrkw774-lin.mipstec.com (unknown [82.117.201.26]) by mail.rt-rk.com (Postfix) with ESMTPSA id 29F361A2271; Thu, 14 Feb 2019 18:47:32 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 18:47:13 +0100 Message-Id: <1550166444-22882-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550166444-22882-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1550166444-22882-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] [PULL 04/15] 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: peter.maydell@linaro.org, amarkovic@wavecomp.com 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