From nobody Sun Oct 26 01:42:38 2025 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; 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 1515517709731939.3855964005306; Tue, 9 Jan 2018 09:08:29 -0800 (PST) Received: from localhost ([::1]:35018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYxO0-0002dL-Vf for importer@patchew.org; Tue, 09 Jan 2018 12:08:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYxJE-0007bc-1Q for qemu-devel@nongnu.org; Tue, 09 Jan 2018 12:03:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYxJA-0007Hr-Sx for qemu-devel@nongnu.org; Tue, 09 Jan 2018 12:03:32 -0500 Received: from ssl.serverraum.org ([213.133.101.245]:36235) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYxJA-0007HC-MO; Tue, 09 Jan 2018 12:03:28 -0500 Received: from mwalle01.sab.local. (unknown [213.135.10.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id B055D22234; Tue, 9 Jan 2018 18:03:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1515517406; bh=iaIl+EaLJKBAYwX6sHVarOB1mt5KzA57VgdDgYDtbDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZPSrxg7sIqtrmtdtDkjAKw0dsokoy47bEMGeHnhr+Hsd7udUYZBUSJX5//R7NFEds +lHKaJ5fo+7ePU+WAQJRuwNOGBdWga685xkCOL83b/io54GR6vJ2b+08j2YkrpfHNu ISt+ibZDq/Cc0ygPiR0i2yTGUTd3TvUIP5o7ooBU= From: Michael Walle To: qemu-devel@nongnu.org Date: Tue, 9 Jan 2018 18:01:13 +0100 Message-Id: <20180109170113.20768-1-michael@walle.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.99.2 at web X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 213.133.101.245 Subject: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register 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, Michael Walle , qemu-stable@nongnu.org, Programmingkid Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Walle Reviewed-by: Alex Benn=C3=A9e Tested-by: Philippe Mathieu-Daud=C3=A9 --- target/lm32/op_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c index 30f670eee8..a766a1ece4 100644 --- a/target/lm32/op_helper.c +++ b/target/lm32/op_helper.c @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc) =20 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) { + qemu_mutex_lock_iothread(); lm32_pic_set_im(env->pic_state, im); + qemu_mutex_unlock_iothread(); } =20 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) { + qemu_mutex_lock_iothread(); lm32_pic_set_ip(env->pic_state, im); + qemu_mutex_unlock_iothread(); } =20 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx) --=20 2.11.0