From patchwork Mon May 21 15:49:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 917709 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=walle.cc header.i=@walle.cc header.b="RQibRmiS"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qNZJ28brz9s3R for ; Tue, 22 May 2018 01:52:08 +1000 (AEST) Received: from localhost ([::1]:51268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKn6U-0004BI-2W for incoming@patchwork.ozlabs.org; Mon, 21 May 2018 11:52:06 -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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Alex Bennée --- 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) 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(); } 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(); } void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)