Page MenuHomeFreeBSD

D37399.id113152.diff
No OneTemporary

D37399.id113152.diff

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5701,7 +5701,7 @@
pmap_t pmap;
struct rwlock *lock;
pv_entry_t next_pv, pv;
- pt_entry_t oldpte, *pte;
+ pt_entry_t oldpte, *pte, set, clear, rw_check;
vm_offset_t va;
int md_gen, pvh_gen;
@@ -5739,7 +5739,6 @@
}
TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
pmap = PV_PMAP(pv);
- PMAP_ASSERT_STAGE1(pmap);
if (!PMAP_TRYLOCK(pmap)) {
pvh_gen = pvh->pv_gen;
md_gen = m->md.pv_gen;
@@ -5755,13 +5754,23 @@
pte = pmap_pte_exists(pmap, pv->pv_va, 3, __func__);
oldpte = pmap_load(pte);
if ((oldpte & ATTR_SW_DBM) != 0) {
+ if (pmap->pm_stage == PM_STAGE1) {
+ set = ATTR_S1_AP_RW_BIT;
+ clear = 0;
+ rw_check = ATTR_S1_AP_RW_BIT;
+ } else {
+ set = 0;
+ clear = ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE);
+ rw_check = ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE);
+ }
+ clear |= ATTR_SW_DBM;
while (!atomic_fcmpset_64(pte, &oldpte,
- (oldpte | ATTR_S1_AP_RW_BIT) & ~ATTR_SW_DBM))
+ (oldpte | set) & ~clear))
cpu_spinwait();
- if ((oldpte & ATTR_S1_AP_RW_BIT) ==
- ATTR_S1_AP(ATTR_S1_AP_RW))
+
+ if ((oldpte & rw_check) != 0)
vm_page_dirty(m);
- pmap_s1_invalidate_page(pmap, pv->pv_va, true);
+ pmap_invalidate_page(pmap, pv->pv_va, true);
}
PMAP_UNLOCK(pmap);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 12, 12:53 PM (19 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15769535
Default Alt Text
D37399.id113152.diff (1 KB)

Event Timeline