KVM: x86: Add helper to consolidate core logic of SET_CPUID{2} flows
authorSean Christopherson <seanjc@google.com>
Fri, 5 Nov 2021 09:51:00 +0000 (09:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:02 +0000 (19:16 +0100)
commit35da6d291aca6ac0368bace8e54ccc17ac0a3074
tree8b72d47265bb32ac95cb9d1c67b36841794322c4
parent9d12bf19b2783300a617f849aed7c16404c77a3a
KVM: x86: Add helper to consolidate core logic of SET_CPUID{2} flows

commit 8b44b174f6aca815fc84c2038e4523ef8e32fabb upstream.

Move the core logic of SET_CPUID and SET_CPUID2 to a common helper, the
only difference between the two ioctls() is the format of the userspace
struct.  A future fix will add yet more code to the core logic.

No functional change intended.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211105095101.5384-2-pdurrant@amazon.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/cpuid.c