kvm: x86: Fix a spurious -E2BIG in __do_cpuid_func
authorJim Mattson <jmattson@google.com>
Wed, 25 Sep 2019 18:17:14 +0000 (11:17 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Sep 2019 10:31:30 +0000 (12:31 +0200)
commita1a640b8c0cd8a2a7f84ab694f04bc64dc6988af
tree369893c787df8ebb498a44ef98cb7f570c2d4dab
parenta0f0037e908c656573d165aadbfae6c05fc4dd75
kvm: x86: Fix a spurious -E2BIG in __do_cpuid_func

Don't return -E2BIG from __do_cpuid_func when processing function 0BH
or 1FH and the last interesting subleaf occupies the last allocated
entry in the result array.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Fixes: 831bf664e9c1fc ("KVM: Refactor and simplify kvm_dev_ioctl_get_supported_cpuid")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c