From c43daf8499528b1671e6cb5433b7f34b08a4757d Mon Sep 17 00:00:00 2001 From: Guillaume Didier Date: Wed, 29 Sep 2021 11:24:23 +0200 Subject: [PATCH 1/4] Fix bug in unsupported hashing that resulted in a ridiculous number of iteration --- cache_utils/src/calibrate_2t.rs | 1 - cache_utils/src/complex_addressing.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cache_utils/src/calibrate_2t.rs b/cache_utils/src/calibrate_2t.rs index 4d5d5d1..c3ee784 100644 --- a/cache_utils/src/calibrate_2t.rs +++ b/cache_utils/src/calibrate_2t.rs @@ -201,7 +201,6 @@ fn calibrate_fixed_freq_2_thread_impl, T>( let mut calibrate_result_vec = Vec::new(); let offsets = image_antecedent.values().copied(); - eprintln!("Number of offsets: {}", offsets.len()); /* let offsets: Box> = match image_antecedent { diff --git a/cache_utils/src/complex_addressing.rs b/cache_utils/src/complex_addressing.rs index 919de0d..a37331b 100644 --- a/cache_utils/src/complex_addressing.rs +++ b/cache_utils/src/complex_addressing.rs @@ -288,7 +288,7 @@ pub enum CacheAttackSlicing { impl CacheAttackSlicing { pub fn from(cs: CacheSlicing, cache_line_length: usize) -> CacheAttackSlicing { match cs { - Unsupported => CacheAttackSlicing::Unsupported(!((1 << cache_line_length) - 1)), + Unsupported => CacheAttackSlicing::Unsupported(!dbg!(dbg!(cache_line_length) - 1)), ComplexAddressing(ca) => CacheAttackSlicing::ComplexAddressing(ca), SimpleAddressing(sa) => CacheAttackSlicing::SimpleAddressing(sa), NoSlice => CacheAttackSlicing::NoSlice, From c7b0cc4130f58d0fa38630cfb643355d09b758c1 Mon Sep 17 00:00:00 2001 From: Guillaume Didier Date: Wed, 29 Sep 2021 16:45:13 +0200 Subject: [PATCH 2/4] Do not calibrate unneeded ops --- cache_utils/src/bin/two_thread_cal.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cache_utils/src/bin/two_thread_cal.rs b/cache_utils/src/bin/two_thread_cal.rs index d09806a..73fc58a 100644 --- a/cache_utils/src/bin/two_thread_cal.rs +++ b/cache_utils/src/bin/two_thread_cal.rs @@ -154,7 +154,7 @@ fn main() { display_name: "clflush shared hit", t: &(), }, - CalibrateOperation2T { +/* CalibrateOperation2T { prepare: flush, op: only_flush_wrap, name: "clflush_miss_f", @@ -167,7 +167,7 @@ fn main() { name: "clflush_local_hit_f", display_name: "clflush local hit - f", t: &(), - }, + },*/ CalibrateOperation2T { prepare: noop::, op: only_flush_wrap, @@ -182,7 +182,7 @@ fn main() { display_name: "clflush local hit - n", t: &(), }, - CalibrateOperation2T { +/* CalibrateOperation2T { prepare: noop::, op: flush_and_reload_wrap, name: "reload_miss", @@ -209,7 +209,7 @@ fn main() { name: "reload_local_hit", display_name: "reload local hit", t: &(), - }, + },*/ ]; let r = unsafe { From f7132c911cdd8d6578f0cf83ab80a7c725771ea5 Mon Sep 17 00:00:00 2001 From: Guillaume Didier Date: Fri, 1 Oct 2021 11:02:20 +0200 Subject: [PATCH 3/4] Optimised experiments --- cache_utils/src/bin/two_thread_cal.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cache_utils/src/bin/two_thread_cal.rs b/cache_utils/src/bin/two_thread_cal.rs index d09806a..6790a01 100644 --- a/cache_utils/src/bin/two_thread_cal.rs +++ b/cache_utils/src/bin/two_thread_cal.rs @@ -147,7 +147,7 @@ fn main() { display_name: "clflush remote hit", t: &(), }, - CalibrateOperation2T { +/* CalibrateOperation2T { prepare: maccess::, op: load_and_flush_wrap, name: "clflush_shared_hit", @@ -167,7 +167,7 @@ fn main() { name: "clflush_local_hit_f", display_name: "clflush local hit - f", t: &(), - }, + },*/ CalibrateOperation2T { prepare: noop::, op: only_flush_wrap, @@ -175,7 +175,7 @@ fn main() { display_name: "clflush miss - n", t: &(), }, - CalibrateOperation2T { +/* CalibrateOperation2T { prepare: noop::, op: load_and_flush_wrap, name: "clflush_local_hit_n", @@ -209,7 +209,7 @@ fn main() { name: "reload_local_hit", display_name: "reload local hit", t: &(), - }, + },*/ ]; let r = unsafe { @@ -298,13 +298,13 @@ fn main() { Err(e) => panic!("Error: {}", e), }; - asvp_analysis[&ASVP { +/* asvp_analysis[&ASVP { attacker: 0, slice: 0, victim: 0, page: pointer as usize, }] - .debug(); + .debug();*/ let asp_analysis = accumulate( asvp_analysis.clone(), From 8c77c1558dde34ffcf8c2f0ca528bac3530f01ec Mon Sep 17 00:00:00 2001 From: Guillaume Didier Date: Fri, 1 Oct 2021 16:38:44 +0200 Subject: [PATCH 4/4] Fix comments --- cache_utils/src/bin/two_thread_cal.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cache_utils/src/bin/two_thread_cal.rs b/cache_utils/src/bin/two_thread_cal.rs index 7c3ca8b..6790a01 100644 --- a/cache_utils/src/bin/two_thread_cal.rs +++ b/cache_utils/src/bin/two_thread_cal.rs @@ -154,7 +154,7 @@ fn main() { display_name: "clflush shared hit", t: &(), }, -/* CalibrateOperation2T { + CalibrateOperation2T { prepare: flush, op: only_flush_wrap, name: "clflush_miss_f", @@ -182,7 +182,7 @@ fn main() { display_name: "clflush local hit - n", t: &(), }, -/* CalibrateOperation2T { + CalibrateOperation2T { prepare: noop::, op: flush_and_reload_wrap, name: "reload_miss",