]> git.itanic.dy.fi Git - linux-stable/commit
KVM: x86: Do runtime CPUID update before updating vcpu->arch.cpuid_entries
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 24 Jan 2022 13:05:31 +0000 (14:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 11:03:03 +0000 (12:03 +0100)
commitc34671d9f3b11b3eee75dacabf5c6e0d8a97cf8a
treef73012447bdbae310cdb3ef8531f86d5a7c062ce
parent32fb2bf4cdb550540d35839a0230f74051912af6
KVM: x86: Do runtime CPUID update before updating vcpu->arch.cpuid_entries

commit ee3a5f9e3d9bf94159f3cc80da542fbe83502dd8 upstream.

kvm_update_cpuid_runtime() mangles CPUID data coming from userspace
VMM after updating 'vcpu->arch.cpuid_entries', this makes it
impossible to compare an update with what was previously
supplied. Introduce __kvm_update_cpuid_runtime() version which can be
used to tweak the input before it goes to 'vcpu->arch.cpuid_entries'
so the upcoming update check can compare tweaked data.

No functional change intended.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20220117150542.2176196-2-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/cpuid.c