From nobody Wed Feb 11 05:39:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665989560690536.2430080433792; Sun, 16 Oct 2022 23:52:40 -0700 (PDT) Received: from localhost ([::1]:36930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okJzG-0005dg-T4 for importer@patchew.org; Mon, 17 Oct 2022 02:52:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okJnB-0005XI-KJ for qemu-devel@nongnu.org; Mon, 17 Oct 2022 02:40:05 -0400 Received: from mail.loongson.cn ([114.242.206.163]:57854 helo=loongson.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okJmz-0002Sq-D7 for qemu-devel@nongnu.org; Mon, 17 Oct 2022 02:40:05 -0400 Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxhOSw+Exj8gMAAA--.86S7; Mon, 17 Oct 2022 14:39:48 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, stefanha@gmail.com, Xiaojuan Yang Subject: [PULL 5/5] hw/intc: Fix LoongArch ipi device emulation Date: Mon, 17 Oct 2022 14:39:44 +0800 Message-Id: <20221017063944.1443723-6-gaosong@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221017063944.1443723-1-gaosong@loongson.cn> References: <20221017063944.1443723-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8CxhOSw+Exj8gMAAA--.86S7 X-Coremail-Antispam: 1UD129KBjvdXoWrKr1kWw4xXFyUAr1UJr1xGrg_yoWkCFX_XF 12kFykGw42kw1jkw1rXr45Za48uw4ruF1fCF9rZFZ3t34Yq398Xr4rJw45ZrnIyrW5ur98 J3yIgrs0yr1v9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUUUUUUU X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ 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=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1665989562546100001 Content-Type: text/plain; charset="utf-8" From: Xiaojuan Yang In ipi_send function, it should not to set irq before writing data to dest cpu iocsr space, as the irq will trigger after data writing. When call this function 'address_space_stl()', it will trigger loongarch_ipi_writel(), the addr arg is 0x1008 ('CORE_SET_OFF'), and qemu_irq_raise will be called in this case. Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Message-Id: <20220930095139.867115-3-yangxiaojuan@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 4f3c58f872..aa4bf9eb74 100644 --- a/hw/intc/loongarch_ipi.c +++ b/hw/intc/loongarch_ipi.c @@ -88,7 +88,6 @@ static void ipi_send(uint64_t val) cs =3D qemu_get_cpu(cpuid); cpu =3D LOONGARCH_CPU(cs); env =3D &cpu->env; - loongarch_cpu_set_irq(cpu, IRQ_IPI, 1); address_space_stl(&env->address_space_iocsr, 0x1008, data, MEMTXATTRS_UNSPECIFIED, NULL); =20 --=20 2.31.1