From 15e33b5493bae40bd1c50413f16ebad3985750f3 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 22 Oct 2019 22:54:41 +0000 Subject: [PATCH] amd64 pmap: fixup invlgen lookup for fictitious mappings Similarly to r353438, use dummy entry. Reported and tested by: Neel Chauhan Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/pmap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index de8a47417a1a..73b7d47d90b4 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -951,8 +951,16 @@ SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait_slow, CTLFLAG_RD, &invl_wait_slow, 0, static u_long * pmap_delayed_invl_genp(vm_page_t m) { + vm_paddr_t pa; + u_long *gen; - return (&pa_to_pmdp(VM_PAGE_TO_PHYS(m))->pv_invl_gen); + pa = VM_PAGE_TO_PHYS(m); + if (__predict_false((pa) > pmap_last_pa)) + gen = &pv_dummy_large.pv_invl_gen; + else + gen = &(pa_to_pmdp(pa)->pv_invl_gen); + + return (gen); } #else static u_long *