On 08/01/2019 12:03, Christoffer Dall wrote: > On Tue, Jan 08, 2019 at 11:50:59AM +0000, Marc Zyngier wrote: >> On Tue, 08 Jan 2019 11:25:13 +0000, >> Andrew Murray <andrew.mur...@arm.com> wrote: >> >> Hi Andrew, >> >>> My only doubt about this is as follows. If, on a KVM host you run this: >>> >>> perf stat -e cycles:H lkvm run ... >>> >>> then on the VHE host the cycles reported represents the entire non-guest >>> cycles >>> associated with running the guest. >>> >>> On a !VHE, the cycles reported exclude EL2 (with or without this patch) and >>> thus you don't get a representation of all the non-guest cycles associated >>> with >>> the guest. However without this patch you could at least still run: >>> >>> perf stat -e cycles:H -e cycles:h lkvm run ... >>> >>> and then add the two cycle counts together to get something comparative with >>> the VHE host. >>> >>> If the above patch represents the desired semantics, then perhaps we must >>> count >>> both EL1 and *EL2* for !exclude_kernel on !VHE. In fact I think we should do >>> this anyway and remove a little complexity from armv8pmu_set_event_filter. >>> Thoughts? >> >> I'm not sure we should hide the architectural differences between VHE >> and !VHE. If you're trying to measure what is happening at in the >> hypervisor, you can't reason about it while ignoring the dual nature >> of !VHE. >> > > How do you define hypervisor here? Is that just the code that runs at > EL2 or also parts of KVM that runs at EL1?
I define it as "not a guest". Whatever is used to support a guest is the hypervisor. > It remains unclear to me why you'd want to measure a subset of KVM, > which happens to run in EL2, in your host (and hypervisor-enabled) > kernel, and you are even precluded from measuring a comparable portion > of your implementation on other Arm systems (VHE). Because I'm not trying to compare apples (VHE) and oranges (!VHE). My use-case for perf is to measure the impact of a change on a given implementation, and the more I can narrow the impact of that change, the better (specially when !VHE precludes the use of other techniques such as sampling). > Admittedly, I'm not at export in using perf, but I find this EL1/EL2 > distinction out of place as it relates to exlude_kernel, exlude_user, > and exlude_hv. Will we have a fourth Arm-specific flag which takes the > place of exclude_hv on PowerPC, which excludes an underlying hypervisor > when running a guest, should we ever support counting that in the > future? In all honestly, exclude_hv doesn't make much sense to me on a VHE system, unless you define an arbitrary cutting point where things are on one side or the other. As for a fourth flag, I have no idea. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm