Date: Sat, 22 Jul 2017 06:40:58 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321363 - in stable/10/sys: amd64/amd64 i386/i386 Message-ID: <201707220640.v6M6ew6N056937@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Sat Jul 22 06:40:57 2017 New Revision: 321363 URL: https://svnweb.freebsd.org/changeset/base/321363 Log: MFC r320546 When "force" is specified to pmap_invalidate_cache_range(), the given start address is not required to be page aligned. However, the loop within pmap_invalidate_cache_range() that performs the actual cache line invalidations requires that the starting address be truncated to a multiple of the cache line size. This change corrects an error in that truncation. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1807,7 +1807,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned")); Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1245,7 +1245,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned"));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707220640.v6M6ew6N056937>