]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/machine_task.c
xnu-3248.60.10.tar.gz
[apple/xnu.git] / osfmk / i386 / machine_task.c
index 3c2d93ffd30fe4f4315abb342a0cf803117893f9..342f123f53c2b1fe21e72894139fd152b464822c 100644 (file)
 #include <kern/thread.h>
 #include <i386/misc_protos.h>
 
+#if HYPERVISOR
+#include <kern/hv_support.h>
+#endif
+
 extern zone_t ids_zone;
 
 kern_return_t
@@ -240,6 +244,13 @@ machine_task_terminate(task_t task)
                user_ldt_t user_ldt;
                void *task_debug;
 
+#if HYPERVISOR
+               if (task->hv_task_target) {
+                       hv_callbacks.task_destroy(task->hv_task_target);
+                       task->hv_task_target = NULL;
+               }
+#endif
+
                user_ldt = task->i386_ldt;
                if (user_ldt != 0) {
                        task->i386_ldt = 0;