[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.2.1 10/41] hw/intc/riscv_aplic: Fix APLIC in_clrip and clripnu
From: |
Michael Tokarev |
Subject: |
[Stable-9.2.1 10/41] hw/intc/riscv_aplic: Fix APLIC in_clrip and clripnum write emulation |
Date: |
Mon, 27 Jan 2025 17:17:24 +0300 |
From: Yong-Xuan Wang <yongxuan.wang@sifive.com>
In the section "4.7 Precise effects on interrupt-pending bits"
of the RISC-V AIA specification defines that:
"If the source mode is Level1 or Level0 and the interrupt domain
is configured in MSI delivery mode (domaincfg.DM = 1):
The pending bit is cleared whenever the rectified input value is
low, when the interrupt is forwarded by MSI, or by a relevant
write to an in_clrip register or to clripnum."
Update the riscv_aplic_set_pending() to match the spec.
Fixes: bf31cf06eb ("hw/intc/riscv_aplic: Fix setipnum_le write emulation for
APLIC MSI-mode")
Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20241029085349.30412-1-yongxuan.wang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 0d0141fadc9063e527865ee420b2baf34e306093)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c
index 4a262c82f0..74c82a8411 100644
--- a/hw/intc/riscv_aplic.c
+++ b/hw/intc/riscv_aplic.c
@@ -248,9 +248,12 @@ static void riscv_aplic_set_pending(RISCVAPLICState *aplic,
if ((sm == APLIC_SOURCECFG_SM_LEVEL_HIGH) ||
(sm == APLIC_SOURCECFG_SM_LEVEL_LOW)) {
- if (!aplic->msimode || (aplic->msimode && !pending)) {
+ if (!aplic->msimode) {
return;
}
+ if (aplic->msimode && !pending) {
+ goto noskip_write_pending;
+ }
if ((aplic->state[irq] & APLIC_ISTATE_INPUT) &&
(sm == APLIC_SOURCECFG_SM_LEVEL_LOW)) {
return;
@@ -261,6 +264,7 @@ static void riscv_aplic_set_pending(RISCVAPLICState *aplic,
}
}
+noskip_write_pending:
riscv_aplic_set_pending_raw(aplic, irq, pending);
}
--
2.39.5
- [Stable-9.2.1 31/41] backends/cryptodev-vhost-user: Fix local_error leaks, (continued)
- [Stable-9.2.1 31/41] backends/cryptodev-vhost-user: Fix local_error leaks, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 35/41] tests: acpi: whitelist expected blobs, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 34/41] pci/msix: Fix msix pba read vector poll end calculation, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 09/41] target/i386: Reset TSCs of parked vCPUs too on VM reset, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 03/41] tcg/riscv: Fix StoreStore barrier generation, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 04/41] x86/loader: only patch linux kernels, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 30/41] tests/qtest/boot-serial-test: Correct HPPA machine name, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 32/41] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 33/41] pci: ensure valid link status bits for downstream ports, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 14/41] docs: Correct release of TCG trace-events removal, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 10/41] hw/intc/riscv_aplic: Fix APLIC in_clrip and clripnum write emulation,
Michael Tokarev <=
- [Stable-9.2.1 07/41] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 13/41] docs: Correct '-runas' and '-fsdev/-virtfs proxy' indentation, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 15/41] target/i386/cpu: Fix notes for CPU models, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 12/41] target/loongarch: Use actual operand size with vbsrl check, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 17/41] migration/multifd: Fix compat with QEMU < 9.0, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 22/41] migration: Rename vmstate_info_nullptr, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 16/41] migration/multifd: Fix compile error caused by page_size usage, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 20/41] migration: Fix parsing of s390 stream, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 19/41] migration: Remove unused argument in vmsd_desc_field_end, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 18/41] migration: Add more error handling to analyze-migration.py, Michael Tokarev, 2025/01/27