diff --git a/hypervisor/arch/x86/guest/vmcall.c b/hypervisor/arch/x86/guest/vmcall.c index 13ae5a880..04cb7d368 100644 --- a/hypervisor/arch/x86/guest/vmcall.c +++ b/hypervisor/arch/x86/guest/vmcall.c @@ -205,7 +205,7 @@ struct acrn_vm *parse_target_vm(struct acrn_vm *service_vm, uint64_t hcall_id, u static int32_t dispatch_hypercall(struct acrn_vcpu *vcpu) { - int32_t ret = -EINVAL; + int32_t ret = -ENOTTY; struct acrn_vm *vm = vcpu->vm; uint64_t guest_flags = get_vm_config(vm->vm_id)->guest_flags; /* hypercall ID from guest */ uint64_t hcall_id = vcpu_get_gpreg(vcpu, CPU_REG_R8); /* hypercall ID from guest */ @@ -237,7 +237,7 @@ static int32_t dispatch_hypercall(struct acrn_vcpu *vcpu) ((guest_flags & permission_flags) != 0UL)) { ret = dispatch->handler(vcpu, vcpu->vm, param1, param2); } else { - /* The vCPU is not allowed to invoke the given hypercall. Keep `ret` as -EINVAL and no + /* The vCPU is not allowed to invoke the given hypercall. Keep `ret` as -ENOTTY and no * further actions required. */ } diff --git a/hypervisor/include/lib/errno.h b/hypervisor/include/lib/errno.h index bc8c0db75..3d682c5c3 100644 --- a/hypervisor/include/lib/errno.h +++ b/hypervisor/include/lib/errno.h @@ -23,6 +23,10 @@ #define ENODEV 19 /** Indicates that argument is not valid. */ #define EINVAL 22 +/** Indicates the operation is undefined. */ +#define ENOTTY 25 +/** Indicates the operation is obsoleted. */ +#define ENOSYS 38 /** Indicates that timeout occurs. */ #define ETIMEDOUT 110