From cbc3c1f6877980eccaf9ab72a55a2a31d2143ab2 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sat, 29 Aug 2009 16:01:21 +0000 Subject: [PATCH] Swap the start/end virtual addresses in pmap_invalidate_cache_range(). This fixes the functionality on non SelfSnoop hardware. Found by: rnoland Submitted by: alc Reviewed by: kib MFC after: 3 days --- sys/amd64/amd64/pmap.c | 4 ++-- sys/i386/i386/pmap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b9eee49c97c6..f0da536a0126 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -943,8 +943,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) * coherence domain. */ mfence(); - for (; eva < sva; eva += cpu_clflush_line_size) - clflush(eva); + for (; sva < eva; sva += cpu_clflush_line_size) + clflush(sva); mfence(); } else { diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index c6f1d5fe2a43..405cbd30cfe6 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -967,8 +967,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) * coherence domain. */ mfence(); - for (; eva < sva; eva += cpu_clflush_line_size) - clflush(eva); + for (; sva < eva; sva += cpu_clflush_line_size) + clflush(sva); mfence(); } else {