Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 May 2017 10:00:24 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318251 - head/sys/arm/arm
Message-ID:  <201705131000.v4DA0O1m057569@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Sat May 13 10:00:24 2017
New Revision: 318251
URL: https://svnweb.freebsd.org/changeset/base/318251

Log:
  Clarify usage rules for pmap_remap_vm_attr().
  Not a functional change.
  
  MFC with:	r318021
  MFC after:	2 weeks

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Sat May 13 03:10:50 2017	(r318250)
+++ head/sys/arm/arm/pmap-v6.c	Sat May 13 10:00:24 2017	(r318251)
@@ -500,7 +500,24 @@ pmap_set_tex(void)
 /*
  * Remap one vm_meattr class to another one. This can be useful as
  * workaround for SOC errata, e.g. if devices must be accessed using
- * SO memory class. 
+ * SO memory class.
+ *
+ * !!! Please note that this function is absolutely last resort thing.
+ * It should not be used under normal circumstances. !!!
+ *
+ * Usage rules:
+ * - it shall be called after pmap_bootstrap_prepare() and before
+ *   cpu_mp_start() (thus only on boot CPU). In practice, it's expected
+ *   to be called from platform_attach() or platform_late_init().
+ *
+ * - if remapping doesn't change caching mode, or until uncached class
+ *   is remapped to any kind of cached one, then no other restriction exists.
+ *
+ * - if pmap_remap_vm_attr() changes caching mode, but both (original and
+ *   remapped) remain cached, then caller is resposible for calling
+ *   of dcache_wbinv_poc_all().
+ *
+ * - remapping of any kind of cached class to uncached is not permitted.
  */
 void
 pmap_remap_vm_attr(vm_memattr_t old_attr, vm_memattr_t new_attr)



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