Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2010 10:02:10 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r205583 - in stable/7/sys: amd64/amd64 i386/i386
Message-ID:  <201003241002.o2OA2B1X063424@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar 24 10:02:10 2010
New Revision: 205583
URL: http://svn.freebsd.org/changeset/base/205583

Log:
  MFC r204957:
  Fall back to wbinvd when region for CLFLUSH is >= 2MB.
  
  MFC r205334 (by avg):
  Fix a typo in a comment.

Modified:
  stable/7/sys/amd64/amd64/pmap.c
  stable/7/sys/i386/i386/pmap.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c	Wed Mar 24 09:45:17 2010	(r205582)
+++ stable/7/sys/amd64/amd64/pmap.c	Wed Mar 24 10:02:10 2010	(r205583)
@@ -955,7 +955,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 	if (cpu_feature & CPUID_SS)
 		; /* If "Self Snoop" is supported, do nothing. */
-	else if (cpu_feature & CPUID_CLFSH) {
+	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
+		 eva - sva < 2 * 1024 * 1024) {
 
 		/*
 		 * Otherwise, do per-cache line flush.  Use the mfence
@@ -972,7 +973,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 		/*
 		 * No targeted cache flush methods are supported by CPU,
-		 * globally invalidate cache as a last resort.
+		 * or the supplied range is bigger than 2MB.
+		 * Globally invalidate cache.
 		 */
 		pmap_invalidate_cache();
 	}

Modified: stable/7/sys/i386/i386/pmap.c
==============================================================================
--- stable/7/sys/i386/i386/pmap.c	Wed Mar 24 09:45:17 2010	(r205582)
+++ stable/7/sys/i386/i386/pmap.c	Wed Mar 24 10:02:10 2010	(r205583)
@@ -972,7 +972,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 	if (cpu_feature & CPUID_SS)
 		; /* If "Self Snoop" is supported, do nothing. */
-	else if (cpu_feature & CPUID_CLFSH) {
+	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
+		 eva - sva < 2 * 1024 * 1024) {
 
 		/*
 		 * Otherwise, do per-cache line flush.  Use the mfence
@@ -989,7 +990,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 		/*
 		 * No targeted cache flush methods are supported by CPU,
-		 * globally invalidate cache as a last resort.
+		 * or the supplied range is bigger than 2MB.
+		 * Globally invalidate cache.
 		 */
 		pmap_invalidate_cache();
 	}



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