fix non-ipt mode
This commit is contained in:
parent
af13f3e73a
commit
1def26f83e
@ -110,12 +110,17 @@ bool handle_hypercall_kafl_next_payload(struct kvm_run *run,
|
||||
REQUEST_SAVE_SNAPSHOT_ROOT_FIX_RIP);
|
||||
setup_snapshot_once = true;
|
||||
|
||||
/* At this point we need to check if PT mode is enabled
|
||||
* and configured. Otherwise, libxdc_init() will fail.
|
||||
*/
|
||||
if(GET_GLOBAL_STATE()->nyx_pt && GET_GLOBAL_STATE()->cap_compile_time_tracing == false) {
|
||||
for (int i = 0; i < INTEL_PT_MAX_RANGES; i++) {
|
||||
if (GET_GLOBAL_STATE()->pt_ip_filter_configured[i]) {
|
||||
pt_enable_ip_filtering(cpu, i, true, false);
|
||||
}
|
||||
}
|
||||
pt_init_decoder(cpu);
|
||||
}
|
||||
request_fast_vm_reload(GET_GLOBAL_STATE()->reload_state,
|
||||
REQUEST_LOAD_SNAPSHOT_ROOT);
|
||||
|
||||
|
@ -376,9 +376,6 @@ static void check_available_ipt_ranges(nyx_interface_state *s)
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
nyx_abort("KVM-Nyx support is missing...\n");
|
||||
}
|
||||
close(kvm_fd);
|
||||
}
|
||||
|
||||
|
9
nyx/pt.c
9
nyx/pt.c
@ -227,6 +227,15 @@ void pt_init_decoder(CPUState *cpu)
|
||||
assert(GET_GLOBAL_STATE()->decoder == NULL);
|
||||
assert(GET_GLOBAL_STATE()->shared_bitmap_ptr != NULL);
|
||||
assert(GET_GLOBAL_STATE()->shared_bitmap_size != 0);
|
||||
|
||||
|
||||
if (GET_GLOBAL_STATE()->pt_ip_filter_configured[0] == false &&
|
||||
GET_GLOBAL_STATE()->pt_ip_filter_configured[1] == false &&
|
||||
GET_GLOBAL_STATE()->pt_ip_filter_configured[2] == false &&
|
||||
GET_GLOBAL_STATE()->pt_ip_filter_configured[3] == false) {
|
||||
nyx_abort("Intel PT mode cannot be enabled without any IP filters configured...\n");
|
||||
}
|
||||
|
||||
GET_GLOBAL_STATE()->decoder =
|
||||
libxdc_init(filters, (void *(*)(void *, uint64_t, bool *))page_cache_fetch2,
|
||||
GET_GLOBAL_STATE()->page_cache,
|
||||
|
Loading…
x
Reference in New Issue
Block a user