summaryrefslogtreecommitdiffstats
path: root/sys/amd64
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/amd64
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/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index c4e6a3b..0be5e29 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1105,7 +1105,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
@@ -1122,7 +1123,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