1 #include <geekos/svm_ctrl_regs.h>
2 #include <geekos/vmm_mem.h>
3 #include <geekos/vmm.h>
4 #include <geekos/vmcb.h>
5 #include <geekos/vmm_emulate.h>
8 int handle_cr0_write(guest_info_t * info, ullong_t * new_cr0) {
9 // vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA((vmcb_t *)(info->vmm_data));
10 //vmcb_saved_state_t * guest_state = GET_VMCB_SAVE_STATE_AREA((vmcb_t*)(info->vmm_data));
16 if (info->cpu_mode == REAL) {
18 shadow_region_t * region = get_shadow_region_by_addr(&(info->mem_map), (addr_t)(info->rip));
19 if (!region || (region->host_type != HOST_REGION_PHYSICAL_MEMORY)) {
24 guest_paddr_to_host_paddr(region, (addr_t)(info->rip), &host_addr);
28 PrintDebug("Instr: %.4x\n", *(ushort_t*)host_addr);
30 if ((*(ushort_t*)host_addr) == LMSW_EAX) {
31 PrintDebug("lmsw from eax (0x%x)\n", guest_state->rax);