X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_hvm.c;h=ff5b34f2c349d152083543c29644aa54b6c2cf67;hp=26d3298b5b96ab987d565b5600a57034a9e03f29;hb=bf732d7c9e2940ed8dddcb30ff70bdc06bbfdc3b;hpb=9d346ee2cf8a7f2a79dc4929b8e0416de7d8f8c8 diff --git a/palacios/src/palacios/vmm_hvm.c b/palacios/src/palacios/vmm_hvm.c index 26d3298..ff5b34f 100644 --- a/palacios/src/palacios/vmm_hvm.c +++ b/palacios/src/palacios/vmm_hvm.c @@ -157,9 +157,34 @@ static int hvm_hcall_handler(struct guest_info * core , hcall_id_t hcall_id, voi case 0xf: // get HRT state core->vm_regs.rax = h->trans_state; + if (v3_write_gva_memory(core, a2, sizeof(h->ros_event), (uint8_t*) &h->ros_event)!=sizeof(h->ros_event)) { + PrintError(core->vm_info, core, "hvm: cannot write back ROS event state to %p - continuing\n",(void*)a2); + } //PrintDebug(core->vm_info,core,"hvm: get HRT transaction state 0x%llx\n",core->vm_regs.rax); break; + case 0x10: + PrintDebug(core->vm_info, core, "hvm: ROS event request\n"); + if (h->ros_event.event_type!=ROS_NONE) { + PrintError(core->vm_info, core, "hvm: ROS event is already in progress\n"); + core->vm_regs.rax = -1; + } else { + if (v3_read_gva_memory(core, a2, sizeof(h->ros_event), (uint8_t*)&h->ros_event)!=sizeof(h->ros_event)) { + PrintError(core->vm_info, core, "hvm: cannot read ROS event from %p\n",(void*)a2); + core->vm_regs.rax = -1; + } else { + core->vm_regs.rax = 0; + } + } + + break; + + case 0x1f: + PrintDebug(core->vm_info, core, "hvm: completion of ROS event (rc=0x%llx)\n",a2); + h->ros_event.event_type=ROS_NONE; + h->ros_event.last_ros_event_result = a2; + break; + case 0x20: // invoke function (ROS->HRT) case 0x21: // invoke parallel function (ROS->HRT) if (v3_is_hvm_hrt_core(core)) {