#include <palacios/vmm.h>
#include <palacios/vmm_cpuid.h>
#include <palacios/vmm_lowlevel.h>
-
+#include <palacios/vm_guest.h>
void v3_init_cpuid_map(struct guest_info * info) {
uint32_t cpuid = info->vm_regs.rax;
struct v3_cpuid_hook * hook = get_cpuid_hook(info, cpuid);
+ //PrintDebug("CPUID called for 0x%x\n", cpuid);
+
if (hook == NULL) {
+ //PrintDebug("Calling passthrough handler\n");
// call the passthrough handler
v3_cpuid(cpuid,
(uint32_t *)&(info->vm_regs.rax),
(uint32_t *)&(info->vm_regs.rcx),
(uint32_t *)&(info->vm_regs.rdx));
} else {
+ // PrintDebug("Calling hook function\n");
+
if (hook->hook_fn(info, cpuid,
(uint32_t *)&(info->vm_regs.rax),
(uint32_t *)&(info->vm_regs.rbx),
}
}
+ // PrintDebug("Cleaning up register contents\n");
+
info->vm_regs.rax &= 0x00000000ffffffffLL;
info->vm_regs.rbx &= 0x00000000ffffffffLL;
info->vm_regs.rcx &= 0x00000000ffffffffLL;