kvm/i386: fix return values of is_host_cpu_intel()
authorAni Sinha <anisinha@redhat.com>
Tue, 3 Sep 2024 08:00:04 +0000 (13:30 +0530)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Oct 2024 10:58:46 +0000 (12:58 +0200)
commit87e82951c155175c8681509e8d25a6dac919c0c9
tree3f67ee3d265909458acd2af44d00018db1f199bb
parented2880f4e93bf83106ebdc8562a5ee4d93285a3b
kvm/i386: fix return values of is_host_cpu_intel()

is_host_cpu_intel() should return TRUE if the host cpu in Intel based, otherwise
it should return FALSE. Currently, it returns zero (FALSE) when the host CPU
is INTEL and non-zero otherwise. Fix the function so that it agrees more with
the semantics. Adjust the calling logic accordingly. RAPL needs Intel host cpus.
If the host CPU is not Intel baseed, we should report error.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20240903080004.33746-1-anisinha@redhat.com
[While touching the code remove too many spaces from the second part of the
 error. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm/kvm.c
target/i386/kvm/vmsr_energy.c