Skip to content

Commit b5ee7be

Browse files
roypatShadowCurse
authored andcommitted
kani: remove stubbing from dumbo harnesses
with the byte_order modules no longer using loops, this is no longer needed. (cherry picked from commit dd0d932) Signed-off-by: Patrick Roy <[email protected]>
1 parent 36e33e3 commit b5ee7be

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/vmm/src/dumbo/pdu/ethernet.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,6 @@ mod kani_proofs {
255255
}
256256
}
257257

258-
mod stubs {
259-
// The current implementation of read_be_u16 function leads to a significant
260-
// performance degradation given a necessary loop unrolling. Using this stub,
261-
// we read the same information from the buffer while avoiding the loop, thus,
262-
// notably improving performance.
263-
pub fn read_be_u16(input: &[u8]) -> u16 {
264-
u16::from_be_bytes([input[0], input[1]])
265-
}
266-
}
267-
268258
// We consider the MMDS Network Stack spec for all postconditions in the harnesses.
269259
// See https://github.com/firecracker-microvm/firecracker/blob/main/docs/mmds/mmds-design.md#mmds-network-stack
270260

@@ -519,7 +509,6 @@ mod kani_proofs {
519509

520510
#[kani::proof]
521511
#[kani::solver(cadical)]
522-
#[kani::stub(crate::utils::byte_order::read_be_u16, stubs::read_be_u16)]
523512
fn verify_with_payload_len_unchecked() {
524513
// Create non-deterministic stream of bytes up to MAX_FRAME_SIZE
525514
let mut bytes: [u8; MAX_FRAME_SIZE] = kani::Arbitrary::any_array::<MAX_FRAME_SIZE>();

0 commit comments

Comments
 (0)