From nobody Wed Sep 30 15:31:49 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790751727478247.61792095882674; Wed, 30 Sep 2026 00:02:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJg-0000s0-9K; Wed, 30 Sep 2026 03:01:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBoJb-0000pF-PE for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:19 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJZ-0006a1-1Q for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:19 -0400 Received: from loongson.cn (unknown [10.40.46.54]) by gateway (Coremail) with SMTP id _____8Bx79K3s7xqoEIRAA--.50906S3; Wed, 30 Sep 2026 15:01:11 +0800 (CST) Received: from fedora.loongson.cn (unknown [10.40.46.54]) by front1 (Coremail) with SMTP id qMiowJCxOs6ws7xqq+MmAA--.53251S3; Wed, 30 Sep 2026 15:01:06 +0800 (CST) From: Bibo Mao To: qemu-devel@nongnu.org Cc: xiaoqiang zhao , xiaoqiang zhao Subject: [PULL 1/4] tests/acpi: Allow SPCR acpi table changes Date: Wed, 30 Sep 2026 15:02:24 +0800 Message-ID: <20260930070227.1079521-2-maobibo@loongson.cn> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260930070227.1079521-1-maobibo@loongson.cn> References: <20260930070227.1079521-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCxOs6ws7xqq+MmAA--.53251S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoWruryfAF43Kw1kJFW7Xr4xAFc_yoW3CFXEqF 4Iq3Z5GF17AF4ktrW8CF4kZryUC3W3Aw48ur1ayFsag3yxJ34UJasYq3Z5Aa43urZxCFW2 qw1kZrW29FWUAosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb28YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07URa0PUUUUU= 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=lists1p.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=maobibo@loongson.cn; helo=mail.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_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1790751729514158500 Content-Type: text/plain; charset="utf-8" From: xiaoqiang zhao For easier bisection add the SPCR table to bios-tables-test-allowed-diff.h Reviewed-by: Bibo Mao Signed-off-by: xiaoqiang zhao Signed-off-by: Bibo Mao --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..53702282e5 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +tests/data/acpi/loongarch64/virt/SPCR --=20 2.54.0 From nobody Wed Sep 30 15:31:49 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790751725007885.7062064450889; Wed, 30 Sep 2026 00:02:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJh-0000t8-3L; Wed, 30 Sep 2026 03:01:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBoJc-0000pO-9Y for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:20 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJZ-0006Zu-Gw for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:19 -0400 Received: from loongson.cn (unknown [10.40.46.54]) by gateway (Coremail) with SMTP id _____8AxX9O4s7xqpEIRAA--.50382S3; Wed, 30 Sep 2026 15:01:12 +0800 (CST) Received: from fedora.loongson.cn (unknown [10.40.46.54]) by front1 (Coremail) with SMTP id qMiowJCxOs6ws7xqq+MmAA--.53251S4; Wed, 30 Sep 2026 15:01:11 +0800 (CST) From: Bibo Mao To: qemu-devel@nongnu.org Cc: xiaoqiang zhao , xiaoqiang zhao Subject: [PULL 2/4] hw/loongarch/virt: Fix SPCR bitwidth value Date: Wed, 30 Sep 2026 15:02:25 +0800 Message-ID: <20260930070227.1079521-3-maobibo@loongson.cn> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260930070227.1079521-1-maobibo@loongson.cn> References: <20260930070227.1079521-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCxOs6ws7xqq+MmAA--.53251S4 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail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DU0xZFpf9x07j83kZUUUUU= 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=lists1p.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=maobibo@loongson.cn; helo=mail.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_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1790751727283158500 Content-Type: text/plain; charset="utf-8" From: xiaoqiang zhao Serial base_addr.width should be 8 instead of 32. The wrong reported data will cause ADE in FreeBSD console initialize process and trigger a reset loop. Reviewed-by: Bibo Mao Signed-off-by: xiaoqiang zhao Signed-off-by: Bibo Mao --- hw/loongarch/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c index 600ef60fc5..54965f011d 100644 --- a/hw/loongarch/virt-acpi-build.c +++ b/hw/loongarch/virt-acpi-build.c @@ -268,7 +268,7 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, Mach= ineState *machine) AcpiSpcrData serial =3D { .interface_type =3D 0, /* 16550 compatible */ .base_addr.id =3D AML_AS_SYSTEM_MEMORY, - .base_addr.width =3D 32, + .base_addr.width =3D 8, .base_addr.offset =3D 0, .base_addr.size =3D 1, .base_addr.addr =3D VIRT_UART_BASE, --=20 2.54.0 From nobody Wed Sep 30 15:31:49 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179075171311383.65974010480772; Wed, 30 Sep 2026 00:01:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJn-0001Sy-Vh; Wed, 30 Sep 2026 03:01:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBoJl-0001H8-DV for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:29 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJj-0006bI-CD for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:29 -0400 Received: from loongson.cn (unknown [10.40.46.54]) by gateway (Coremail) with SMTP id _____8AxX9O8s7xqq0IRAA--.50384S3; Wed, 30 Sep 2026 15:01:16 +0800 (CST) Received: from fedora.loongson.cn (unknown [10.40.46.54]) by front1 (Coremail) with SMTP id qMiowJCxOs6ws7xqq+MmAA--.53251S5; Wed, 30 Sep 2026 15:01:12 +0800 (CST) From: Bibo Mao To: qemu-devel@nongnu.org Cc: xiaoqiang zhao , xiaoqiang zhao Subject: [PULL 3/4] tests/acpi: Update SPCR loongarch64 test data Date: Wed, 30 Sep 2026 15:02:26 +0800 Message-ID: <20260930070227.1079521-4-maobibo@loongson.cn> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260930070227.1079521-1-maobibo@loongson.cn> References: <20260930070227.1079521-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCxOs6ws7xqq+Mm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I42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU7MmhUUUUU 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=lists1p.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=maobibo@loongson.cn; helo=mail.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_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1790751715570158501 Content-Type: text/plain; charset="utf-8" From: xiaoqiang zhao diffs from "iasl -d": * ACPI Data Table [SPCR] * @@ -13,7 +13,7 @@ [000h 0000 004h] Signature : "SPCR" [Serial Port Console Redirection Table] [004h 0004 004h] Table Length : 00000050 [008h 0008 001h] Revision : 02 -[009h 0009 001h] Checksum : C1 +[009h 0009 001h] Checksum : D9 [00Ah 0010 006h] Oem ID : "BOCHS " [010h 0016 008h] Oem Table ID : "BXPC " [018h 0024 004h] Oem Revision : 00000001 @@ -25,7 +25,7 @@ [028h 0040 00Ch] Serial Port Register : [Generic Address Structure] [028h 0040 001h] Space ID : 00 [SystemMemory] -[029h 0041 001h] Bit Width : 20 +[029h 0041 001h] Bit Width : 08 [02Ah 0042 001h] Bit Offset : 00 [02Bh 0043 001h] Encoded Access Width : 01 [Byte Access:8] [02Ch 0044 008h] Address : 000000001FE001E0 Reviewed-by: Bibo Mao Signed-off-by: xiaoqiang zhao Signed-off-by: Bibo Mao --- tests/data/acpi/loongarch64/virt/SPCR | Bin 80 -> 80 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/loongarch64/virt/SPCR b/tests/data/acpi/loonga= rch64/virt/SPCR index 7bb819cd0d2ad20269e40e4a738709a45260cbb2..773433f240eced67530109035ef= 78a99945472d2 100644 GIT binary patch delta 21 ccmWFt;0g|K4hmpkU|_mAkxQPDW1^NC05!G*vH$=3D8 delta 21 ccmWFt;0g|K4hmpkU|>2pkxQOYVWO5A05v`YvH$=3D8 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 53702282e5..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -tests/data/acpi/loongarch64/virt/SPCR --=20 2.54.0 From nobody Wed Sep 30 15:31:49 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790751703047681.999001111457; Wed, 30 Sep 2026 00:01:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJg-0000s2-DT; Wed, 30 Sep 2026 03:01:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBoJe-0000qG-W0 for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:23 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBoJc-0006aV-VU for qemu-devel@nongnu.org; Wed, 30 Sep 2026 03:01:22 -0400 Received: from loongson.cn (unknown [10.40.46.54]) by gateway (Coremail) with SMTP id _____8CxutG_s7xqrUIRAA--.50532S3; Wed, 30 Sep 2026 15:01:19 +0800 (CST) Received: from fedora.loongson.cn (unknown [10.40.46.54]) by front1 (Coremail) with SMTP id qMiowJDxE+S+s7xqs+MmAA--.53665S2; Wed, 30 Sep 2026 15:01:18 +0800 (CST) From: Bibo Mao To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 4/4] target/loongarch: Set CPU_INTERRUPT_HARD unless no pending irq Date: Wed, 30 Sep 2026 15:02:27 +0800 Message-ID: <20260930070227.1079521-5-maobibo@loongson.cn> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260930070227.1079521-1-maobibo@loongson.cn> References: <20260930070227.1079521-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJDxE+S+s7xqs+MmAA--.53665S2 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoWxZw1DZrWrXw1DJryxGFyDArc_yoW5uF17pr W7uFnFqw48GrWDZa4DKas8Wrn8Zr47Ww1a9an3K34fCFW5Xryjqr1kt39F9F4DG3s8WrWj qF1Fy3WUZa18ZFgCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcCD7UUUUU 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=lists1p.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=maobibo@loongson.cn; helo=mail.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_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1790751706935158500 On LoongArch CPU_INTERRUPT_HARD is set only when interrupt is injected at the first time. Function cpu_interrupt() is not called if there is pending irq already, this will not set CPU_INTERRUPT_HARD bit and kick dest CPU, however QEMU TCG framework will clear exception_index when handling IRQ flow. There will be new interrupt lost issue when handling old one, the similar with other architectures call cpu_interrupt() always if there is pending interrupt. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/loongarch/cpu.c | 14 ++++---------- target/loongarch/internals.h | 2 +- target/loongarch/tcg/csr_helper.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f22f64efb8..54c2699897 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -58,20 +58,16 @@ static vaddr loongarch_cpu_get_pc(CPUState *cs) #ifndef CONFIG_USER_ONLY #include "hw/loongarch/virt.h" =20 -void loongarch_cpu_update_irq(LoongArchCPU *cpu, uint64_t old) +void loongarch_cpu_update_irq(LoongArchCPU *cpu) { CPULoongArchState *env =3D &cpu->env; CPUState *cs =3D CPU(cpu); CPUSysState *sys =3D env_sys(env); =20 if (FIELD_EX64(sys->CSR_ESTAT, CSR_ESTAT, IS)) { - if (!FIELD_EX64(old, CSR_ESTAT, IS)) { - cpu_interrupt(cs, CPU_INTERRUPT_HARD); - } + cpu_interrupt(cs, CPU_INTERRUPT_HARD); } else { - if (FIELD_EX64(old, CSR_ESTAT, IS)) { - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } } =20 @@ -81,13 +77,11 @@ static void loongarch_cpu_self_set_irq(CPUState *cs, ru= n_on_cpu_data data) CPULoongArchState *env =3D cpu_env(cs); CPUSysState *sys =3D env_sys(env); int irq, level; - uint64_t old; =20 irq =3D data.host_int & ~BIT(31); level =3D (data.host_int >> 31) & 1; - old =3D sys->CSR_ESTAT; sys->CSR_ESTAT =3D deposit64(sys->CSR_ESTAT, irq, 1, level !=3D 0); - loongarch_cpu_update_irq(cpu, old); + loongarch_cpu_update_irq(cpu); } =20 void loongarch_cpu_set_irq(void *opaque, int irq, int level) diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h index f9a0680fe0..ff956823fd 100644 --- a/target/loongarch/internals.h +++ b/target/loongarch/internals.h @@ -31,7 +31,7 @@ void restore_fp_status(CPULoongArchState *env); #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_loongarch_cpu; =20 -void loongarch_cpu_update_irq(LoongArchCPU *cpu, uint64_t old); +void loongarch_cpu_update_irq(LoongArchCPU *cpu); void loongarch_cpu_set_irq(void *opaque, int irq, int level); =20 void cpu_loongarch_timer_cb(void *opaque); diff --git a/target/loongarch/tcg/csr_helper.c b/target/loongarch/tcg/csr_h= elper.c index 88656b5344..1a6919417f 100644 --- a/target/loongarch/tcg/csr_helper.c +++ b/target/loongarch/tcg/csr_helper.c @@ -111,7 +111,7 @@ target_ulong helper_csrwr_estat(CPULoongArchState *env,= target_ulong val) */ if (sys->CSR_ESTAT !=3D old_v) { bql_lock(); - loongarch_cpu_update_irq(env_archcpu(env), old_v); + loongarch_cpu_update_irq(env_archcpu(env)); bql_unlock(); } =20 --=20 2.54.0