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.


add correct caching behavior to VMX EPT environments
Jack Lange [Mon, 24 Sep 2012 20:21:59 +0000 (16:21 -0400)]
palacios/src/palacios/vmx.c
palacios/src/palacios/vmx_ctrl_regs.c
palacios/src/palacios/vmx_ept.c

index c341982..833d08e 100644 (file)
@@ -419,8 +419,10 @@ static int init_vmcs_bios(struct guest_info * core, struct vmx_data * vmx_state)
        // Cause VM_EXIT whenever the CR4.VMXE bit is set
        vmx_ret |= check_vmcs_write(VMCS_CR4_MASK, CR4_VMXE);
 #define CR0_NE 0x00000020
-       vmx_ret |= check_vmcs_write(VMCS_CR0_MASK, CR0_NE);
+#define CR0_CD 0x40000000
+       vmx_ret |= check_vmcs_write(VMCS_CR0_MASK, CR0_NE | CR0_CD);
        ((struct cr0_32 *)&(core->shdw_pg_state.guest_cr0))->ne = 1;
+       ((struct cr0_32 *)&(core->shdw_pg_state.guest_cr0))->cd = 0;
 
        if (v3_init_ept(core, &hw_info) == -1) {
            PrintError("Error initializing EPT\n");
index 2b0bfb5..0f10f7e 100644 (file)
@@ -246,6 +246,8 @@ static int handle_mov_to_cr0(struct guest_info * info, v3_reg_t * new_cr0, struc
            //    *(uint32_t *)shdw_cr0 = (0x00000020 & *(uint32_t *)new_shdw_cr0);
 
            *guest_cr0 = *new_shdw_cr0;
+
+           guest_cr0->cd = 0;
        }
 
        guest_cr0->ne = 1;
index d239bd2..2a7055d 100644 (file)
@@ -151,7 +151,9 @@ int v3_handle_ept_fault(struct guest_info * core, addr_t fault_addr, struct ept_
                // Full access
                pde2mb[pde_index].read = 1;
                pde2mb[pde_index].exec = 1;
-              
+               pde2mb[pde_index].ipat = 1;
+               pde2mb[pde_index].mt = 6;
+
                if (region->flags.write == 1) {
                    pde2mb[pde_index].write = 1;
                } else {
@@ -204,6 +206,8 @@ int v3_handle_ept_fault(struct guest_info * core, addr_t fault_addr, struct ept_
            // Full access
            pte[pte_index].read = 1;
            pte[pte_index].exec = 1;
+           pte[pte_index].ipat = 1;
+           pte[pte_index].mt = 6;
 
            if (region->flags.write == 1) {
                pte[pte_index].write = 1;