mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Turn pmap_install_pte() into a critical section. We better not get
interrupted while writing into the VHPT table. While here, make sure memory accesses a properly ordered. Tag invalidation must happen first so that the hardware VHPT walker will not be able to match this entry while we're updating it and we have to make sure the new new tag gets written only after the PTE is completely updated. Approved by: re (blanket)
This commit is contained in:
parent
3467e8b8a0
commit
b8c4149cff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115152
@ -719,18 +719,24 @@ pmap_install_pte(struct ia64_lpte *vhpte, struct ia64_lpte *pte)
|
||||
{
|
||||
u_int64_t *vhp, *p;
|
||||
|
||||
/* invalidate the pte */
|
||||
atomic_set_64(&vhpte->pte_tag, 1L << 63);
|
||||
ia64_mf(); /* make sure everyone sees */
|
||||
vhp = (u_int64_t *)vhpte;
|
||||
p = (u_int64_t *)pte;
|
||||
|
||||
vhp = (u_int64_t *) vhpte;
|
||||
p = (u_int64_t *) pte;
|
||||
critical_enter();
|
||||
|
||||
/* Invalidate the tag so the VHPT walker will not match this entry. */
|
||||
vhp[2] = 1UL << 63;
|
||||
ia64_mf();
|
||||
|
||||
vhp[0] = p[0];
|
||||
vhp[1] = p[1];
|
||||
vhp[2] = p[2]; /* sets ti to one */
|
||||
|
||||
ia64_mf();
|
||||
|
||||
/* Install a proper tag now that we're done. */
|
||||
vhp[2] = p[2];
|
||||
ia64_mf();
|
||||
|
||||
critical_exit();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user