[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <800f99f6-a1bf-41f3-bc65-67fbe4c61368@linux.intel.com>
Date: Tue, 20 May 2025 14:50:27 -0400
From: "Liang, Kan" <kan.liang@...ux.intel.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Mingwei Zhang <mizhang@...gle.com>, Peter Zijlstra
<peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini
<pbonzini@...hat.com>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>, Liang@...gle.com,
"H. Peter Anvin" <hpa@...or.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org, Yongwei Ma <yongwei.ma@...el.com>,
Xiong Zhang <xiong.y.zhang@...ux.intel.com>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>, Jim Mattson <jmattson@...gle.com>,
Sandipan Das <sandipan.das@....com>, Zide Chen <zide.chen@...el.com>,
Eranian Stephane <eranian@...gle.com>, Shukla Manali
<Manali.Shukla@....com>, Nikunj Dadhania <nikunj.dadhania@....com>
Subject: Re: [PATCH v4 04/38] perf: Add a EVENT_GUEST flag
On 2025-05-20 1:51 p.m., Namhyung Kim wrote:
>>>> @@ -1089,6 +1094,7 @@ struct bpf_perf_event_data_kern {
>>>> */
>>>> struct perf_cgroup_info {
>>>> struct perf_time_ctx time;
>>>> + struct perf_time_ctx timeguest;
>>>> int active;
>>>> };
>>>>
>>>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>>>> index e38c8b5e8086..7a2115b2c5c1 100644
>>>> --- a/kernel/events/core.c
>>>> +++ b/kernel/events/core.c
>>>> @@ -163,7 +163,8 @@ enum event_type_t {
>>>> /* see ctx_resched() for details */
>>>> EVENT_CPU = 0x10,
>>>> EVENT_CGROUP = 0x20,
>>>> - EVENT_FLAGS = EVENT_CGROUP,
>>>> + EVENT_GUEST = 0x40,
>>> It's not clear to me if this flag is for events to include guests or
>>> exclude them. Can you please add a comment?
>>>
>> /*
>> * There are guest events. The for_each_epc() iteration can
>> * skip those PMUs which doesn't support guest events via the
>> * MEDIATED_VPMU. It is also used to indicate the start/end of
>> * guest events to calculate the guest running time.
>> */
> Thanks for the explanation. So it's for events with !exclude_guest on
> host
The above "guest events" means that the events in a guest. The KVM
should only invokes the interface when a guest requires PMU.
For the host, for now, only the event with exclude_guest is supported.
The !exclude_guest event on host must be failed to be created if there
is a running VM.
and to do some operation only for host-only events on mediated
> vPMUs.
Yes.
Update the comments as below.
/*
* There are events in a guest enabled with MEDIATED_VPMU.
* The flag can be used in two places.
* - The for_each_epc() iteration can skip those PMUs which
* doesn't support the events in a guest via the MEDIATED_VPMU.
* - Indicate the start/end point of the events in a guest.
* The guest running time can be deducted for the
* host-only (exclude_guest) events.
*/
Thanks,
Kan
Powered by blists - more mailing lists