From: Paolo Bonzini <pbonzini@redhat.com>
To: Ani Sinha <anisinha@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] kvm/i386: fix a check that ensures we are running on host intel CPU
Date: Tue, 3 Sep 2024 09:43:05 +0200 [thread overview]
Message-ID: <32332f54-0c20-434c-be43-e4e00bcebe29@redhat.com> (raw)
In-Reply-To: <20240903071942.32058-1-anisinha@redhat.com>
On 9/3/24 09:19, Ani Sinha wrote:
> is_host_cpu_intel() returns TRUE if the host cpu in Intel based. RAPL needs
> Intel host cpus. If the host CPU is not Intel baseed, we should report error.
> Fix the check accordingly.
>
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
It's the function that is returning the incorrect value too; so your
patch is breaking the feature: this line in is_host_cpu_intel()
return strcmp(vendor, CPUID_VENDOR_INTEL);
needs to be changed to use g_str_equal.
Paolo
> ---
> target/i386/kvm/kvm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index 11c7619bfd..503e8d956e 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -2898,7 +2898,7 @@ static int kvm_msr_energy_thread_init(KVMState *s, MachineState *ms)
> * 1. Host cpu must be Intel cpu
> * 2. RAPL must be enabled on the Host
> */
> - if (is_host_cpu_intel()) {
> + if (!is_host_cpu_intel()) {
> error_report("The RAPL feature can only be enabled on hosts\
> with Intel CPU models");
> ret = 1;
next prev parent reply other threads:[~2024-09-03 7:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 7:19 [PATCH] kvm/i386: fix a check that ensures we are running on host intel CPU Ani Sinha
2024-09-03 7:43 ` Paolo Bonzini [this message]
2024-09-03 8:00 ` Ani Sinha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32332f54-0c20-434c-be43-e4e00bcebe29@redhat.com \
--to=pbonzini@redhat.com \
--cc=anisinha@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox