svn commit: r269051 - head/sys/amd64/amd64

Marius Strobl marius at FreeBSD.org
Thu Jul 24 10:12:22 UTC 2014


Author: marius
Date: Thu Jul 24 10:12:22 2014
New Revision: 269051
URL: http://svnweb.freebsd.org/changeset/base/269051

Log:
  Copying pages via temporary mappings in the !DMAP case of pmap_copy_pages()
  involves updating the corresponding page tables followed by accesses to the
  pages in question. This sequence is subject to the situation exactly described
  in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming"
  rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore,
  issuing the INVLPG right after modifying the PTE bits is crucial (see also
  r269050).
  For the amd64 PMAP code, the order of instructions was already correct. The
  above fact still is worth documenting, though.
  
  1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf
  
  Reviewed by:	alc
  Sponsored by:	Bally Wulff Games & Entertainment GmbH

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

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Thu Jul 24 10:08:02 2014	(r269050)
+++ head/sys/amd64/amd64/pmap.c	Thu Jul 24 10:12:22 2014	(r269051)
@@ -5080,6 +5080,14 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
 	int cnt;
 	boolean_t pinned;
 
+	/*
+	 * NB:  The sequence of updating a page table followed by accesses
+	 * to the corresponding pages used in the !DMAP case is subject to
+	 * the situation described in the "AMD64 Architecture Programmer's
+	 * Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special
+	 * Coherency Considerations".  Therefore, issuing the INVLPG right
+	 * after modifying the PTE bits is crucial.
+	 */
 	pinned = FALSE;
 	while (xfersize > 0) {
 		a_pg_offset = a_offset & PAGE_MASK;


More information about the svn-src-all mailing list