From owner-svn-src-head@FreeBSD.ORG Wed Mar 10 15:50:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A86B2106564A; Wed, 10 Mar 2010 15:50:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6DD8FC1D; Wed, 10 Mar 2010 15:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2AFocq1081422; Wed, 10 Mar 2010 15:50:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AFocNF081419; Wed, 10 Mar 2010 15:50:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003101550.o2AFocNF081419@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 10 Mar 2010 15:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204957 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2010 15:50:38 -0000 Author: kib Date: Wed Mar 10 15:50:38 2010 New Revision: 204957 URL: http://svn.freebsd.org/changeset/base/204957 Log: Fall back to wbinvd when region for CLFLUSH is >= 2MB. Submitted by: Kevin Day Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Mar 10 15:47:33 2010 (r204956) +++ head/sys/amd64/amd64/pmap.c Wed Mar 10 15:50:38 2010 (r204957) @@ -1105,7 +1105,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 @@ -1122,7 +1123,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 then 2MB. + * Globally invalidate cache. */ pmap_invalidate_cache(); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Mar 10 15:47:33 2010 (r204956) +++ head/sys/i386/i386/pmap.c Wed Mar 10 15:50:38 2010 (r204957) @@ -996,7 +996,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 @@ -1013,7 +1014,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 then 2MB. + * Globally invalidate cache. */ pmap_invalidate_cache(); }