In pmap_enter(), sync the instruction cache if VM_PROT_EXECUTE. Fixes

problems when executing programs where text is copied to a page without
a dma sync (like NFS data bcopy'd to a buffer cache page).

From discussion with Jason Thorpe and Eduardo Horvath.
This commit is contained in:
simonb 2001-11-06 04:49:49 +00:00
parent cd86b27aad
commit 15a42388c0
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.5 2001/09/11 04:35:43 eeh Exp $ */
/* $NetBSD: pmap.c,v 1.6 2001/11/06 04:49:49 simonb Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -935,6 +935,11 @@ pmap_enter(struct pmap *pm, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags)
ppc4xx_tlb_enter(pm->pm_ctx, va, tte);
}
splx(s);
/* Flush the real memory from the instruction cache. */
if ((prot & VM_PROT_EXECUTE) && (tte & TTE_I) == 0)
__syncicache((void *)pa, PAGE_SIZE);
return 0;
}