From nobody Sat Apr 27 10:44:14 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.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152691798750761.87955821721641; Mon, 21 May 2018 08:53:07 -0700 (PDT) Received: from localhost ([::1]:51273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKn7L-0004q2-RE for importer@patchew.org; Mon, 21 May 2018 11:52:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKn5s-00049S-Gs for qemu-devel@nongnu.org; Mon, 21 May 2018 11:51:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKn5o-00047K-LX for qemu-devel@nongnu.org; Mon, 21 May 2018 11:51:28 -0400 Received: from ssl.serverraum.org ([213.133.101.245]:34727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fKn5o-00046q-Fi; Mon, 21 May 2018 11:51:24 -0400 Received: from thanatos.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:56be:f7ff:fe37:9af7]) (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 CC5B522D9B; Mon, 21 May 2018 17:51:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1526917882; bh=tbdv1n3UdamEC4aHldQB+MF+fKr412XKOYUfkn5gkeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQibRmiSSN/UEuywvRDUKm5rnArDj6g6UixY5F0vZjdkk3rH0dxQmBOgYIEy2tMSO DK9pBK1FM2urUMHQLTDnWKdUbrGbIXUF2IpfkYmv+ZcndbcvqJ07W/DRFicbn29gnZ STJ+nXY9wyE3P4E6nHWlY9URCCbLB59+YiJppXtA= From: Michael Walle To: qemu-devel@nongnu.org Date: Mon, 21 May 2018 17:49:52 +0200 Message-Id: <20180521154952.15421-2-michael@walle.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180521154952.15421-1-michael@walle.cc> References: <20180521154952.15421-1-michael@walle.cc> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.4 at web X-Virus-Status: Clean Content-Transfer-Encoding: quoted-printable 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] [PULL 1/1] 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 , Michael Walle , qemu-stable@nongnu.org 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-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 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e --- 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 577f8306e3..234d55e056 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