lkml.org 
[lkml]   [2021]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5.10 049/101] KVM: selftests: Fix kvm_check_cap() assertion
From
Date
On 05/07/21 09:10, Fuad Tabba wrote:
>>>
>>> ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
>>> - TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
>>> + TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n"
>>> " rc: %i errno: %i", ret, errno);
> There's at least one case that I am aware of that potentially would
> return a value other than -1 on error, which is a check for
> KVM_CAP_MSI_DEVID (-EINVAL, -22):
>
> https://elixir.bootlin.com/linux/latest/source/arch/arm64/kvm/arm.c#L229

In userspace that becomes -1, errno == EINVAL. I probably just misread
the "ret != -1" as "ret == 0" when applying this patch; it doesn't hurt
but it is certainly not needed for stable.

Paolo

\
 
 \ /
  Last update: 2021-07-05 14:01    [W:1.421 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site