svn commit: r321362 - in stable/11/sys: amd64/amd64 i386/i386
Alan Cox
alc at FreeBSD.org
Sat Jul 22 06:36:29 UTC 2017
Author: alc
Date: Sat Jul 22 06:36:27 2017
New Revision: 321362
URL: https://svnweb.freebsd.org/changeset/base/321362
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/11/sys/amd64/amd64/pmap.c
stable/11/sys/i386/i386/pmap.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/11/sys/amd64/amd64/pmap.c Sat Jul 22 05:58:10 2017 (r321361)
+++ stable/11/sys/amd64/amd64/pmap.c Sat Jul 22 06:36:27 2017 (r321362)
@@ -1868,7 +1868,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/11/sys/i386/i386/pmap.c
==============================================================================
--- stable/11/sys/i386/i386/pmap.c Sat Jul 22 05:58:10 2017 (r321361)
+++ stable/11/sys/i386/i386/pmap.c Sat Jul 22 06:36:27 2017 (r321362)
@@ -1289,7 +1289,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"));
More information about the svn-src-all
mailing list