hw/riscv/riscv-iommu: Fix IOCOUNTINH.CY toggle detection
Fix IOCOUNTINH.CY toggle detection by comparing normalized CY bit rather than XORing whole register with boolean. Fixes: 2cf2a6c027ba ("hw/riscv/riscv-iommu: add IOCOUNTINH mmio writes") Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> Reviewed-by: Nutty Liu <nutty.liu@hotmail.com> Message-ID: <20260509074941.99295-1-fangyu.yu@linux.alibaba.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Fangyu Yu committed
May 9, 2026 at 15:49 UTC
f6d03ae4bbefaa684d440bcab1ab8096f17da913
1 file changed
+2
-1
hw/riscv/riscv-iommu-hpm.c
+2
-1
@@ -245,7 +245,8 @@ void riscv_iommu_process_iocntinh_cy(RISCVIOMMUState *s, bool prev_cy_inh)
245
s, RISCV_IOMMU_REG_IOCOUNTINH);
246
247
/* We only need to process CY bit toggle. */
248
- if (!(inhibit ^ prev_cy_inh)) {
248
+ bool cy_inh = !!(inhibit & RISCV_IOMMU_IOCOUNTINH_CY);
249
+ if (cy_inh == prev_cy_inh) {
250
return;
251
}
252