X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_ctrl_regs.c;h=3dab368cea1a7af18410108e719f212f5fd9b1f5;hb=1c46db5ec8d086d76f7120a638199564947694d3;hp=4575f9951f51c95e97dddabac944cfcf5cf98baa;hpb=f84bd0ca67af7c0a1143d5e279e0af408729128e;p=palacios-OLD.git diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index 4575f99..3dab368 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -1,3 +1,22 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Jack Lange + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + #include #include #include @@ -20,13 +39,10 @@ #endif - - - // First Attempt = 494 lines // current = 106 lines int handle_cr0_write(struct guest_info * info) { - char instr[15]; + uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -140,7 +156,7 @@ int handle_cr0_write(struct guest_info * info) { // First attempt = 253 lines // current = 51 lines int handle_cr0_read(struct guest_info * info) { - char instr[15]; + uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -202,11 +218,11 @@ int handle_cr0_read(struct guest_info * info) { -// First Attemp = 256 lines +// First Attempt = 256 lines // current = 65 lines int handle_cr3_write(struct guest_info * info) { int ret; - char instr[15]; + uchar_t instr[15]; struct x86_instr dec_instr; if (info->mem_mode == PHYSICAL_MEM) { @@ -246,14 +262,12 @@ int handle_cr3_write(struct guest_info * info) { cached = cache_page_tables32(info, CR3_TO_PDE32(*(addr_t *)new_cr3)); + if (cached == -1) { PrintError("CR3 Cache failed\n"); return -1; } else if (cached == 0) { - - addr_t shadow_pt; - PrintDebug("New CR3 is different - flushing shadow page table\n"); @@ -295,7 +309,7 @@ int handle_cr3_write(struct guest_info * info) { // first attempt = 156 lines // current = 36 lines int handle_cr3_read(struct guest_info * info) { - char instr[15]; + uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -334,12 +348,7 @@ int handle_cr3_read(struct guest_info * info) { return -1; } - info->rip += dec_instr.instr_length; return 0; } - - - -