From: Richard Henderson <[email protected]>

In b79a9b6e5b, we stopped using TLB_MMIO for user-only plugins,
but erroneously thought we were already doing the same for system.
Do that now.

Cc: [email protected]
Signed-off-by: Richard Henderson <[email protected]>
(cherry picked from commit cab8663761943141f8fd75dddc99255fe2cb45c4)
(Mjt: b79a9b6e5b is commit v10.0.11-53-gff4ef54ebce8 in 10.0.x)
Signed-off-by: Michael Tokarev <[email protected]>

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index fb22048876e..6ebd1007dd9 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1363,7 +1363,6 @@ static int probe_access_internal(CPUState *cpu, vaddr 
addr,
     uint64_t tlb_addr = tlb_read_idx(entry, access_type);
     vaddr page_addr = addr & TARGET_PAGE_MASK;
     int flags = TLB_FLAGS_MASK & ~TLB_FORCE_SLOW;
-    bool force_mmio = check_mem_cbs && cpu_plugin_mem_cbs_enabled(cpu);
     CPUTLBEntryFull *full;
 
     if (!tlb_hit_page(tlb_addr, page_addr)) {
@@ -1393,16 +1392,13 @@ static int probe_access_internal(CPUState *cpu, vaddr 
addr,
 
     *pfull = full = &cpu->neg.tlb.d[mmu_idx].fulltlb[index];
     flags |= full->slow_flags[access_type];
-
-    /* Fold all "mmio-like" bits into TLB_MMIO.  This is not RAM.  */
-    if (unlikely(flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY | TLB_CHECK_ALIGNED))
-        || (access_type != MMU_INST_FETCH && force_mmio)) {
-        *phost = NULL;
-        return TLB_MMIO;
+    if (check_mem_cbs && cpu_plugin_mem_cbs_enabled(cpu)) {
+        flags |= TLB_FORCE_SLOW;
     }
 
-    /* Everything else is RAM. */
-    *phost = (void *)((uintptr_t)addr + entry->addend);
+    *phost = (flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY | TLB_CHECK_ALIGNED)
+              ? NULL
+              : (void *)((uintptr_t)addr + entry->addend));
     return flags;
 }
 
-- 
2.47.3


Reply via email to