On 11/09/15 14:35, Shannon Zhao wrote: > > > On 2015/9/11 19:04, Marc Zyngier wrote: [...] >> Having had a chat with Will, it appears that a much better solution >> would be to ask perf to use raw events instead of trying to map things >> to perf events (which the guest has already done). >> >> See drivers/oprofile/oprofile_perf.c::op_perf_setup(). >> >> Thoughts? >> > > Yeah, directly using PERF_TYPE_RAW event looks simpler. But should we > check whether the value of event number written to PMXEVTYPER_EL0 is > valid? Or That is guaranteed by guest? I don't think we need to check for anything. Userspace is allowed to request any event and the PMU will count it if this event exists, or won't if it doesn't. We shouldn't be doing more validation than that, if only because most events are microarchitectural, and they are mostly undocumented. Thanks, M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html