Module Name: src
Committed By: skrll
Date: Fri Oct 8 07:17:32 UTC 2021
Modified Files:
src/sys/uvm/pmap: pmap_tlb.c
Log Message:
Fix a logic botch to actually apply the ASID limit returned by
pmap_md_tlb_asid_max.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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.46 src/sys/uvm/pmap/pmap_tlb.c:1.47
--- src/sys/uvm/pmap/pmap_tlb.c:1.46 Sat Oct 2 14:28:05 2021
+++ src/sys/uvm/pmap/pmap_tlb.c Fri Oct 8 07:17:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_tlb.c,v 1.46 2021/10/02 14:28:05 skrll Exp $ */
+/* $NetBSD: pmap_tlb.c,v 1.47 2021/10/08 07:17:32 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.46 2021/10/02 14:28:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.47 2021/10/08 07:17:32 skrll Exp $");
/*
* Manages address spaces in a TLB.
@@ -378,8 +378,9 @@ pmap_tlb_info_init(struct pmap_tlb_info
kcpuset_set(ti->ti_kcpuset, cpu_index(curcpu()));
#endif
- if (ti->ti_asid_max == 0) {
- ti->ti_asid_max = pmap_md_tlb_asid_max();
+ const tlb_asid_t asid_max = pmap_md_tlb_asid_max();
+ if (asid_max < ti->ti_asid_max) {
+ ti->ti_asid_max = asid_max;
ti->ti_asids_free = TLBINFO_ASID_INITIAL_FREE(ti->ti_asid_max);
}