From 78c4018a047c85c9ff7d934c9444d9d2b686a069 Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Mon, 19 Jul 2021 09:17:09 +0200 Subject: [PATCH] Document issues around number of handles per page / cache line The two channel used to have different invariants. Currently the enforcement of any limitation of handle per page or handle per cache line has been removed, hence document this issue in the code. --- basic_timing_cache_channel/src/lib.rs | 4 +++- basic_timing_cache_channel/src/naive.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/basic_timing_cache_channel/src/lib.rs b/basic_timing_cache_channel/src/lib.rs index 462e05a..afb856b 100644 --- a/basic_timing_cache_channel/src/lib.rs +++ b/basic_timing_cache_channel/src/lib.rs @@ -44,7 +44,7 @@ pub trait TimingChannelPrimitives: Debug + Send + Sync + Default { #[derive(Debug)] pub struct TopologyAwareTimingChannelHandle { threshold: Threshold, - vpn: VPN, + vpn: VPN, // what is this field used for addr: *const u8, ready: bool, calibration_epoch: usize, @@ -488,6 +488,8 @@ impl MultipleAddrCacheSideChannel for TopologyAwareT operation(); // TODO use a different helper core ? } + // this function tolerates multiple handle on the same cache line + // should the invariant be fixed to one handle per line & calibration epoch ? unsafe fn calibrate( &mut self, addresses: impl IntoIterator + Clone, diff --git a/basic_timing_cache_channel/src/naive.rs b/basic_timing_cache_channel/src/naive.rs index 7e87864..dcb98ed 100644 --- a/basic_timing_cache_channel/src/naive.rs +++ b/basic_timing_cache_channel/src/naive.rs @@ -22,7 +22,7 @@ pub struct NaiveTimingChannel { } pub struct NaiveTimingChannelHandle { - vpn: VPN, + vpn: VPN, // what is this field used for addr: *const u8, } @@ -83,6 +83,10 @@ impl NaiveTimingChannel { } } + // The former invariant of one handle per page has been removed + // Now tolerates as many handles per cache line as wanted + // should the invariant be fixed into one handle per cache line ? + unsafe fn calibrate_impl( &mut self, addr: *const u8,