summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-03-13 00:39:45 +0000
committerdyson <dyson@FreeBSD.org>1996-03-13 00:39:45 +0000
commit665e2fe6cf04ae69ecb9a21ec49c4194aec40f15 (patch)
tree03cc64dd9dfe9a8c1ade647005bfbd57d9114cad /sys/amd64
parent788abb32883136336db17e5fa31912675c701682 (diff)
downloadFreeBSD-src-665e2fe6cf04ae69ecb9a21ec49c4194aec40f15.zip
FreeBSD-src-665e2fe6cf04ae69ecb9a21ec49c4194aec40f15.tar.gz
Make sure that we pmap_update AFTER modifying the page table entries.
The P6 can do a serious job of reordering code, and our stuff could execute incorrectly.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 879b69f..420b86a 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.79 1996/03/10 23:06:00 dyson Exp $
+ * $Id: pmap.c,v 1.80 1996/03/11 05:55:56 hsu Exp $
*/
/*
@@ -1457,9 +1457,9 @@ validate:
* to update the pte.
*/
if ((origpte & ~(PG_M|PG_U)) != newpte) {
+ *pte = (pt_entry_t) newpte;
if (origpte)
pmap_update_1pg(va);
- *pte = (pt_entry_t) newpte;
}
if (origpte == 0) {
@@ -1493,9 +1493,9 @@ pmap_qenter(va, m, count)
pt_entry_t npte = (pt_entry_t) ((int) (VM_PAGE_TO_PHYS(m[i]) | PG_RW | PG_V));
pt_entry_t opte;
pte = vtopte(tva);
- if ((opte = *pte) && (opte != npte))
- pmap_update_1pg(tva);
+ opte = *pte;
*pte = npte;
+ if (opte) pmap_update_1pg(tva);
}
}
/*
@@ -1529,13 +1529,13 @@ pmap_kenter(va, pa)
register vm_offset_t pa;
{
register pt_entry_t *pte;
- pt_entry_t npte;
+ pt_entry_t npte, opte;
npte = (pt_entry_t) ((int) (pa | PG_RW | PG_V));
pte = vtopte(va);
- if (*pte)
- pmap_update_1pg(va);
+ opte = *pte;
*pte = npte;
+ if (opte) pmap_update_1pg(va);
}
/*
OpenPOWER on IntegriCloud