From nobody Wed Feb 11 02:10:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1656928185; cv=none; d=zohomail.com; s=zohoarc; b=NRDTBFhQ28Ho3/5Np0suNTfdJq6kj049+YUTeSa1OtkNA0ZUNQPYvuUlw75yJ6GiEG/XphRYnCd9OYLVYi7D8nliazYtfyUZhSmKeEn2afvp+pv3i8mnFtpWdvbVfz6xtWyhzNZ/f8ftUL3Qd1DH9iADCubh4YWNYKXSumuOm9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656928185; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3lzEaDmfWBOIKO+QxHmwCzDxckFSDPKrWYW1q3Ynj7E=; b=EFdvLDXRqNHvAaGrNSieTaV87tJbbEjm+UkUwPSukjVpLprh0n6TUg93pBtA2DOrMXWZoLBM4d1yC5sfp3bX4RnQdWpGIEQiSaEftKeyj5XSvd60Ghw7qMvESNWUzl8+pr/JrKG6Pz4/K+TU6HhwryqKMKT4c4VnS2YnERhjxJ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656928185437153.149746867992; Mon, 4 Jul 2022 02:49:45 -0700 (PDT) Received: from localhost ([::1]:37552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Ii5-0000vR-Qp for importer@patchew.org; Mon, 04 Jul 2022 05:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8ITy-0001pd-F9 for qemu-devel@nongnu.org; Mon, 04 Jul 2022 05:35:06 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:40854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8ITw-0004xx-Sa for qemu-devel@nongnu.org; Mon, 04 Jul 2022 05:35:06 -0400 Received: by mail-pj1-x1035.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so13079435pjl.5 for ; Mon, 04 Jul 2022 02:35:04 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z5-20020aa79e45000000b00525b7f3e906sm15353355pfq.27.2022.07.04.02.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 02:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3lzEaDmfWBOIKO+QxHmwCzDxckFSDPKrWYW1q3Ynj7E=; b=Eji8bBRYDTWYJYdbImHik9kX9A5g4ldA1bHlcaq/Bey9J4vuTJ6EQUP6WGnCCyfwv0 hpTw48oP/NSspwJFuyFnKZ4SMbOGMoNEXfxrxBrztyg458zV9qQ/HTjcmsufj4MXLruv LxKcsKUUTcZycejD3rB/P06XL0I8pY0WogiT4VuZK6nvpMsBdcI+u6xGGsf09g2jQOPJ P3Xfh2em8Dfedt/hecphxIX+wepqeCQucv/ud9t6HlLGEsg6q9ZLjmWx76tfObJc/AzP UAG184utEeRzGmQE0EicfUPmrZKbgM28ahIyelyM70LuWvm+/wfy/5qv0h63JQv7JTiT 6ixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3lzEaDmfWBOIKO+QxHmwCzDxckFSDPKrWYW1q3Ynj7E=; b=bPBe0nduQpHP5Lbt7uY0n2uykI/wWWSmxLBD4MisvJ3/KgL9Gy9jLvrrIuDeRW041a DBxEpOvw04WGGLEXTgoHeFDxxQHk1bwDEy3U670thx14xiii08E8T2lDk4AVMDNHlLGq jpfUESFMjxkCM5jvuFmbEjgnrskji0Er11o2ijssorhXh20ng2lq5dtWgaCcgefRWH8J 6hlxyXqKt5lZE+kH11U2hR35iuJ07jyAY6cgT1dZcVIKYAcvP5LxZBklNaV9Ro5fb38D kXlkVMEdz9kzkvEAJOXr4rco31WHZvcVOEbEUL4s7F20uBys5E5DE+qOOd3ignAVIC7G 3KMw== X-Gm-Message-State: AJIora8wCSUloTulMyDGevCXG/Aq1L/8vCFy8M/bNxhE/tUALsNOT/H7 0qZrfBT3a4cZtzgKvDTNME4JMrVv/QSYdnKs X-Google-Smtp-Source: AGRyM1tS+Dp6TBV34FUlS6LL4hPr8eLQ42DC8FLjy0AGyANW+LbJBB+nNMZgKMPcnqfLSck8mTLvrw== X-Received: by 2002:a17:90a:8b8f:b0:1ef:9130:f96c with SMTP id z15-20020a17090a8b8f00b001ef9130f96cmr113627pjn.20.1656927304149; Mon, 04 Jul 2022 02:35:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Xiaojuan Yang Subject: [PULL 23/23] target/loongarch: Add lock when writing timer clear reg Date: Mon, 4 Jul 2022 15:03:57 +0530 Message-Id: <20220704093357.983255-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220704093357.983255-1-richard.henderson@linaro.org> References: <20220704093357.983255-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1656928187656100001 Content-Type: text/plain; charset="utf-8" From: Xiaojuan Yang There is such error info when running linux kernel: tcg_handle_interrupt: assertion failed: (qemu_mutex_iothread_locked()). calling stack: #0 in raise () at /lib64/libc.so.6 #1 in abort () at /lib64/libc.so.6 #2 in g_assertion_message_expr.cold () at /lib64/libglib-2.0.so.0 #3 in g_assertion_message_expr () at /lib64/libglib-2.0.so.0 #4 in tcg_handle_interrupt (cpu=3D0x632000030800, mask=3D2) at ../accel= /tcg/tcg-accel-ops.c:79 #5 in cpu_interrupt (cpu=3D0x632000030800, mask=3D2) at ../softmmu/cpus= .c:248 #6 in loongarch_cpu_set_irq (opaque=3D0x632000030800, irq=3D11, level= =3D0) at ../target/loongarch/cpu.c:100 #7 in helper_csrwr_ticlr (env=3D0x632000039440, val=3D1) at ../target/l= oongarch/csr_helper.c:85 #8 in code_gen_buffer () #9 in cpu_tb_exec (cpu=3D0x632000030800, itb=3D0x7fff946ac280, tb_exit= =3D0x7ffe4fcb6c30) at ../accel/tcg/cpu-exec.c:358 Add mutex iothread lock around loongarch_cpu_set_irq in csrwr_ticlr() to fix the bug. Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Message-Id: <20220701093407.2150607-10-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson --- target/loongarch/csr_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/csr_helper.c b/target/loongarch/csr_helper.c index 24a9389364..7e02787895 100644 --- a/target/loongarch/csr_helper.c +++ b/target/loongarch/csr_helper.c @@ -81,7 +81,9 @@ target_ulong helper_csrwr_ticlr(CPULoongArchState *env, t= arget_ulong val) int64_t old_v =3D 0; =20 if (val & 0x1) { + qemu_mutex_lock_iothread(); loongarch_cpu_set_irq(cpu, IRQ_TIMER, 0); + qemu_mutex_unlock_iothread(); } return old_v; } --=20 2.34.1