From c4b4e8cd4ec18c3210ab8dde67e51ba5991663ce Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 12 May 2020 09:31:48 +0000 Subject: [PATCH] amd64/pmap: unbreak !NUMA case for fictitious pages A fictitious page can have a physical address beyond the end of the RAM. In the NUMA case there is some special code to handle such pages, but in the other case the pages are handled the same as normal pages. So, we cannot assert that the physical address is within RAM addresses. Suggested by: kib Reviewed by: kib X-MFC note: NUMA support has not been MFC-ed --- sys/amd64/amd64/pmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4deed86a76d..8dd236acc82 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -323,12 +323,12 @@ pmap_pku_mask_bit(pmap_t pmap) #endif #undef pa_index +#ifdef NUMA #define pa_index(pa) ({ \ KASSERT((pa) <= vm_phys_segs[vm_phys_nsegs - 1].end, \ ("address %lx beyond the last segment", (pa))); \ (pa) >> PDRSHIFT; \ }) -#ifdef NUMA #define pa_to_pmdp(pa) (&pv_table[pa_index(pa)]) #define pa_to_pvh(pa) (&(pa_to_pmdp(pa)->pv_page)) #define PHYS_TO_PV_LIST_LOCK(pa) ({ \ @@ -340,6 +340,7 @@ pmap_pku_mask_bit(pmap_t pmap) _lock; \ }) #else +#define pa_index(pa) ((pa) >> PDRSHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) #define NPV_LIST_LOCKS MAXCPU