Fix compile issues
This is a stop gap solution selecting the calibration strategy at compile time.
This commit is contained in:
parent
c8f035d76d
commit
b2f7a80395
@ -4,7 +4,9 @@
|
|||||||
use std::io::{stdout, Write};
|
use std::io::{stdout, Write};
|
||||||
|
|
||||||
//use basic_timing_cache_channel::{naive::NaiveTimingChannel, TopologyAwareTimingChannel};
|
//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 cache_utils::calibration::Threshold;
|
||||||
use covert_channels_evaluation::{benchmark_channel, CovertChannel, CovertChannelBenchmarkResult};
|
use covert_channels_evaluation::{benchmark_channel, CovertChannel, CovertChannelBenchmarkResult};
|
||||||
use flush_flush::naive::NaiveFlushAndFlush;
|
use flush_flush::naive::NaiveFlushAndFlush;
|
||||||
@ -24,6 +26,8 @@ const NUM_PAGE_MAX: usize = 32;
|
|||||||
|
|
||||||
const NUM_ITER: usize = 16;
|
const NUM_ITER: usize = 16;
|
||||||
|
|
||||||
|
const CALIBRATION_STRAT: CalibrationStrategy = CalibrationStrategy::ASVP;
|
||||||
|
|
||||||
struct BenchmarkStats {
|
struct BenchmarkStats {
|
||||||
raw_res: Vec<(CovertChannelBenchmarkResult, usize, usize)>,
|
raw_res: Vec<(CovertChannelBenchmarkResult, usize, usize)>,
|
||||||
average_p: f64,
|
average_p: f64,
|
||||||
@ -184,7 +188,7 @@ fn main() {
|
|||||||
let ff = run_benchmark(
|
let ff = run_benchmark(
|
||||||
"Better F+F",
|
"Better F+F",
|
||||||
|i, j| {
|
|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)) => {
|
Ok((channel, _old, main_core, helper_core)) => {
|
||||||
(channel, main_core, helper_core)
|
(channel, main_core, helper_core)
|
||||||
}
|
}
|
||||||
@ -203,7 +207,7 @@ fn main() {
|
|||||||
let fr = run_benchmark(
|
let fr = run_benchmark(
|
||||||
"Better F+R",
|
"Better F+R",
|
||||||
|i, j| {
|
|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)) => {
|
Ok((channel, _old, main_core, helper_core)) => {
|
||||||
(channel, main_core, helper_core)
|
(channel, main_core, helper_core)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
use crate::Probe::{Flush, FullFlush, Load};
|
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::CacheStatus::{Hit, Miss};
|
||||||
use cache_side_channel::{
|
use cache_side_channel::{
|
||||||
set_affinity, CacheStatus, ChannelHandle, CoreSpec, MultipleAddrCacheSideChannel,
|
set_affinity, CacheStatus, ChannelHandle, CoreSpec, MultipleAddrCacheSideChannel,
|
||||||
@ -25,6 +27,8 @@ pub mod ip_tool;
|
|||||||
pub const CACHE_LINE_LEN: usize = 64;
|
pub const CACHE_LINE_LEN: usize = 64;
|
||||||
pub const PAGE_CACHELINE_LEN: usize = PAGE_LEN / CACHE_LINE_LEN;
|
pub const PAGE_CACHELINE_LEN: usize = PAGE_LEN / CACHE_LINE_LEN;
|
||||||
|
|
||||||
|
pub const CALIBRATION_STRAT: CalibrationStrategy = CalibrationStrategy::ASVP;
|
||||||
|
|
||||||
pub struct Prober<const GS: usize> {
|
pub struct Prober<const GS: usize> {
|
||||||
pages: Vec<MMappedMemory<u8>>,
|
pages: Vec<MMappedMemory<u8>>,
|
||||||
ff_handles: Vec<Vec<FFHandle>>,
|
ff_handles: Vec<Vec<FFHandle>>,
|
||||||
@ -158,7 +162,7 @@ impl<const GS: usize> Prober<GS> {
|
|||||||
bucket_index: 250,
|
bucket_index: 250,
|
||||||
miss_faster_than_hit: false,
|
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,
|
Ok(res) => res,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
return Err(ProberError::TopologyError(err));
|
return Err(ProberError::TopologyError(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user