On 13/8/24 23:44, Richard Henderson wrote:
On 8/13/24 23:53, Philippe Mathieu-Daudé wrote:
@@ -607,11 +607,11 @@ static bool get_pte(CPUMIPSState *env, uint64_t vaddr, int entry_size,
  }
  static uint64_t get_tlb_entry_layout(CPUMIPSState *env, uint64_t entry,
-        int entry_size, int ptei)
+                                     MemOp op, int ptei)
  {
      uint64_t result = entry;
      uint64_t rixi;
-    if (ptei > entry_size) {
+    if (ptei > memop_size(op)) {

entry_size had been 32/64, now you're comparing against 4/8.

Doh good catch, thanks! I'm squashing:

-- >8 --
diff --git a/target/mips/tcg/sysemu/tlb_helper.c b/target/mips/tcg/sysemu/tlb_helper.c
index 7050ea78df..3836137750 100644
--- a/target/mips/tcg/sysemu/tlb_helper.c
+++ b/target/mips/tcg/sysemu/tlb_helper.c
@@ -614,9 +614,10 @@ static bool get_pte(CPUMIPSState *env, uint64_t vaddr, MemOp op,
 static uint64_t get_tlb_entry_layout(CPUMIPSState *env, uint64_t entry,
                                      MemOp op, int ptei)
 {
+    unsigned entry_size = memop_size(op) << 3;
     uint64_t result = entry;
     uint64_t rixi;
-    if (ptei > memop_size(op)) {
+    if (ptei > entry_size) {
         ptei -= 32;
     }
     result >>= (ptei - 2);
---

so this hunk becomes:

-- >8 --
@@ -607,8 +607,9 @@ static bool get_pte(CPUMIPSState *env, uint64_t vaddr, int entry_size,
 }

 static uint64_t get_tlb_entry_layout(CPUMIPSState *env, uint64_t entry,
-        int entry_size, int ptei)
+                                     MemOp op, int ptei)
 {
+    unsigned entry_size = memop_size(op) << 3;
     uint64_t result = entry;
     uint64_t rixi;
     if (ptei > entry_size) {
---

Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

Thanks!

Reply via email to