summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-03-10 15:50:38 +0000
committerkib <kib@FreeBSD.org>2010-03-10 15:50:38 +0000
commit54e4314fe0f578875727207174797b971395b447 (patch)
treef3ee90a4aa3e4a66a72b58c3545ea4407419efd5 /sys/i386
parent052dc599e82dc0ecdbea97786e7a62e3049e182b (diff)
downloadFreeBSD-src-54e4314fe0f578875727207174797b971395b447.zip
FreeBSD-src-54e4314fe0f578875727207174797b971395b447.tar.gz
Fall back to wbinvd when region for CLFLUSH is >= 2MB.
Submitted by: Kevin Day <toasty dragondata com> Reviewed by: jhb MFC after: 2 weeks
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/pmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 4b2e34f..f448071 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -996,7 +996,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
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
@@ -1013,7 +1014,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
/*
* No targeted cache flush methods are supported by CPU,
- * globally invalidate cache as a last resort.
+ * or the supplied range is bigger then 2MB.
+ * Globally invalidate cache.
*/
pmap_invalidate_cache();
}
OpenPOWER on IntegriCloud