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.


added configurable host OS thread support
[palacios.git] / palacios / src / palacios / vmx_assist.c
index f926c42..d836ad2 100644 (file)
 #include <palacios/vm_guest_mem.h>
 #include <palacios/vmx.h>
 
+#ifndef CONFIG_DEBUG_VMX
+#undef PrintDebug
+#define PrintDebug(fmt, args...)
+#endif
+
 static void vmx_save_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx);
 static void vmx_restore_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx);
 
@@ -33,7 +38,7 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) {
  
 
 
-    if (guest_pa_to_host_va(info, VMXASSIST_BASE, (addr_t *)&hdr) == -1) {
+    if (v3_gpa_to_hva(info, VMXASSIST_BASE, (addr_t *)&hdr) == -1) {
         PrintError("Could not translate address for vmxassist header\n");
         return -1;
     }
@@ -44,12 +49,12 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) {
     }
 
 
-    if (guest_pa_to_host_va(info, (addr_t)(hdr->old_ctx_gpa), (addr_t *)&(old_ctx)) == -1) {
+    if (v3_gpa_to_hva(info, (addr_t)(hdr->old_ctx_gpa), (addr_t *)&(old_ctx)) == -1) {
         PrintError("Could not translate address for VMXASSIST old context\n");
         return -1;
     }
 
-    if (guest_pa_to_host_va(info, (addr_t)(hdr->new_ctx_gpa), (addr_t *)&(new_ctx)) == -1) {
+    if (v3_gpa_to_hva(info, (addr_t)(hdr->new_ctx_gpa), (addr_t *)&(new_ctx)) == -1) {
         PrintError("Could not translate address for VMXASSIST new context\n");
         return -1;
     }
@@ -105,7 +110,7 @@ static void load_segment(struct vmx_assist_segment * vmx_assist_seg, struct v3_s
 static void vmx_save_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx) {
     struct vmx_data * vmx_info = (struct vmx_data *)(info->vmm_data);
 
-    PrintDebug("Writing from RIP: 0x%p\n", (void *)info->rip);
+    PrintDebug("Writing from RIP: 0x%p\n", (void *)(addr_t)info->rip);
     
     ctx->eip = info->rip;
     ctx->esp = info->vm_regs.rsp;