[Bug 199739] with ARM_NEW_PMAP ptrace syscalls do not achieve icache consistency

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Apr 28 09:32:14 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199739

onwahe at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |onwahe at gmail.com

--- Comment #1 from onwahe at gmail.com ---
Thank you for your patch. While fixing it, I'm adding some tweaks. Someone with
commit bit, commit it please.

Index: sys/arm/arm/pmap-v6-new.c
===================================================================
--- sys/arm/arm/pmap-v6-new.c    (revision 282129)
+++ sys/arm/arm/pmap-v6-new.c    (working copy)
@@ -6094,13 +6094,13 @@


 /*
- *  Clean L1 data cache range on a single page, which is not mapped yet.
+ *  Clean L1 data cache range by physical address.
+ *  The range must be within a single page.
  */
 static void
 pmap_dcache_wb_pou(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma)
 {
     struct sysmaps *sysmaps;
-    vm_offset_t va;

     KASSERT(((pa & PAGE_MASK) + size) <= PAGE_SIZE,
         ("%s: not on single page", __func__));
@@ -6111,9 +6111,8 @@
     if (*sysmaps->CMAP3)
         panic("%s: CMAP3 busy", __func__);
     pte2_store(sysmaps->CMAP3, PTE2_KERN_NG(pa, PTE2_AP_KRW, ma));
-    va = (vm_offset_t)sysmaps->CADDR3;
-    tlb_flush_local(va);
-    dcache_wb_pou(va, size);
+    tlb_flush_local((vm_offset_t)sysmaps->CADDR3);
+    dcache_wb_pou((vm_offset_t)sysmaps->CADDR3 + (pa & PAGE_MASK), size);
     pte2_clear(sysmaps->CMAP3);
     sched_unpin();
     mtx_unlock(&sysmaps->lock);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-arm mailing list