From nobody Tue Feb 10 02:01:18 2026 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.zohomail.com; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151637755986836.42626053231106; Fri, 19 Jan 2018 07:59:19 -0800 (PST) Received: from localhost ([::1]:56951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecZ4S-0003ys-6R for importer@patchew.org; Fri, 19 Jan 2018 10:59:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecZ2f-0002yW-GE for qemu-devel@nongnu.org; Fri, 19 Jan 2018 10:57:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecZ2c-00069g-O2 for qemu-devel@nongnu.org; Fri, 19 Jan 2018 10:57:21 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:49949 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 1ecZ2c-00069A-GB for qemu-devel@nongnu.org; Fri, 19 Jan 2018 10:57:18 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 2C8A51A4AF5; Fri, 19 Jan 2018 16:56:51 +0100 (CET) Received: from rtrkw774-lin.domain.local (unknown [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id CD1701A4AF3; Fri, 19 Jan 2018 16:56:50 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 19 Jan 2018 16:56:29 +0100 Message-Id: <1516377391-25945-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516377391-25945-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1516377391-25945-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH 5/7] 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 , Petar Jovanovic , Fam Zheng , Aleksandar Markovic , Yongbok Kim , Riku Voipio , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Goran Ferenc , Paolo Bonzini , Miodrag Dinic , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 --- 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 3830ee8..d512d8e 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" @@ -542,7 +543,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