lkml.org 
[lkml]   [2020]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/61] KVM: x86: Refactor loop around do_cpuid_func() to separate helper
From
Date
On 07/02/20 20:53, Sean Christopherson wrote:
>
>> 2) Return -EINVAL instead.
> I agree that it _should_ be -EINVAL, but I just don't think it's worth
> the possibility of breaking (stupid) userspace that was doing something
> like:
>
> for (i = 0; i < max_cpuid_size; i++) {
> cpuid.nent = i;
>
> r = ioctl(fd, KVM_GET_SUPPORTED_CPUID, &cpuid);
> if (!r || r != -E2BIG)
> break;
> }
>

Apart from the stupidity of the above case, why would it be EINVAL?

I can do the change to drop the initializer when applying.

Paolo

\
 
 \ /
  Last update: 2020-02-25 15:38    [W:0.159 / U:12.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site