[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zhd6k8jn.fsf@vitty.brq.redhat.com>
Date: Tue, 25 Feb 2020 16:09:48 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/61] KVM: x86: Refactor loop around do_cpuid_func() to separate helper
Paolo Bonzini <pbonzini@...hat.com> writes:
> 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 suggested -EINVAL because issuing KVM_GET_SUPPORTED_CPUID with nent=0
looks more like a completely invalid input and not 'too many
entries'(-E2BIG) to me (but -E2BIG is already there, let's keep it, it's
not a big deal).
> I can do the change to drop the initializer when applying.
We're agreed with Sean on a few cosmetic changes in other patches of
this series, wait for v2)
--
Vitaly
Powered by blists - more mailing lists