Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm/pmap Add a KASSERT to check that tlb_asid_t is a lar...



details:   https://anonhg.NetBSD.org/src/rev/b20a1466e543
branches:  trunk
changeset: 371950:b20a1466e543
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Oct 20 06:24:51 2022 +0000

description:
Add a KASSERT to check that tlb_asid_t is a large enough type.

diffstat:

 sys/uvm/pmap/pmap_tlb.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r f4f30c2e419d -r b20a1466e543 sys/uvm/pmap/pmap_tlb.c
--- a/sys/uvm/pmap/pmap_tlb.c   Wed Oct 19 22:34:10 2022 +0000
+++ b/sys/uvm/pmap/pmap_tlb.c   Thu Oct 20 06:24:51 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_tlb.c,v 1.52 2022/03/04 08:11:48 skrll Exp $      */
+/*     $NetBSD: pmap_tlb.c,v 1.53 2022/10/20 06:24:51 skrll 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.52 2022/03/04 08:11:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.53 2022/10/20 06:24:51 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -384,6 +384,7 @@
                ti->ti_asids_free = TLBINFO_ASID_INITIAL_FREE(ti->ti_asid_max);
        }
 
+       KASSERT(__type_fit(tlb_asid_t, ti->ti_asid_max + 1));
        KASSERT(ti->ti_asid_max < PMAP_TLB_BITMAP_LENGTH);
 }
 



Home | Main Index | Thread Index | Old Index