Re: [RFC PATCH v3 24/58] KVM: x86/pmu: Introduce macro PMU_CAP_PERF_METRICS

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

 



On 11/20/2024 1:03 AM, Sean Christopherson wrote:
> On Thu, Aug 01, 2024, Mingwei Zhang wrote:
>> From: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
>>
>> Define macro PMU_CAP_PERF_METRICS to represent bit[15] of
>> MSR_IA32_PERF_CAPABILITIES MSR. This bit is used to represent whether
>> perf metrics feature is enabled.
>>
>> Signed-off-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
>> Signed-off-by: Mingwei Zhang <mizhang@xxxxxxxxxx>
>> ---
>>  arch/x86/kvm/vmx/capabilities.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h
>> index 41a4533f9989..d8317552b634 100644
>> --- a/arch/x86/kvm/vmx/capabilities.h
>> +++ b/arch/x86/kvm/vmx/capabilities.h
>> @@ -22,6 +22,7 @@ extern int __read_mostly pt_mode;
>>  #define PT_MODE_HOST_GUEST	1
>>  
>>  #define PMU_CAP_FW_WRITES	(1ULL << 13)
>> +#define PMU_CAP_PERF_METRICS	BIT_ULL(15)
> BIT() should suffice.  The 1ULL used for FW_WRITES is unnecessary.  Speaking of
> which, can you update the other #defines while you're at it?  The mix of styles
> annoys me :-)
>
> #define PMU_CAP_FW_WRITES	BIT(13)
> #define PMU_CAP_PERF_METRICS	BIT(15)
> #define PMU_CAP_LBR_FMT		GENMASK(5, 0)

Sure.  Could we further move all these  PERF_CAPBILITIES macros into
arch/x86/include/asm/msr-index.h? I just found there are already some
PERF_CAPBILITIES macros defined in this file and it looks a better place to
define these macros.

#define PERF_CAP_PEBS_TRAP             BIT_ULL(6)
#define PERF_CAP_ARCH_REG              BIT_ULL(7)
#define PERF_CAP_PEBS_FORMAT           0xf00
#define PERF_CAP_PEBS_BASELINE         BIT_ULL(14)


>>  #define PMU_CAP_LBR_FMT		0x3f
>>  
>>  struct nested_vmx_msrs {
>> -- 
>> 2.46.0.rc1.232.g9752f9e123-goog
>>




[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