git: 3e04ae433fdc - main - vm_radix_init: use initializer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 14 Jul 2023 06:51:28 UTC
The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=3e04ae433fdc4b47ff951667be15a360ca00ba8f commit 3e04ae433fdc4b47ff951667be15a360ca00ba8f Author: Doug Moore <dougm@FreeBSD.org> AuthorDate: 2023-07-14 06:49:55 +0000 Commit: Doug Moore <dougm@FreeBSD.org> CommitDate: 2023-07-14 06:49:55 +0000 vm_radix_init: use initializer Several vm_radix tries are not initialized with vm_radix_init. That works, for now, since static initialization zeroes the root field anyway, but if initialization changes, these tries will fail. Add missing initializer calls. Reviewed by: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D40971 --- sys/amd64/amd64/pmap.c | 1 + sys/arm64/arm64/pmap.c | 1 + sys/i386/i386/pmap.c | 1 + sys/riscv/riscv/pmap.c | 1 + sys/vm/vm_object.c | 1 + 5 files changed, 5 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 896078f3c456..a4b8c6dc4c06 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1993,6 +1993,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_ucr3 = PMAP_NO_CR3; TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_stats.resident_count = res; + vm_radix_init(&kernel_pmap->pm_root); kernel_pmap->pm_flags = pmap_flags; /* diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 46520889728f..c2681104c961 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1291,6 +1291,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) PMAP_LOCK_INIT(kernel_pmap); kernel_pmap->pm_l0_paddr = pmap_early_vtophys((vm_offset_t)kernel_pmap_store.pm_l0); + vm_radix_init(&kernel_pmap->pm_root); kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN); kernel_pmap->pm_stage = PM_STAGE1; kernel_pmap->pm_levels = 4; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 077c4329ecaa..fc1afdb708be 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -659,6 +659,7 @@ __CONCAT(PMTYPE, bootstrap)(vm_paddr_t firstaddr) CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ kernel_pmap->pm_stats.resident_count = res; TAILQ_INIT(&kernel_pmap->pm_pvchunk); + vm_radix_init(&kernel_pmap->pm_root); /* * Initialize the global pv list lock. diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index ac3565ce69b1..6cada93cdc91 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -646,6 +646,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_top = (pd_entry_t *)l1pt; PMAP_LOCK_INIT(kernel_pmap); + vm_radix_init(&kernel_pmap->pm_root); rw_init(&pvh_global_lock, "pmap pv global"); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index be81ad4942a4..3e9324da63ea 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -286,6 +286,7 @@ vm_object_init(void) mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF); rw_init(&kernel_object->lock, "kernel vm object"); + vm_radix_init(&kernel_object->rtree); _vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), OBJ_UNMANAGED, kernel_object, NULL); #if VM_NRESERVLEVEL > 0