mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de,
	peterz@infradead.org, mingo@redhat.com, ak@linux.intel.com,
	eranian@google.com
Subject: Re: [PATCH V5 2/4] perf/x86/kvm: Avoid unnecessary work in guest filtering
Date: Wed, 16 Jan 2019 13:58:46 -0500	[thread overview]
Message-ID: <b5acda13-a4f8-397c-586f-dd506cfe2d7f@linux.intel.com> (raw)
In-Reply-To: <20190116131401.GG15409@zn.tnic>



On 1/16/2019 8:14 AM, Borislav Petkov wrote:
>> +static __init void intel_isolation_quirk(void)
>> +{
>> +	x86_pmu.check_microcode = intel_check_isolation;
>> +	intel_check_isolation();
>> +}
>> +
>>   static const struct { int id; char *name; } intel_arch_events_map[] __initconst = {
>>   	{ PERF_COUNT_HW_CPU_CYCLES, "cpu cycles" },
>>   	{ PERF_COUNT_HW_INSTRUCTIONS, "instructions" },
>> @@ -4424,6 +4483,7 @@ __init int intel_pmu_init(void)
>>   	case INTEL_FAM6_HASWELL_X:
>>   	case INTEL_FAM6_HASWELL_ULT:
>>   	case INTEL_FAM6_HASWELL_GT3E:
>> +		x86_add_quirk(intel_isolation_quirk);
> And reportedly, the quirks are one-off things - not what this one
> needs to do. So you need to run this unconditionally at the end of
> intel_pmu_init() and get rid of all that quirks indirection.

Hi Borislav,

Thanks for the review. I will change the code according to all your 
comments.

Besides, I will do one more change which impacts your last comment.

Current intel_check_isolation() will set x86_pmu.pebs_isolated=0 for the 
platforms not in the table. It's OK for now. But it will be a problem 
for future platforms.
I've confirmed with Andi. The microcode patch has been merged into 
future platforms. So we have to always set x86_pmu.pebs_isolated=1 for 
future platforms. That means we have to add the CPU model to the table 
for each new platforms. It will be hard to maintain.

I plan to rename x86_pmu.pebs_isolated to x86_pmu.no_pebs_isolation. The 
default value for x86_pmu.no_pebs_isolation is 0. So we don't need to 
worry about the future platforms.
The unconditional check will be moved to the begin of intel_pmu_init(). 
The old platforms, which doesn't have microcode fix, will be specially 
handled by adding x86_pmu.no_pebs_isolation=1 after each "case :" of old 
platforms.

Thanks,
Kan

  reply	other threads:[~2019-01-16 18:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 22:34 [PATCH V5 1/4] x86/cpufeature: Add facility to check for min microcode revisions kan.liang
2019-01-07 22:34 ` [PATCH V5 2/4] perf/x86/kvm: Avoid unnecessary work in guest filtering kan.liang
2019-01-16 13:14   ` Borislav Petkov
2019-01-16 18:58     ` Liang, Kan [this message]
2019-01-07 22:34 ` [PATCH V5 3/4] perf/x86/intel: Clean up counter freezing quirk kan.liang
2019-01-07 22:34 ` [PATCH V5 4/4] perf/x86/intel: Add counter freezing quirk for Goldmont kan.liang
2019-01-16 12:20 ` [PATCH V5 1/4] x86/cpufeature: Add facility to check for min microcode revisions Borislav Petkov

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=b5acda13-a4f8-397c-586f-dd506cfe2d7f@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome