Fix previous patch (GET_HOST / SET_AGENT config)

- fix debug mode (by including nyx/debug.h)
- call qemu_trace() only if host_config has already been requested once
- change nyx_abort message back to previous one (otherwise some tests will break)
This commit is contained in:
Sergej Schumilo 2022-11-22 09:29:47 +01:00
parent 2889f88a00
commit ab9a1be9fe

View File

@ -5,6 +5,7 @@
#include "nyx/hypercall/configuration.h"
#include "nyx/memory_access.h"
#include "nyx/state/state.h"
#include "nyx/debug.h"
void handle_hypercall_kafl_get_host_config(struct kvm_run *run,
CPUState *cpu,
@ -17,7 +18,9 @@ void handle_hypercall_kafl_get_host_config(struct kvm_run *run,
return;
}
if (GET_GLOBAL_STATE()->get_host_config_done) {
nyx_trace();
}
memset((void *)&config, 0, sizeof(host_config_t));
@ -44,7 +47,7 @@ void handle_hypercall_kafl_set_agent_config(struct kvm_run *run,
}
if (GET_GLOBAL_STATE()->set_agent_config_done) {
nyx_abort("SET_AGENT_CONFIG called twice.");
nyx_abort((char *)"KVM_EXIT_KAFL_SET_AGENT_CONFIG called twice...");
}
X86CPU *cpux86 = X86_CPU(cpu);