svn commit: r236676 - projects/armv6/sys/arm/arm

Grzegorz Bernacki gber at FreeBSD.org
Wed Jun 6 12:13:21 UTC 2012


Author: gber
Date: Wed Jun  6 12:13:20 2012
New Revision: 236676
URL: http://svn.freebsd.org/changeset/base/236676

Log:
  Flush cache before downgrade page to WT mode.
  
  Cache should be flushed before downgrading to avoid situation when
  cache controller flushes dirty cache line to page which is not WB anymore.

Modified:
  projects/armv6/sys/arm/arm/pmap-v6.c

Modified: projects/armv6/sys/arm/arm/pmap-v6.c
==============================================================================
--- projects/armv6/sys/arm/arm/pmap-v6.c	Wed Jun  6 11:46:37 2012	(r236675)
+++ projects/armv6/sys/arm/arm/pmap-v6.c	Wed Jun  6 12:13:20 2012	(r236676)
@@ -809,6 +809,12 @@ pmap_l2ptp_ctor(void *mem, int size, voi
 	ptep = &l2b->l2b_kva[l2pte_index(va)];
 	pte = *ptep;
 
+	cpu_idcache_wbinv_range(va, PAGE_SIZE);
+#ifdef ARM_L2_PIPT
+	cpu_l2cache_wbinv_range(pte & L2_S_FRAME, PAGE_SIZE);
+#else
+	cpu_l2cache_wbinv_range(va, PAGE_SIZE);
+#endif
 	if ((pte & L2_S_CACHE_MASK) != pte_l2_s_cache_mode_pt) {
 		/*
 		 * Page tables must have the cache-mode set to


More information about the svn-src-projects mailing list