vmm: add AKAROS_VMCALL_SHUTDOWN (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 12 Jun 2019 21:06:45 +0000 (17:06 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Jul 2019 18:29:21 +0000 (14:29 -0400)
Guests can use this vmcall to ask to be shutdown / powered off.

Reinstall your kernel headers.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/ros/vmm.h
user/vmm/vmexit.c

index a9b3196..172e3ce 100644 (file)
@@ -13,6 +13,7 @@
 #define AKAROS_VMCALL_SMPBOOT          0x2
 #define AKAROS_VMCALL_GET_TSCFREQ      0x3
 #define AKAROS_VMCALL_TRACE_TF         0x4
+#define AKAROS_VMCALL_SHUTDOWN         0x5
 
 #define VMM_CTL_GET_EXITS              1
 #define VMM_CTL_SET_EXITS              2
index 6150081..1153895 100644 (file)
@@ -11,6 +11,7 @@
 #include <parlib/arch/trap.h>
 #include <parlib/bitmask.h>
 #include <parlib/stdio.h>
+#include <stdlib.h>
 
 static bool pir_notif_is_set(struct vmm_gpcore_init *gpci)
 {
@@ -303,6 +304,8 @@ static bool handle_vmcall(struct guest_thread *gth)
                trace_printf("GPA    0x%016lx\n",      vm_tf->tf_guest_pa);
                retval = true;
                break;
+       case AKAROS_VMCALL_SHUTDOWN:
+               exit(0);
        }
 
        if (retval)