X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_hvm.h;h=9d441d66e85ea3cb9c1c466f669a56f8daf6c60b;hb=d13fa71cb7a372c39ea92aaa69d74d63d9e0ed8e;hp=7f822206ac4081cc99781c4914c3387c85340a97;hpb=142b59ca44b3d00f0479910c986f6791216651e7;p=palacios.git diff --git a/palacios/include/palacios/vmm_hvm.h b/palacios/include/palacios/vmm_hvm.h index 7f82220..9d441d6 100644 --- a/palacios/include/palacios/vmm_hvm.h +++ b/palacios/include/palacios/vmm_hvm.h @@ -26,11 +26,28 @@ #include #include +struct v3_ros_event { + enum { ROS_NONE=0, ROS_PAGE_FAULT=1, ROS_SYSCALL=2 } event_type; + uint64_t last_ros_event_result; // valid when ROS_NONE + union { + struct { // valid when ROS_PAGE_FAULT + uint64_t rip; + uint64_t cr2; + enum {ROS_READ, ROS_WRITE} action; + } page_fault; + struct { // valid when ROS_SYSCALL + uint64_t args[8]; + } syscall; + }; +}; + struct v3_vm_hvm { uint8_t is_hvm; uint32_t first_hrt_core; uint64_t first_hrt_gpa; - struct v3_cfg_file *hrt_file; + struct v3_cfg_file *hrt_file; // image provided via PAL file, if any + void *hrt_image; // image provided by ROS, if any + uint64_t hrt_image_size; // size of this image uint64_t hrt_entry_addr; enum { HRT_BLOB, HRT_ELF64, HRT_MBOOT2, HRT_MBOOT64 } hrt_type; @@ -48,8 +65,12 @@ struct v3_vm_hvm { void *comm_page_hpa; void *comm_page_hva; - enum {HRT_IDLE=0, HRT_CALL, HRT_PARCALL, HRT_MERGE} trans_state; + enum {HRT_IDLE=0, HRT_CALL=1, HRT_PARCALL=2, HRT_SYNCSETUP=3, HRT_SYNC=4, HRT_SYNCTEARDOWN=5, HRT_MERGE=6} trans_state; uint64_t trans_count; + + // the ROS event to be handed back + struct v3_ros_event ros_event; + }; struct v3_core_hvm { @@ -173,7 +194,18 @@ int v3_handle_hvm_reset(struct guest_info *core); 0x1 => Reboot ROS 0x2 => Reboot HRT 0x3 => Reboot Both - 0xf => Get HRT transaction state + + 0x8 => Replace HRT image + pass in pointer (gva) and length of new image + + 0xf => Get HRT transaction state and current ROS event + first argument is pointer to the ROS event state + to be filled out + + 0x10 => ROS event request (HRT->ROS) + first argument is pointer where to write the ROS event state + 0x1f => ROS event completion (ROS->HRT) + first argument is the result code 0x20 => Invoke function (ROS->HRT) first argument is pointer to structure describing call