Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KVM_EXIT_KAFL_DISABLE_TIMEOUT to temporarily disable timeouts #51

Open
wants to merge 1 commit into
base: qemu-nyx-4.2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions linux-headers/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ struct kvm_hyperv_exit {

#define KVM_EXIT_KAFL_REQ_STREAM_DATA_BULK 138
#define KVM_EXIT_KAFL_PERSIST_PAGE_PAST_SNAPSHOT 139
#define KVM_EXIT_KAFL_DISABLE_TIMEOUT 140


#define KVM_CAP_NYX_PT 512
Expand Down
12 changes: 12 additions & 0 deletions nyx/hypercall/hypercall.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,14 @@ static void handle_hypercall_kafl_persist_page_past_snapshot(struct kvm_run *run
fast_reload_blacklist_page(get_fast_reload_snapshot(), phys_addr);
}

static void handle_hypercall_kafl_disable_timeout(struct kvm_run *run,
CPUState *cpu,
uint64_t hypercall_arg)
{
disarm_sigprof_timer(&GET_GLOBAL_STATE()->timeout_detector);
GET_GLOBAL_STATE()->timeout_detector.detection_enabled = false;
}

int handle_kafl_hypercall(struct kvm_run *run,
CPUState *cpu,
uint64_t hypercall,
Expand Down Expand Up @@ -996,6 +1004,10 @@ int handle_kafl_hypercall(struct kvm_run *run,
handle_hypercall_kafl_persist_page_past_snapshot(run, cpu, arg);
ret = 0;
break;
case KVM_EXIT_KAFL_DISABLE_TIMEOUT:
handle_hypercall_kafl_disable_timeout(run, cpu, arg);
ret = 0;
break;
}
return ret;
}