Allow multiple GET_HOST_CONFIG, but abort on SET_AGENT_CONFIG

GET_HOST_CONFIG may be queried multiple times to verify host
magic/version info by different tools. Only inform in debug mode.
This commit is contained in:
Steffen Schulz 2022-11-16 00:43:08 +01:00 committed by Sergej Schumilo
parent eb1b6e6da6
commit 2889f88a00

View File

@ -17,10 +17,7 @@ void handle_hypercall_kafl_get_host_config(struct kvm_run *run,
return; return;
} }
if (GET_GLOBAL_STATE()->get_host_config_done) { nyx_trace();
nyx_abort((char *)"KVM_EXIT_KAFL_GET_HOST_CONFIG called twice...");
return;
}
memset((void *)&config, 0, sizeof(host_config_t)); memset((void *)&config, 0, sizeof(host_config_t));
@ -47,8 +44,7 @@ void handle_hypercall_kafl_set_agent_config(struct kvm_run *run,
} }
if (GET_GLOBAL_STATE()->set_agent_config_done) { if (GET_GLOBAL_STATE()->set_agent_config_done) {
nyx_abort((char *)"KVM_EXIT_KAFL_SET_AGENT_CONFIG called twice..."); nyx_abort("SET_AGENT_CONFIG called twice.");
return;
} }
X86CPU *cpux86 = X86_CPU(cpu); X86CPU *cpux86 = X86_CPU(cpu);