summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-06-22 23:55:15 +0000
committerjake <jake@FreeBSD.org>2002-06-22 23:55:15 +0000
commit877630816bdbcfb9e2212712539b86240256192d (patch)
tree8ab93feecf18feb10fe0e7d3dd1e0d2812347b62 /sys
parentf6fd70168ffee23a494e79a8be3287feedf16199 (diff)
downloadFreeBSD-src-877630816bdbcfb9e2212712539b86240256192d.zip
FreeBSD-src-877630816bdbcfb9e2212712539b86240256192d.tar.gz
Fix a bug related to marking pages virtually uncacheable due to illegal
dcache aliasing. A page that already had more than 1 mapping of the same virtual colour would not be correctly uncached. Noticed by: Artur Grabowski <art@openbsd.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/sparc64/sparc64/pmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 22a7cb1..97f085e 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -586,8 +586,8 @@ pmap_cache_enter(vm_page_t m, vm_offset_t va)
CTR2(KTR_PMAP, "pmap_cache_enter: m=%p va=%#lx", m, va);
PMAP_STATS_INC(pmap_ncache_enter);
for (i = 0, c = 0; i < DCACHE_COLORS; i++) {
- if (i != DCACHE_COLOR(va))
- c += m->md.colors[i];
+ if (i != DCACHE_COLOR(va) && m->md.colors[i] != 0)
+ c++;
}
m->md.colors[DCACHE_COLOR(va)]++;
if (c == 0) {
@@ -595,7 +595,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_t va)
return (1);
}
PMAP_STATS_INC(pmap_ncache_enter_nc);
- if (c != 1) {
+ if ((m->md.flags & PG_UNCACHEABLE) != 0) {
CTR0(KTR_PMAP, "pmap_cache_enter: already uncacheable");
return (0);
}
@@ -626,7 +626,7 @@ pmap_cache_remove(vm_page_t m, vm_offset_t va)
if (m->md.colors[i] != 0)
c++;
}
- if (c != 1 || (m->md.flags & PG_UNCACHEABLE) == 0)
+ if (c > 1 || (m->md.flags & PG_UNCACHEABLE) == 0)
return;
STAILQ_FOREACH(tp, &m->md.tte_list, tte_link) {
tp->tte_data |= TD_CV;
OpenPOWER on IntegriCloud