diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2018-04-14 02:04:20 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2018-04-14 02:04:20 +0000 |
commit | bd42a3afb2194d71f6df46c3bf36231d249dc9d6 (patch) | |
tree | 7c071f0499c686f7513ff5b07f3c11d7cc6e44d3 /sys/arch | |
parent | aa4dd7f5d687d9eccdb58788c5880630fa2882f2 (diff) |
account for the meltdown pdir page in pmap stats
ok deraadt, kettenis
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index b6535f5340c..e0afcab0c7d 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.111 2018/03/13 07:37:58 guenther Exp $ */ +/* $OpenBSD: pmap.c,v 1.112 2018/04/14 02:04:19 mlarkin Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -1136,6 +1136,7 @@ pmap_create(void) if (cpu_meltdown) { pmap->pm_pdir_intel = pool_get(&pmap_pdp_pool, PR_WAITOK); pmap_pdp_ctor_intel(pmap->pm_pdir_intel); + pmap->pm_stats.resident_count++; if (!pmap_extract(pmap_kernel(), (vaddr_t)pmap->pm_pdir_intel, &pmap->pm_pdirpa_intel)) panic("%s: unknown PA mapping for meltdown PML4\n", @@ -1202,8 +1203,10 @@ pmap_destroy(struct pmap *pmap) /* XXX: need to flush it out of other processor's space? */ pool_put(&pmap_pdp_pool, pmap->pm_pdir); - if (pmap->pm_pdir_intel) + if (pmap->pm_pdir_intel) { + pmap->pm_stats.resident_count--; pool_put(&pmap_pdp_pool, pmap->pm_pdir_intel); + } pool_put(&pmap_pmap_pool, pmap); } |