]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Simplify shmem__invalidate_scache_range : it only has to handle
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 11 May 2015 20:18:10 +0000 (20:18 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 11 May 2015 20:18:10 +0000 (20:18 +0000)
cacheline aligned ranges.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15213

helgrind/libhb_core.c

index d161a6a5391a8be76e1e724fa405306657de6f7f..573248b20097bd4e3573a7e5787585e0d7f0ab69 100644 (file)
@@ -1624,29 +1624,17 @@ static __attribute__((noinline)) void cacheline_fetch ( UWord wix )
    normalise_CacheLine( cl );
 }
 
-/* Invalid the cachelines corresponding to the given range. */
+/* Invalid the cachelines corresponding to the given range, which
+   must start and end on a cacheline boundary. */
 static void shmem__invalidate_scache_range (Addr ga, SizeT szB)
 {
-   Addr before_start  = ga;
-   Addr aligned_start = ROUNDUP(ga, N_LINE_ARANGE);
-   Addr after_start   = ROUNDDN(ga + szB, N_LINE_ARANGE);
-   UWord before_len   = aligned_start - before_start;
-   UWord after_len    = ga + szB - after_start;
-
-   /* Write-back cachelines partially set to NOACCESS */
-   if (before_len > 0) {
-      zsm_sset_range_SMALL (before_start, before_len, SVal_NOACCESS);
-      szB += N_LINE_ARANGE - before_len;
-   }
-   if (after_len > 0) {
-      zsm_sset_range_SMALL (after_start, after_len, SVal_NOACCESS);
-      szB += N_LINE_ARANGE - after_len;
-   }
+   Word wix;
 
-   /* szB must now be a multiple of cacheline size. */
+   /* ga must be on a cacheline boundary. */
+   tl_assert (is_valid_scache_tag (ga));
+   /* szB must be a multiple of cacheline size. */
    tl_assert (0 == (szB & (N_LINE_ARANGE - 1)));
-
-   Word wix;
+   
 
    Word ga_ix = (ga >> N_LINE_BITS) & (N_WAY_NENT - 1);
    Word nwix = szB / N_LINE_ARANGE;