From 158b808d9287a14dd117345b574d93657721790a Mon Sep 17 00:00:00 2001 From: guillaume didier Date: Mon, 6 Apr 2020 11:13:12 +0200 Subject: [PATCH] Add small utility used to trigger l3 accesses (conjoint use the a uncore cbo measuring utility allow cbo slice reverse) --- cache_utils/src/bin/l3.rs | 13 +++++++++++++ cache_utils/src/complex_addressing.rs | 0 cache_utils/src/main.rs | 1 + 3 files changed, 14 insertions(+) create mode 100644 cache_utils/src/bin/l3.rs create mode 100644 cache_utils/src/complex_addressing.rs diff --git a/cache_utils/src/bin/l3.rs b/cache_utils/src/bin/l3.rs new file mode 100644 index 0000000..829a8dc --- /dev/null +++ b/cache_utils/src/bin/l3.rs @@ -0,0 +1,13 @@ +use cache_utils::flush; +use cache_utils::mmap::MMappedMemory; + +pub fn main() { + let m = unsafe { MMappedMemory::new(2 << 20) }; + let array = m.slice(); + loop { + unsafe { + flush(&array[0]); + flush(&array[(1 << 8) ^ (1 << 12) ^ (1 << 10)]); + } + } +} diff --git a/cache_utils/src/complex_addressing.rs b/cache_utils/src/complex_addressing.rs new file mode 100644 index 0000000..e69de29 diff --git a/cache_utils/src/main.rs b/cache_utils/src/main.rs index ae65634..d758f2c 100644 --- a/cache_utils/src/main.rs +++ b/cache_utils/src/main.rs @@ -57,6 +57,7 @@ pub fn main() { };*/ let m = unsafe { MMappedMemory::new(SIZE) }; let array = m.slice(); + /* let p = Box::new(Page { mem: [0; 4096] });