diff options
author | Mark Johnston <markj@FreeBSD.org> | 2020-05-28 19:41:00 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2020-05-28 19:41:00 +0000 |
commit | 81302f1d777f8f76c378a5afaab432f7c0bc2ae4 (patch) | |
tree | 56479d0100a8a768c01f55b1d5fc21bea1362901 /sys/amd64 | |
parent | 537ab183062ac9d8a5037441b2cbed87924b7e00 (diff) | |
download | src-81302f1d777f8f76c378a5afaab432f7c0bc2ae4.tar.gz src-81302f1d777f8f76c378a5afaab432f7c0bc2ae4.zip |
Fix boot on systems where NUMA domain 0 is unpopulated.
- Add vm_phys_early_add_seg(), complementing vm_phys_early_alloc(), to
ensure that segments registered during hammer_time() are placed in the
right domain. Otherwise, since the SRAT is not parsed at that point,
we just add them to domain 0, which may be incorrect and results in a
domain with only several MB worth of memory.
- Fix uma_startup1() to try allocating memory for zones from any domain.
If domain 0 is unpopulated, the allocation will simply fail, resulting
in a page fault slightly later during boot.
- Change _vm_phys_domain() to return -1 for addresses not covered by the
affinity table, and change vm_phys_early_alloc() to handle wildcard
domains. This is necessary on amd64, where the page array is dense
and pmap_page_array_startup() may allocate page table pages for
non-existent page frames.
Reported and tested by: Rafael Kitover <rkitover@gmail.com>
Reviewed by: cem (earlier version), kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25001
Notes
Notes:
svn path=/head/; revision=361595
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 0c619a06daf9..239b4baaca60 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1223,7 +1223,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) * Tell the physical memory allocator about pages used to store * the kernel and preloaded data. See kmem_bootstrap_free(). */ - vm_phys_add_seg((vm_paddr_t)kernphys, trunc_page(first)); + vm_phys_early_add_seg((vm_paddr_t)kernphys, trunc_page(first)); bzero(physmap, sizeof(physmap)); physmap_idx = 0; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 1078a45ee8db..7445b0abacde 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1700,7 +1700,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * are required for promotion of the corresponding kernel virtual * addresses to superpage mappings. */ - vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); + vm_phys_early_add_seg(KPTphys, KPTphys + ptoa(nkpt)); /* * Account for the virtual addresses mapped by create_pagetables(). |