Flush caches between writing and verifying test data.

Mostly we write and read large chunks of data which will make it likely
that the data is no longer in the cache when we come to verify it. But
this is not always true, and in any case, we shouldn't rely on it.
This commit is contained in:
Martin Whitaker
2021-12-23 11:00:10 +00:00
parent 11c0c6c2f5
commit d9fee4dcbb
10 changed files with 60 additions and 9 deletions

View File

@@ -73,6 +73,8 @@ int test_mov_inv_walk1(int my_vcpu, int iterations, int offset, bool inverse)
for (int i = 0; i < iterations; i++) {
pattern = (testword_t)1 << offset;
flush_caches(my_vcpu);
for (int j = 0; j < vm_map_size; j++) {
testword_t *start, *end;
calculate_chunk(&start, &end, my_vcpu, j, sizeof(testword_t));
@@ -108,6 +110,8 @@ int test_mov_inv_walk1(int my_vcpu, int iterations, int offset, bool inverse)
} while (!at_end && ++pe); // advance pe to next start point
}
flush_caches(my_vcpu);
for (int j = vm_map_size - 1; j >= 0; j--) {
testword_t *start, *end;
calculate_chunk(&start, &end, my_vcpu, j, sizeof(testword_t));