On 10/10/24 12:29, Richard Henderson wrote:
On 10/9/24 17:10, Pierrick Bouvier wrote:
+static bool tlbtree_hit(CPUState *cpu, int mmu_idx,
+                        MMUAccessType access_type, vaddr addr)
   {
-    size_t vidx;
+    CPUTLBDesc *desc = &cpu->neg.tlb.d[mmu_idx];
+    CPUTLBDescFast *fast = &cpu->neg.tlb.f[mmu_idx];
+    CPUTLBEntryTree *node;
+    size_t index;
       assert_cpu_is_self(cpu);
-    for (vidx = 0; vidx < CPU_VTLB_SIZE; ++vidx) {
-        CPUTLBEntry *vtlb = &cpu->neg.tlb.d[mmu_idx].vtable[vidx];
-        uint64_t cmp = tlb_read_idx(vtlb, access_type);
-
-        if (cmp == page) {
...
+    if (!tlb_hit(tlb_read_idx(&node->copy, access_type), addr)) {
+        /* This access is not permitted. */
+        return false;
+    }

This is not something we were checking before. If this is an addition, maybe it 
would be
better to split this out of this commit. Or maybe I missed a step in previous 
commits :)

It's there, with the comparison and page mask, but I agree it's not obvious.


r~

Subtle indeed, you don't expect & TARGET_PAGE_MASK to imply that protection is checked, even if that makes sense once said.

Reply via email to