Instrumentation filters remove generic bound (#2053)
* Removed S: UsesInput bound for HasInstrumentationFilter * cargo fmt * Removed S generic leftovers * cargo fmt * fix systemmode * unused imports * more verbose error. * clippy * debug test * still debugging * debug ci * sudo * debug * debug * debug * add g++ * build-essential * more deps... * restore to sane state. * remove useless comment. --------- Co-authored-by: Romain Malmain <romain.malmain@pm.me>
This commit is contained in:
parent
684b31279e
commit
47d15ade81
13
.github/workflows/build_and_test.yml
vendored
13
.github/workflows/build_and_test.yml
vendored
@ -308,12 +308,9 @@ jobs:
|
||||
- ./fuzzers/backtrace_baby_fuzzers
|
||||
- ./fuzzers/fuzzbench_qemu
|
||||
- ./fuzzers/nyx_libxml2_parallel
|
||||
# - ./fuzzers/qemu_launcher
|
||||
- ./fuzzers/frida_gdiplus
|
||||
- ./fuzzers/libfuzzer_stb_image_concolic
|
||||
- ./fuzzers/nautilus_sync
|
||||
# - ./fuzzers/qemu_cmin
|
||||
# - ./fuzzers/qemu_systemmode
|
||||
- ./fuzzers/push_harness
|
||||
- ./fuzzers/libfuzzer_libpng_centralized
|
||||
- ./fuzzers/baby_fuzzer_nautilus
|
||||
@ -337,7 +334,6 @@ jobs:
|
||||
- ./fuzzers/fuzzbench_forkserver
|
||||
# - ./fuzzers/libfuzzer_windows_asan
|
||||
- ./fuzzers/baby_fuzzer_minimizing
|
||||
# - ./fuzzers/qemu_coverage
|
||||
- ./fuzzers/frida_executable_libpng
|
||||
- ./fuzzers/tutorial
|
||||
- ./fuzzers/baby_fuzzer_tokens
|
||||
@ -351,10 +347,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/workflows/fuzzer-tester-prepare
|
||||
- name: Symlink Headers
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: sudo ln -s /usr/include/asm-generic /usr/include/asm
|
||||
- name: Build and run example fuzzers (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
@ -393,11 +385,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/workflows/qemu-fuzzer-tester-prepare
|
||||
- uses: ./.github/workflows/fuzzer-tester-prepare
|
||||
- name: Symlink Headers
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: sudo ln -s /usr/include/asm-generic /usr/include/asm
|
||||
- name: Build and run example QEMU fuzzers (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
|
@ -3,6 +3,45 @@ description: Sets up the QEMU fuzzers environment
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install sudo
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: apt update && apt install -y sudo wget qemu-utils libsqlite3-dev gcc-arm-none-eabi
|
||||
run: apt update && apt install -y nasm ninja-build libc6-dev libgtk-3-dev pax-utils libz3-dev wget qemu-utils libsqlite3-dev gcc-arm-none-eabi sudo gcc g++ build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with: { shared-key: "${{ runner.os }}-shared-fuzzer-cache" }
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
- name: Add stable rustfmt and clippy
|
||||
shell: bash
|
||||
run: rustup toolchain install stable --component rustfmt --component clippy --allow-downgrade
|
||||
- name: Add nightly rustfmt and clippy
|
||||
shell: bash
|
||||
run: rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade
|
||||
- name: Remove obsolete llvm (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: sudo apt purge -y llvm* clang*
|
||||
- name: Install LLVM and Clang
|
||||
uses: KyleMayes/install-llvm-action@v1
|
||||
with:
|
||||
directory: ${{ runner.temp }}/llvm
|
||||
version: 17
|
||||
- name: pip install
|
||||
shell: bash
|
||||
run: python3 -m pip install msgpack jinja2 find_libpython
|
||||
- name: enable mult-thread for `make`
|
||||
shell: bash
|
||||
run: export MAKEFLAGS="-j$(expr $(nproc) \+ 1)"
|
||||
- name: install cargo-make
|
||||
uses: baptiste0928/cargo-install@v1.3.0
|
||||
with:
|
||||
crate: cargo-make
|
||||
- name: Symlink Headers
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: sudo ln -s /usr/include/asm-generic /usr/include/asm
|
||||
|
@ -499,7 +499,10 @@ pub fn build(
|
||||
|
||||
let link_str = format!("{link_command:?}");
|
||||
|
||||
let output = link_command.output().expect("Partial linked failure");
|
||||
let output = match link_command.output() {
|
||||
Ok(output) => output,
|
||||
Err(e) => panic!("Command {link_command:?} failed: {e:?}"),
|
||||
};
|
||||
|
||||
if !output.status.success() {
|
||||
fs::write(libafl_qemu_build_dir.join("link.command"), link_str)
|
||||
|
@ -1,18 +1,22 @@
|
||||
#![forbid(unexpected_cfgs)]
|
||||
#![allow(clippy::missing_panics_doc)]
|
||||
|
||||
#[rustversion::nightly]
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::{
|
||||
collections::hash_map,
|
||||
env, fs,
|
||||
fs::File,
|
||||
hash::Hasher,
|
||||
io::{BufRead, BufReader, Read, Seek, SeekFrom, Write},
|
||||
io::{Read, Seek, SeekFrom, Write},
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
ptr::addr_of_mut,
|
||||
};
|
||||
|
||||
#[rustversion::nightly]
|
||||
use regex::Regex;
|
||||
#[rustversion::nightly]
|
||||
use rustc_version::Version;
|
||||
use which::which;
|
||||
|
||||
|
@ -54,7 +54,7 @@ macro_rules! define_std_command_manager {
|
||||
($name:ident, [$($native_command_parser:ident),+]) => {
|
||||
pub struct $name<QT, S, SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -65,7 +65,7 @@ macro_rules! define_std_command_manager {
|
||||
|
||||
impl<QT, S, SM> $name<QT, S, SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -104,7 +104,7 @@ macro_rules! define_std_command_manager {
|
||||
|
||||
impl<QT, S, SM> CommandManager<StdEmulatorExitHandler<SM>, QT, S> for $name<QT, S, SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -128,7 +128,7 @@ macro_rules! define_std_command_manager {
|
||||
|
||||
impl<QT, S, SM> Debug for $name<QT, S, SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -140,7 +140,7 @@ macro_rules! define_std_command_manager {
|
||||
|
||||
impl<QT, S, SM> Default for $name<QT, S, SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -233,7 +233,7 @@ pub struct SaveCommand;
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for SaveCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -272,7 +272,7 @@ where
|
||||
allowed_paging_ids.insert(current_paging_id);
|
||||
|
||||
let paging_filter =
|
||||
HasInstrumentationFilter::<QemuInstrumentationPagingFilter, S>::filter_mut(
|
||||
HasInstrumentationFilter::<QemuInstrumentationPagingFilter>::filter_mut(
|
||||
qemu_helpers,
|
||||
);
|
||||
|
||||
@ -289,7 +289,7 @@ pub struct LoadCommand;
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for LoadCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -330,7 +330,7 @@ pub struct InputCommand {
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for InputCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -367,7 +367,7 @@ pub struct StartCommand {
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for StartCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -418,7 +418,7 @@ pub struct EndCommand(Option<ExitKind>);
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for EndCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -455,7 +455,7 @@ pub struct VersionCommand(u64);
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for VersionCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -496,7 +496,7 @@ where
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for PagingFilterCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -516,9 +516,7 @@ where
|
||||
let qemu_helpers = qemu_executor_state.hooks_mut().helpers_mut();
|
||||
|
||||
let paging_filter =
|
||||
HasInstrumentationFilter::<QemuInstrumentationPagingFilter, S>::filter_mut(
|
||||
qemu_helpers,
|
||||
);
|
||||
HasInstrumentationFilter::<QemuInstrumentationPagingFilter>::filter_mut(qemu_helpers);
|
||||
|
||||
*paging_filter = self.filter.clone();
|
||||
|
||||
@ -529,7 +527,7 @@ where
|
||||
impl<CM, QT, S, SM> IsCommand<CM, StdEmulatorExitHandler<SM>, QT, S> for AddressRangeFilterCommand
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -550,7 +548,7 @@ where
|
||||
let qemu_helpers = qemu_executor_state.hooks_mut().helpers_mut();
|
||||
|
||||
let addr_range_filter =
|
||||
HasInstrumentationFilter::<QemuInstrumentationAddressRangeFilter, S>::filter_mut(
|
||||
HasInstrumentationFilter::<QemuInstrumentationAddressRangeFilter>::filter_mut(
|
||||
qemu_helpers,
|
||||
);
|
||||
|
||||
|
@ -41,7 +41,7 @@ impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for InputPhysCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -71,10 +71,10 @@ where
|
||||
|
||||
pub struct InputVirtCommandParser;
|
||||
impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for crate::command::parser::InputVirtCommandParser
|
||||
for InputVirtCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -103,7 +103,7 @@ impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for StartPhysCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -133,7 +133,7 @@ impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for StartVirtCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -162,7 +162,7 @@ pub struct SaveCommandParser;
|
||||
impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S> for SaveCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -184,7 +184,7 @@ pub struct LoadCommandParser;
|
||||
impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S> for LoadCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -206,7 +206,7 @@ pub struct EndCommandParser;
|
||||
impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S> for EndCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -242,7 +242,7 @@ impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for VersionCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
@ -267,7 +267,7 @@ impl<CM, QT, S, SM> NativeCommandParser<CM, StdEmulatorExitHandler<SM>, QT, S>
|
||||
for VaddrFilterAllowRangeCommandParser
|
||||
where
|
||||
CM: CommandManager<StdEmulatorExitHandler<SM>, QT, S>,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
|
@ -295,7 +295,7 @@ where
|
||||
// TODO: replace handlers with generics to permit compile-time customization of handlers
|
||||
impl<QT, S, SM> EmulatorExitHandler<QT, S> for StdEmulatorExitHandler<SM>
|
||||
where
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter<S> + Debug,
|
||||
QT: QemuHelperTuple<S> + StdInstrumentationFilter + Debug,
|
||||
S: State + HasExecutions,
|
||||
S::Input: HasTargetBytes,
|
||||
SM: IsSnapshotManager,
|
||||
|
@ -909,9 +909,7 @@ impl QemuAsanHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuAsanHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuAsanHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
}
|
||||
|
@ -197,9 +197,7 @@ impl QemuAsanGuestHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuAsanGuestHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuAsanGuestHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
}
|
||||
|
@ -384,11 +384,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuCallTracerHelper<T>
|
||||
impl<T> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuCallTracerHelper<T>
|
||||
where
|
||||
T: CallTraceCollectorTuple,
|
||||
S: UsesInput,
|
||||
{
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
|
@ -66,9 +66,7 @@ impl Default for QemuCmpLogHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuCmpLogHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuCmpLogHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
}
|
||||
@ -347,9 +345,7 @@ impl QemuCmpLogRoutinesHelper {
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "usermode")]
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuCmpLogRoutinesHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuCmpLogRoutinesHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
}
|
||||
|
@ -76,11 +76,7 @@ impl QemuDrCovHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuDrCovHelper
|
||||
where
|
||||
S: UsesInput,
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuDrCovHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.filter
|
||||
}
|
||||
|
@ -132,9 +132,7 @@ impl Default for QemuEdgeCoverageHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
for QemuEdgeCoverageHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for QemuEdgeCoverageHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&self.address_filter
|
||||
}
|
||||
@ -145,9 +143,7 @@ impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilte
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationPagingFilter, S>
|
||||
for QemuEdgeCoverageHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationPagingFilter> for QemuEdgeCoverageHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationPagingFilter {
|
||||
&self.paging_filter
|
||||
}
|
||||
@ -283,7 +279,7 @@ impl Default for QemuEdgeCoverageChildHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
for QemuEdgeCoverageChildHelper
|
||||
{
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
@ -296,9 +292,7 @@ impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilte
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationPagingFilter, S>
|
||||
for QemuEdgeCoverageChildHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationPagingFilter> for QemuEdgeCoverageChildHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationPagingFilter {
|
||||
&self.paging_filter
|
||||
}
|
||||
@ -432,7 +426,7 @@ impl Default for QemuEdgeCoverageClassicHelper {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
for QemuEdgeCoverageClassicHelper
|
||||
{
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
@ -445,9 +439,7 @@ impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilte
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
impl<S: UsesInput> HasInstrumentationFilter<QemuInstrumentationPagingFilter, S>
|
||||
for QemuEdgeCoverageClassicHelper
|
||||
{
|
||||
impl HasInstrumentationFilter<QemuInstrumentationPagingFilter> for QemuEdgeCoverageClassicHelper {
|
||||
fn filter(&self) -> &QemuInstrumentationPagingFilter {
|
||||
&self.paging_filter
|
||||
}
|
||||
|
@ -137,10 +137,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> HasInstrumentationFilter<(), S> for ()
|
||||
where
|
||||
S: UsesInput,
|
||||
{
|
||||
impl HasInstrumentationFilter<()> for () {
|
||||
fn filter(&self) -> &() {
|
||||
self
|
||||
}
|
||||
@ -150,10 +147,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<Head, F, S> HasInstrumentationFilter<F, S> for (Head, ())
|
||||
impl<Head, F> HasInstrumentationFilter<F> for (Head, ())
|
||||
where
|
||||
Head: QemuHelper<S> + HasInstrumentationFilter<F, S>,
|
||||
S: UsesInput,
|
||||
Head: HasInstrumentationFilter<F>,
|
||||
F: IsFilter,
|
||||
{
|
||||
fn filter(&self) -> &F {
|
||||
@ -258,7 +254,7 @@ impl IsFilter for Vec<Range<GuestAddr>> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HasInstrumentationFilter<F, S>
|
||||
pub trait HasInstrumentationFilter<F>
|
||||
where
|
||||
F: IsFilter,
|
||||
{
|
||||
@ -273,15 +269,15 @@ where
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "usermode")]
|
||||
pub trait StdInstrumentationFilter<S: UsesInput>:
|
||||
HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
pub trait StdInstrumentationFilter:
|
||||
HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
pub trait StdInstrumentationFilter<S: UsesInput>:
|
||||
HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
+ HasInstrumentationFilter<QemuInstrumentationPagingFilter, S>
|
||||
pub trait StdInstrumentationFilter:
|
||||
HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
+ HasInstrumentationFilter<QemuInstrumentationPagingFilter>
|
||||
{
|
||||
}
|
||||
|
||||
@ -290,7 +286,7 @@ static mut EMPTY_ADDRESS_FILTER: UnsafeCell<QemuInstrumentationAddressRangeFilte
|
||||
static mut EMPTY_PAGING_FILTER: UnsafeCell<QemuInstrumentationPagingFilter> =
|
||||
UnsafeCell::new(QemuFilterList::None);
|
||||
|
||||
impl<S> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S> for () {
|
||||
impl HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter> for () {
|
||||
fn filter(&self) -> &QemuInstrumentationAddressRangeFilter {
|
||||
&QemuFilterList::None
|
||||
}
|
||||
@ -300,7 +296,7 @@ impl<S> HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S> for (
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> HasInstrumentationFilter<QemuInstrumentationPagingFilter, S> for () {
|
||||
impl HasInstrumentationFilter<QemuInstrumentationPagingFilter> for () {
|
||||
fn filter(&self) -> &QemuInstrumentationPagingFilter {
|
||||
&QemuFilterList::None
|
||||
}
|
||||
@ -311,28 +307,23 @@ impl<S> HasInstrumentationFilter<QemuInstrumentationPagingFilter, S> for () {
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
impl<Head, S> StdInstrumentationFilter<S> for (Head, ())
|
||||
where
|
||||
Head: QemuHelper<S>
|
||||
+ HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>
|
||||
+ HasInstrumentationFilter<QemuInstrumentationPagingFilter, S>,
|
||||
S: UsesInput,
|
||||
impl<Head> StdInstrumentationFilter for (Head, ()) where
|
||||
Head: HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
+ HasInstrumentationFilter<QemuInstrumentationPagingFilter>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "usermode")]
|
||||
impl<Head, S> StdInstrumentationFilter<S> for (Head, ())
|
||||
where
|
||||
Head: QemuHelper<S> + HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter, S>,
|
||||
S: UsesInput,
|
||||
impl<Head> StdInstrumentationFilter for (Head, ()) where
|
||||
Head: HasInstrumentationFilter<QemuInstrumentationAddressRangeFilter>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(emulation_mode = "systemmode")]
|
||||
impl<S> StdInstrumentationFilter<S> for () where S: UsesInput {}
|
||||
impl StdInstrumentationFilter for () {}
|
||||
|
||||
#[cfg(emulation_mode = "usermode")]
|
||||
impl<S> StdInstrumentationFilter<S> for () where S: UsesInput {}
|
||||
impl StdInstrumentationFilter for () {}
|
||||
|
||||
pub trait IsFilter: Debug {
|
||||
type FilterParameter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user