On Mon, Oct 24, 2022, Like Xu wrote: > @@ -194,4 +197,34 @@ static inline void reset_all_counters(void) > reset_all_fixed_counters(); > } > > +static inline void pmu_clear_global_status(void) > +{ > + wrmsr(pmu.msr_global_status_clr, rdmsr(pmu.msr_global_status)); > +} > + > +static inline u64 pmu_get_global_status(void) > +{ > + return rdmsr(pmu.msr_global_status); > +} > + > +static inline u64 pmu_get_global_enable(void) > +{ > + return rdmsr(pmu.msr_global_ctl); > +} > + > +static inline void pmu_set_global_enable(u64 bitmask) > +{ > + wrmsr(pmu.msr_global_ctl, bitmask); > +} > + > +static inline void pmu_reset_global_enable(void) > +{ > + wrmsr(pmu.msr_global_ctl, 0); > +} > + > +static inline void pmu_ack_global_status(u64 value) > +{ > + wrmsr(pmu.msr_global_status_clr, value); > +} Other, than pmu_clear_global_status(), which provides novel functionality, the rest of these wrappers are superfluous.