KVM: x86: Consolidate CPUID array max num entries checking
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 2 Mar 2020 23:56:16 +0000 (15:56 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:58:03 +0000 (17:58 +0100)
commitaa10a7dc8858f6cbd1ef5cb86693592896ee27c7
tree329401e40600298bb4b651388840e6e1c6fd3d88
parentacfad336ecf97ccad43346d7a82c60c3b21dbde0
KVM: x86: Consolidate CPUID array max num entries checking

Move the nent vs. maxnent check and nent increment into do_host_cpuid()
to consolidate what is now identical code.  To signal success vs.
failure, return the entry and NULL respectively.  A future patch will
build on this to also move the entry retrieval into do_host_cpuid().

No functional change intended.

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c