Skip to content

Commit

Permalink
x86_64: add hypercall
Browse files Browse the repository at this point in the history
  • Loading branch information
lacraig2 committed Jan 30, 2025
1 parent c06ba2b commit 57f6586
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions target/i386/tcg/misc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "exec/exec-all.h"
#include "helper-tcg.h"

bool panda_callbacks_guest_hypercall(CPUState *env);

/*
* NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS
* after generating a call to a helper that uses this.
Expand Down Expand Up @@ -53,6 +55,11 @@ void helper_cpuid(CPUX86State *env)

cpu_svm_check_intercept_param(env, SVM_EXIT_CPUID, 0, GETPC());

if (panda_callbacks_guest_hypercall(env_cpu(env))) {
// cpuid processed by one of the callbacks
return;
}

cpu_x86_cpuid(env, (uint32_t)env->regs[R_EAX], (uint32_t)env->regs[R_ECX],
&eax, &ebx, &ecx, &edx);
env->regs[R_EAX] = eax;
Expand Down

0 comments on commit 57f6586

Please sign in to comment.