Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


moved guest_efer from top level guest_info to the shadow page state
Jack Lange [Sun, 26 Apr 2009 22:58:19 +0000 (17:58 -0500)]
palacios/include/palacios/vmm_shadow_paging.h
palacios/src/palacios/svm.c
palacios/src/palacios/vm_guest.c
palacios/src/palacios/vmm_ctrl_regs.c
palacios/src/palacios/vmm_shadow_paging.c

index e10615a..247c471 100644 (file)
@@ -27,6 +27,7 @@
 #include <palacios/vmm_paging.h>
 #include <palacios/vmm_hashtable.h>
 #include <palacios/vmm_list.h>
+#include <palacios/vmm_msr.h>
 
 
 struct shadow_page_state {
@@ -34,6 +35,7 @@ struct shadow_page_state {
     // virtualized control registers
     v3_reg_t guest_cr3;
     v3_reg_t guest_cr0;
+    v3_msr_t guest_efer;
 
     // list of allocated shadow pages
     struct list_head page_list;
index c577a7d..36d58dd 100644 (file)
@@ -220,8 +220,6 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) {
 
        ctrl_area->exceptions.pf = 1;
 
-
-
        guest_state->g_pat = 0x7040600070406ULL;
 
        guest_state->cr0 |= 0x80000000;
index 1eee109..c846415 100644 (file)
@@ -35,7 +35,7 @@ v3_cpu_mode_t v3_get_vm_cpu_mode(struct guest_info * info) {
 
     if (info->shdw_pg_mode == SHADOW_PAGING) {
        cr0 = (struct cr0_32 *)&(info->shdw_pg_state.guest_cr0);
-       efer = (struct efer_64 *)&(info->guest_efer);
+       efer = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
     } else if (info->shdw_pg_mode == NESTED_PAGING) {
        cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0);
        efer = (struct efer_64 *)&(guest_state->efer);
@@ -69,7 +69,7 @@ uint_t v3_get_addr_width(struct guest_info * info) {
 
     if (info->shdw_pg_mode == SHADOW_PAGING) {
        cr0 = (struct cr0_32 *)&(info->shdw_pg_state.guest_cr0);
-       efer = (struct efer_64 *)&(info->guest_efer);
+       efer = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
     } else if (info->shdw_pg_mode == NESTED_PAGING) {
        cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0);
        efer = (struct efer_64 *)&(guest_state->efer);
index bc768ac..5975daf 100644 (file)
@@ -120,7 +120,7 @@ static int handle_mov_to_cr0(struct guest_info * info, struct x86_instr * dec_in
     if (paging_transition) {
        if (v3_get_vm_mem_mode(info) == VIRTUAL_MEM) {
            
-           struct efer_64 * guest_efer  = (struct efer_64 *)&(info->guest_efer);
+           struct efer_64 * guest_efer  = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
            struct efer_64 * shadow_efer = (struct efer_64 *)&(info->ctrl_regs.efer);
            
            // Check long mode LME to set LME
@@ -541,9 +541,9 @@ int v3_handle_cr4_write(struct guest_info * info) {
 
 int v3_handle_efer_read(uint_t msr, struct v3_msr * dst, void * priv_data) {
     struct guest_info * info = (struct guest_info *)(priv_data);
-    PrintDebug("EFER Read HI=%x LO=%x\n", info->guest_efer.hi, info->guest_efer.lo);
+    PrintDebug("EFER Read HI=%x LO=%x\n", info->shdw_pg_state.guest_efer.hi, info->shdw_pg_state.guest_efer.lo);
     
-    dst->value = info->guest_efer.value;
+    dst->value = info->shdw_pg_state.guest_efer.value;
     
     info->rip += 2; // WRMSR/RDMSR are two byte operands
     return 0;
@@ -556,7 +556,7 @@ int v3_handle_efer_write(uint_t msr, struct v3_msr src, void * priv_data) {
     struct guest_info * info = (struct guest_info *)(priv_data);
     //struct efer_64 * new_efer = (struct efer_64 *)&(src.value);
     struct efer_64 * shadow_efer = (struct efer_64 *)&(info->ctrl_regs.efer);
-    struct v3_msr * guest_efer = &(info->guest_efer);
+    struct v3_msr * guest_efer = &(info->shdw_pg_state.guest_efer);
     
     PrintDebug("EFER Write\n");
     PrintDebug("EFER Write Values: HI=%x LO=%x\n", src.hi, src.lo);
index 0cc5dc5..3f12f05 100644 (file)
@@ -66,6 +66,7 @@ int v3_init_shadow_page_state(struct guest_info * info) {
   
     state->guest_cr3 = 0;
     state->guest_cr0 = 0;
+    state->guest_efer.value = 0x0LL;
 
     INIT_LIST_HEAD(&(state->page_list));