From b2f7a8039583cab38b3a9ff2c76a1705ed0e35a4 Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Wed, 13 Oct 2021 14:40:41 +0200 Subject: [PATCH] Fix compile issues This is a stop gap solution selecting the calibration strategy at compile time. --- covert_channels_benchmark/src/main.rs | 10 +++++++--- prefetcher_reverse/src/lib.rs | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/covert_channels_benchmark/src/main.rs b/covert_channels_benchmark/src/main.rs index ed13b91..9c0ac76 100644 --- a/covert_channels_benchmark/src/main.rs +++ b/covert_channels_benchmark/src/main.rs @@ -4,7 +4,9 @@ use std::io::{stdout, Write}; //use basic_timing_cache_channel::{naive::NaiveTimingChannel, TopologyAwareTimingChannel}; -use basic_timing_cache_channel::{TopologyAwareError, TopologyAwareTimingChannel}; +use basic_timing_cache_channel::{ + CalibrationStrategy, TopologyAwareError, TopologyAwareTimingChannel, +}; use cache_utils::calibration::Threshold; use covert_channels_evaluation::{benchmark_channel, CovertChannel, CovertChannelBenchmarkResult}; use flush_flush::naive::NaiveFlushAndFlush; @@ -24,6 +26,8 @@ const NUM_PAGE_MAX: usize = 32; const NUM_ITER: usize = 16; +const CALIBRATION_STRAT: CalibrationStrategy = CalibrationStrategy::ASVP; + struct BenchmarkStats { raw_res: Vec<(CovertChannelBenchmarkResult, usize, usize)>, average_p: f64, @@ -184,7 +188,7 @@ fn main() { let ff = run_benchmark( "Better F+F", |i, j| { - let (mut r, i, j) = match FlushAndFlush::new_any_two_core(true) { + let (mut r, i, j) = match FlushAndFlush::new_any_two_core(true, CALIBRATION_STRAT) { Ok((channel, _old, main_core, helper_core)) => { (channel, main_core, helper_core) } @@ -203,7 +207,7 @@ fn main() { let fr = run_benchmark( "Better F+R", |i, j| { - let (mut r, i, j) = match FlushAndFlush::new_any_two_core(true) { + let (mut r, i, j) = match FlushAndFlush::new_any_two_core(true, CALIBRATION_STRAT) { Ok((channel, _old, main_core, helper_core)) => { (channel, main_core, helper_core) } diff --git a/prefetcher_reverse/src/lib.rs b/prefetcher_reverse/src/lib.rs index f57c40f..fdd1668 100644 --- a/prefetcher_reverse/src/lib.rs +++ b/prefetcher_reverse/src/lib.rs @@ -1,7 +1,9 @@ #![deny(unsafe_op_in_unsafe_fn)] use crate::Probe::{Flush, FullFlush, Load}; -use basic_timing_cache_channel::{TopologyAwareError, TopologyAwareTimingChannel}; +use basic_timing_cache_channel::{ + CalibrationStrategy, TopologyAwareError, TopologyAwareTimingChannel, +}; use cache_side_channel::CacheStatus::{Hit, Miss}; use cache_side_channel::{ set_affinity, CacheStatus, ChannelHandle, CoreSpec, MultipleAddrCacheSideChannel, @@ -25,6 +27,8 @@ pub mod ip_tool; pub const CACHE_LINE_LEN: usize = 64; pub const PAGE_CACHELINE_LEN: usize = PAGE_LEN / CACHE_LINE_LEN; +pub const CALIBRATION_STRAT: CalibrationStrategy = CalibrationStrategy::ASVP; + pub struct Prober { pages: Vec>, ff_handles: Vec>, @@ -158,7 +162,7 @@ impl Prober { bucket_index: 250, miss_faster_than_hit: false, });*/ - let mut fr_channel = match FlushAndReload::new(core, core) { + let mut fr_channel = match FlushAndReload::new(core, core, CALIBRATION_STRAT) { Ok(res) => res, Err(err) => { return Err(ProberError::TopologyError(err));