HV: Add one hcall to set the upcall vector passed from sos_kernel

Currently the acrn-hypervisor is using the PLATFORM_IPI vector to notify
the sos_kernel. And then sos_kernel will handle the notification from acrn
hypervisor in PLATFORM_IPI ISR. But as the PLATFORM_IPI ISR can be registered
by the other modules, it will have the conflict when trying to register
acrn intr ISR. So the HYPERVISOR_CALLBACK_VECTOR will be used instead.

In order to switch the notification vector from PLATFORM_IPI to
HYPERVISOR_CALLBACK_VECTOR, one API is added so that sos can configure
the up-notifier interrrupt vector.

Tracked-On: https://github.com/projectacrn/acrn-hypervisor/issues/1325
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Zhao Yakui
2018-09-25 15:45:40 +08:00
committed by lijinxia
parent 228699131b
commit a189be26ff
4 changed files with 41 additions and 0 deletions

View File

@@ -1036,3 +1036,23 @@ int32_t hcall_vm_intr_monitor(struct vm *vm, uint16_t vmid, uint64_t param)
return 0;
}
/**
*@pre Pointer vm shall point to VM0
*/
int32_t hcall_set_callback_vector(struct vm *vm, uint64_t param)
{
if (!is_vm0(vm)) {
pr_err("%s: Targeting to service vm", __func__);
return -EPERM;
}
if ((param > NR_MAX_VECTOR) || (param < VECTOR_DYNAMIC_START)) {
pr_err("%s: Invalid passed vector\n");
return -EINVAL;
}
acrn_vhm_vector = param;
return 0;
}