[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191030095031.GR4097@hirez.programming.kicks-ass.net>
Date: Wed, 30 Oct 2019 10:50:31 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: "Kang, Luwei" <luwei.kang@...el.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"Christopherson, Sean J" <sean.j.christopherson@...el.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"wanpengli@...cent.com" <wanpengli@...cent.com>,
"jmattson@...gle.com" <jmattson@...gle.com>,
"joro@...tes.org" <joro@...tes.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>,
"x86@...nel.org" <x86@...nel.org>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>,
"acme@...nel.org" <acme@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"jolsa@...hat.com" <jolsa@...hat.com>,
"namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [PATCH v1 3/8] KVM: x86: Allocate performance counter for PEBS
event
On Wed, Oct 30, 2019 at 08:42:10AM +0200, Alexander Shishkin wrote:
> "Kang, Luwei" <luwei.kang@...el.com> writes:
>
> >> > static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
> >> > unsigned config, bool exclude_user,
> >> > bool exclude_kernel, bool intr,
> >> > - bool in_tx, bool in_tx_cp)
> >> > + bool in_tx, bool in_tx_cp, bool pebs)
> >> > {
> >> > struct perf_event *event;
> >> > struct perf_event_attr attr = {
> >> > @@ -111,9 +111,12 @@ static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
> >> > .exclude_user = exclude_user,
> >> > .exclude_kernel = exclude_kernel,
> >> > .config = config,
> >> > + .precise_ip = pebs ? 1 : 0,
> >> > + .aux_output = pebs ? 1 : 0,
> >>
> >> srsly?
> >
> > Hi Peter,
> > Thanks for review. For aux_output, I think it should be set 1 when the guest wants to enabled PEBS by Intel PT.
>
> attr.aux_output==1 means your group leader should be an intel_pt event
> for this to succeed. Luckily for this instance,
> perf_event_create_kernel_counter() doesn't actually check the
> attr.aux_output.
>
> Also, does 'bool pebs' mean PEBS-via-PT or just a PEBS counter? Or does
> it mean that in kvm it's the same thing?
It means pebs-over-pt, they only allow pebs if the output to pt bit is
set.
Powered by blists - more mailing lists