From: Atish Patra Date: Fri, 13 May 2022 22:14:58 +0000 (-0700) Subject: hw/intc: Pass correct hartid while updating mtimecmp X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=77046729f943ce2055648e8339ddd688dd67dd83;p=qemu.git hw/intc: Pass correct hartid while updating mtimecmp timecmp update function should be invoked with hartid for which timecmp is being updated. The following patch passes the incorrect hartid to the update function. Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLINT mtime MMIO register writable") Signed-off-by: Atish Patra Reviewed-by: Frank Chang Reviewed-by: Anup Patel Reviewed-by: Alistair Francis Message-Id: <20220513221458.1192933-1-atishp@rivosinc.com> Signed-off-by: Alistair Francis --- diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c index 0412edc982..e6bceceefd 100644 --- a/hw/intc/riscv_aclint.c +++ b/hw/intc/riscv_aclint.c @@ -233,7 +233,8 @@ static void riscv_aclint_mtimer_write(void *opaque, hwaddr addr, continue; } riscv_aclint_mtimer_write_timecmp(mtimer, RISCV_CPU(cpu), - i, env->timecmp); + mtimer->hartid_base + i, + env->timecmp); } return; }