Skip to content

Instantly share code, notes, and snippets.

@ryo
Created June 24, 2020 10:23
Show Gist options
  • Save ryo/df12211be09cf5343e2226e5f466e64b to your computer and use it in GitHub Desktop.
Save ryo/df12211be09cf5343e2226e5f466e64b to your computer and use it in GitHub Desktop.
@@ -947,10 +947,16 @@ pmap_icache_sync_range(pmap_t pm, vaddr_
void
pmap_procwr(struct proc *p, vaddr_t va, int len)
{
+ paddr_t pa;
+
+ if (p != curproc) {
+ struct pmap *pm = p->p_vmspace->vm_map.pmap;
+ if (!pmap_extract(pm, va, &pa))
+ return;
+ va = AARCH64_PA_TO_KVA(pa);
+ }
+ cpu_icache_sync_range(va, len);
- /* We only need to do anything if it is the current process. */
- if (p == curproc)
- cpu_icache_sync_range(va, len);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment