On 06/02/19 17:34, Peter Zijlstra wrote: > > How about we extend perf_guest_info_callback with an arch section and > add: > > diff --git a/kernel/events/core.c b/kernel/events/core.c > index 5aeb4c74fb99..76ce804e72c1 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -5835,6 +5835,9 @@ struct perf_guest_info_callbacks *perf_guest_cbs; > > int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) > { > + if (WARN_ON_ONCE(perf_guest_cbs)) > + return -EBUSY; > + > perf_guest_cbs = cbs; > return 0; > } > @@ -5842,6 +5845,9 @@ EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks); > > int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) > { > + if (WARN_ON_ONCE(perf_guest_cbs != cbs)) > + return -EINVAL; > + > perf_guest_cbs = NULL; > return 0; > } Makes total sense. Paolo