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 ability to inject an env variable into guest user process
[palacios.git] / palacios / src / palacios / vm_guest.c
index 92f49b6..5281dd4 100644 (file)
 #include <palacios/vm_guest_mem.h>
 #include <palacios/vmm_lowlevel.h>
 #include <palacios/vmm_sprintf.h>
-#include <palacios/vmm_muxer.h>
 #include <palacios/vmm_xed.h>
 #include <palacios/vmm_direct_paging.h>
 
+#ifdef CONFIG_SYSCALL_HIJACK
+#include <palacios/vmm_syscall_hijack.h>
+#endif
+
 
 
 v3_cpu_mode_t v3_get_vm_cpu_mode(struct guest_info * info) {
@@ -526,9 +529,7 @@ static int info_hcall(struct guest_info * core, uint_t hcall_id, void * priv_dat
 int v3_init_vm(struct v3_vm_info * vm) {
     v3_cpu_arch_t cpu_type = v3_get_cpu_type(V3_Get_CPU());
 
-    if (v3_get_foreground_vm() == NULL) {
-       v3_set_foreground_vm(vm);
-    }
+
 
 #ifdef CONFIG_TELEMETRY
     v3_init_telemetry(vm);
@@ -657,6 +658,8 @@ int v3_init_core(struct guest_info * core) {
     v3_cpu_arch_t cpu_type = v3_get_cpu_type(V3_Get_CPU());
     struct v3_vm_info * vm = core->vm_info;
 
+
+
     /*
      * Initialize the subsystem data strutures
      */
@@ -679,6 +682,16 @@ int v3_init_core(struct guest_info * core) {
     v3_init_symbiotic_core(core);
 #endif
 
+/* KCH: Hook INT 80
+      not sure about this location though...*/
+#ifdef CONFIG_SYSCALL_HIJACK
+    v3_hook_swintr(core, 0x80, v3_syscall_handler, NULL);
+    /* hook a poll syscall */
+    //v3_hook_syscall(core, 5, v3_sysopen_handler, NULL);
+    //v3_hook_syscall(core, 21, v3_sysmount_handler, NULL);
+    v3_hook_syscall(core, 11, v3_sysexecve_handler, NULL);
+#endif  
+
     // init SVM/VMX