mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv: extend sbuf hypercall
Extend sbuf hypercall to support other kinds of share buffer. Tracked-On: #8209 Signed-off-by: Conghui <conghui.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -518,6 +518,33 @@ int32_t hcall_set_ioreq_buffer(struct acrn_vcpu *vcpu, struct acrn_vm *target_vm
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Setup a share buffer for a VM.
|
||||
*
|
||||
* @param vcpu Pointer to vCPU that initiates the hypercall
|
||||
* @param param1 guest physical address. This gpa points to
|
||||
* struct sbuf_setup_param
|
||||
*
|
||||
* @pre is_service_vm(vcpu->vm)
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_setup_sbuf(struct acrn_vcpu *vcpu, struct acrn_vm *target_vm,
|
||||
__unused uint64_t param1, uint64_t param2)
|
||||
{
|
||||
struct acrn_vm *vm = vcpu->vm;
|
||||
struct acrn_sbuf_param asp;
|
||||
uint64_t *hva;
|
||||
int ret = -1;
|
||||
|
||||
if (copy_from_gpa(vm, &asp, param2, sizeof(asp)) == 0) {
|
||||
if (asp.gpa != 0U) {
|
||||
hva = (uint64_t *)gpa2hva(vm, asp.gpa);
|
||||
ret = sbuf_setup_common(target_vm, asp.cpu_id, asp.sbuf_id, hva);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief notify request done
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user