Skip to contentSkip to conversation

hw/intc: Pass correct hartid while updating mtimecmp

PATCH Applied Atish Patra 4 participants 5 messages May 13, 2022 – May 16, 2022 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 hw/intc/riscv_aclint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/riscv_aclint.c +2 -1
index 0412edc98257..e6bceceefdbc 100644
@@ -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;
     }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Atish Patra

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")

---
 hw/intc/riscv_aclint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/riscv_aclint.c +2 -1
index 0412edc98257..e6bceceefdbc 100644
@@ -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;
     }

--
2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Atish Patra
Quoted 8 lines · Atish Patra

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")

Looks good to me.

Regards,
Anup

Quoted 22 lines
---
 hw/intc/riscv_aclint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/riscv_aclint.c +2 -2
index 0412edc98257..e6bceceefdbc 100644
@@ -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;
     }
--

2.25.1

Reviewed-by on v1 1/1
#3 lore raw
In reply to Atish Patra
Quoted 8 lines · Atish Patra

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")

Alistair

Quoted 22 lines
---
 hw/intc/riscv_aclint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/riscv_aclint.c +2 -2
index 0412edc98257..e6bceceefdbc 100644
@@ -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;
     }
--

2.25.1

#4 lore raw
In reply to Atish Patra
Quoted 8 lines · Atish Patra

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")

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 22 lines
---
 hw/intc/riscv_aclint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/riscv_aclint.c +2 -2
index 0412edc98257..e6bceceefdbc 100644
@@ -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;
     }
--

2.25.1