Re: [kvm-unit-tests PATCH v4 18/24] x86/pmu: Add a set of helpers related to global registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux