From ab9a1be9fe90643b423e166f7b4bdcfd5e04b304 Mon Sep 17 00:00:00 2001 From: Sergej Schumilo Date: Tue, 22 Nov 2022 09:29:47 +0100 Subject: [PATCH] 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) --- nyx/hypercall/configuration.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nyx/hypercall/configuration.c b/nyx/hypercall/configuration.c index 3be375724d..297b908d71 100644 --- a/nyx/hypercall/configuration.c +++ b/nyx/hypercall/configuration.c @@ -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; } - nyx_trace(); + 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);