Module Name: src
Committed By: jdolecek
Date: Sun Feb 25 21:43:03 UTC 2018
Modified Files:
src/sys/uvm/pmap: pmap_tlb.c
Log Message:
fix the DIAGNOSTIC function pmap_tlb_asid_count() to not expect
that TLBINFO_ASID_INUSE_P() returns just 0 or 1; the underlying
__BITMAP_ISSET() actually returns the matching bit nowadays, which
caused miscounting
fixes PR kern/53054 by Sevan Janiyan
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/uvm/pmap/pmap_tlb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.27 src/sys/uvm/pmap/pmap_tlb.c:1.28
--- src/sys/uvm/pmap/pmap_tlb.c:1.27 Sun Feb 25 16:44:31 2018
+++ src/sys/uvm/pmap/pmap_tlb.c Sun Feb 25 21:43:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $ */
+/* $NetBSD: pmap_tlb.c,v 1.28 2018/02/25 21:43:03 jdolecek Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.28 2018/02/25 21:43:03 jdolecek Exp $");
/*
* Manages address spaces in a TLB.
@@ -409,7 +409,8 @@ pmap_tlb_asid_count(struct pmap_tlb_info
{
size_t count = 0;
for (tlb_asid_t asid = 1; asid <= ti->ti_asid_max; asid++) {
- count += TLBINFO_ASID_INUSE_P(ti, asid);
+ if (TLBINFO_ASID_INUSE_P(ti, asid))
+ count++;
}
return count;
}