All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>, "bp@alien8.de" <bp@alien8.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"jmattson@google.com" <jmattson@google.com>,
	"wanpengli@tencent.com" <wanpengli@tencent.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"sean.j.christopherson@intel.com"
	<sean.j.christopherson@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>
Subject: 答复: [PATCH] [RFC] kvm: x86: emulate APERF/MPERF registers
Date: Sun, 26 Apr 2020 08:30:26 +0000	[thread overview]
Message-ID: <4fecc02b00f6469e81ffc40de4f7188c@baidu.com> (raw)
In-Reply-To: <20200424100143.GZ20730@hirez.programming.kicks-ass.net>

> 
> But then here you only emulate it for VMX, which then results in SVM guests
> going wobbly.
> 
> Also, on Intel, the moment you advertise APERFMPERF, we'll try and read
> MSR_PLATFORM_INFO / MSR_TURBO_RATIO_LIMIT*, I don't suppose you're
> passing those through as well?
> 

init_freq_invariance(void) is trying read MSR_PLATFORM_INFO / MSR_TURBO_RATIO_LIMIT*,
should we add a check of turbo status in init_freq_invariance, to avoid the reading?

It is unnecessary to call intel_set_max_freq_ratio  If turbo is disabled

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index fe3ab9632f3b..54fb88323293 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -2009,6 +2009,9 @@ static void init_freq_invariance(void)
        if (smp_processor_id() != 0 || !boot_cpu_has(X86_FEATURE_APERFMPERF))
                return;
 
+       if (turbo_disabled())
+               return;
+
        if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
                ret = intel_set_max_freq_ratio();

-Li

      parent reply	other threads:[~2020-04-26  8:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  5:08 [PATCH] [RFC] kvm: x86: emulate APERF/MPERF registers Li RongQing
2020-04-24 10:01 ` Peter Zijlstra
2020-04-24 14:46   ` Sean Christopherson
2020-04-24 16:25     ` Jim Mattson
2020-04-24 16:30       ` Paolo Bonzini
2020-04-26  3:24         ` 答复: " Li,Rongqing
2020-04-27 17:30           ` Jim Mattson
2020-04-27 19:10             ` Paolo Bonzini
2020-04-26  3:22     ` 答复: " Li,Rongqing
2020-04-26  8:30   ` Li,Rongqing [this message]

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=4fecc02b00f6469e81ffc40de4f7188c@baidu.com \
    --to=lirongqing@baidu.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.