Date: Sat, 11 Oct 2014 16:17:50 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272943 - head/sys/i386/xen Message-ID: <201410111617.s9BGHoGn049067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Oct 11 16:17:49 2014 New Revision: 272943 URL: https://svnweb.freebsd.org/changeset/base/272943 Log: MFi386 r272761. Noted by: Holger Hans Peter Freyther <holger at freyther.de> Sponsored by: The FreeBSD Foundation MFC after: 10 days Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sat Oct 11 16:16:05 2014 (r272942) +++ head/sys/i386/xen/pmap.c Sat Oct 11 16:17:49 2014 (r272943) @@ -888,15 +888,19 @@ pmap_invalidate_cache(void) #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); + if (force) { + sva &= ~(vm_offset_t)cpu_clflush_line_size; + } else { + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + } - if (cpu_feature & CPUID_SS) + if ((cpu_feature & CPUID_SS) != 0 && !force) ; /* If "Self Snoop" is supported, do nothing. */ else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { @@ -4073,7 +4077,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + size); + pmap_invalidate_cache_range(va, va + size, FALSE); return ((void *)(va + offset)); } @@ -4241,7 +4245,7 @@ pmap_change_attr(vm_offset_t va, vm_size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva); + pmap_invalidate_cache_range(base, tmpva, FALSE); } return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410111617.s9BGHoGn049067>