Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2014 10:12:22 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269051 - head/sys/amd64/amd64
Message-ID:  <201407241012.s6OACM2J047789@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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