Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2018 21:22:00 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335969 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <201807042122.w64LM0sC052094@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jul  4 21:21:59 2018
New Revision: 335969
URL: https://svnweb.freebsd.org/changeset/base/335969

Log:
  In x86 pmap_extract_and_hold()s, handle the case of PHYS_TO_VM_PAGE()
  returning NULL.
  
  vm_fault_quick_hold_pages() can be legitimately called on userspace
  mappings backed by fictitious pages created by unmanaged device and sg
  pagers.
  
  Note that other architectures pmap_extract_and_hold() might need
  similar fix, but I postponed the examination.
  
  Reported by:	bde
  Discussed with:	alc
  Reviewed by:	markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks
  Differential revision:	https://reviews.freebsd.org/D16085

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Jul  4 19:46:26 2018	(r335968)
+++ head/sys/amd64/amd64/pmap.c	Wed Jul  4 21:21:59 2018	(r335969)
@@ -2319,7 +2319,8 @@ retry:
 				    &pa))
 					goto retry;
 				m = PHYS_TO_VM_PAGE(pte & PG_FRAME);
-				vm_page_hold(m);
+				if (m != NULL)
+					vm_page_hold(m);
 			}
 		}
 	}

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Jul  4 19:46:26 2018	(r335968)
+++ head/sys/i386/i386/pmap.c	Wed Jul  4 21:21:59 2018	(r335969)
@@ -1684,7 +1684,8 @@ retry:
 				    &pa))
 					goto retry;
 				m = PHYS_TO_VM_PAGE(pte & PG_FRAME);
-				vm_page_hold(m);
+				if (m != NULL)
+					vm_page_hold(m);
 			}
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807042122.w64LM0sC052094>