From patchwork Mon May 21 12:20:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 917592 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="TOigpzpv"; 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 40qHvp6tgzz9s1w for ; Mon, 21 May 2018 22:21:57 +1000 (AEST) Received: from localhost ([::1]:50376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKjp5-0002GP-0D for incoming@patchwork.ozlabs.org; Mon, 21 May 2018 08:21:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKjoL-0002Fd-Vh for qemu-devel@nongnu.org; Mon, 21 May 2018 08:21:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKjoK-0007lf-Ee for qemu-devel@nongnu.org; Mon, 21 May 2018 08:21:09 -0400 Received: from ssl.serverraum.org ([2a01:4f8:222:d45::1:2]:57177) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fKjoK-0007lL-90; Mon, 21 May 2018 08:21:08 -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 7F79822D9B; Mon, 21 May 2018 14:21:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1526905266; bh=tbdv1n3UdamEC4aHldQB+MF+fKr412XKOYUfkn5gkeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TOigpzpvfquCL9sRK92FLvapIyR1fKr4ZH3DJG6ojl+lM5g8lQk9IXg7ncSlD9rMQ JwqAQwOCj1p17VdcPXp9YVQ6vALtnxVEK5O+VB2jJW1qbjvO2sHkTtzHEsu/hfO13c to9pYf0PTXksa/RgQNT6g2Nj5jTRiIHJ9Hj7V4p0= From: Michael Walle To: qemu-devel@nongnu.org Date: Mon, 21 May 2018 14:20:59 +0200 Message-Id: <20180521122100.22602-2-michael@walle.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180521122100.22602-1-michael@walle.cc> References: <20180521122100.22602-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: Genre and OS details not recognized. X-Received-From: 2a01:4f8:222:d45::1:2 Subject: [Qemu-devel] [PATCH v2 1/2] 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: Paolo Bonzini , Michael Walle , =?utf-8?q?Alex_Benn=C3=A9e?= , 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)