KVM: x86: Do not return host topology information from KVM_GET_SUPPORTED_CPUID
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 22 Oct 2022 08:17:53 +0000 (04:17 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:10 +0000 (11:58 +0100)
commitd778e68faa6a8f42a0bf19c1d9dd9d19b21d5c0a
treed42147020b8ed3b3ad83a272e0197d843d2f358c
parent82972d60f46f3241e3aa04a12c05dca0c2a1e166
KVM: x86: Do not return host topology information from KVM_GET_SUPPORTED_CPUID

commit 45e966fcca03ecdcccac7cb236e16eea38cc18af upstream.

Passing the host topology to the guest is almost certainly wrong
and will confuse the scheduler.  In addition, several fields of
these CPUID leaves vary on each processor; it is simply impossible to
return the right values from KVM_GET_SUPPORTED_CPUID in such a way that
they can be passed to KVM_SET_CPUID2.

The values that will most likely prevent confusion are all zeroes.
Userspace will have to override it anyway if it wishes to present a
specific topology to the guest.

Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/virt/kvm/api.rst
arch/x86/kvm/cpuid.c