答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-06 Thread Li,Rongqing
eng Li ; Vitaly > Kuznetsov ; Sean Christopherson > ; wei.hua...@amd.com > 主题: Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers > > On 05/06/20 19:16, Jim Mattson wrote: > >>>> @@ -4930,6 +4939,11 @@ int kvm_vm_ioctl_enable_cap(struct kvm > *kvm, > &

Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-05 Thread Paolo Bonzini
On 05/06/20 19:16, Jim Mattson wrote: @@ -4930,6 +4939,11 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, kvm->arch.exception_payload_enabled = cap->args[0]; r = 0; break; +case KVM_CAP_APERFMPERF: +kvm->arch.aperfmperf_mode =

Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-05 Thread Jim Mattson
On Thu, Jun 4, 2020 at 11:35 PM Paolo Bonzini wrote: > > On 05/06/20 07:00, Xiaoyao Li wrote: > > you could do > > > > bool guest_cpuid_aperfmperf = false; > > if (best) > > guest_cpuid_aperfmperf = !!(best->ecx & BIT(0)); > > > > if (guest_cpuid_aperfmerf !=

Re: 答复: 答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-05 Thread Paolo Bonzini
On 05/06/20 11:41, Li,Rongqing wrote: >> >> As you said, "Pass-though: it is only suitable for KVM_HINTS_REALTIME", which >> means, KVM needs to make sure the kvm->arch.aperfmperf_mode value could >> "only" be set to KVM_APERFMPERF_PT when the check >> kvm_para_has_hint(KVM_HINTS_REALTIME) is

答复: 答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-05 Thread Li,Rongqing
; jmatt...@google.com; wanpen...@tencent.com; vkuzn...@redhat.com; > sean.j.christopher...@intel.com; pbonz...@redhat.com; xiaoyao...@intel.com; > wei.hua...@amd.com > 主题: Re: 答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers > > On 2020/6/5 12:23, Li,Rongqing wrote: > >

Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-05 Thread Paolo Bonzini
On 05/06/20 07:00, Xiaoyao Li wrote: > you could do > > bool guest_cpuid_aperfmperf = false; > if (best) >     guest_cpuid_aperfmperf = !!(best->ecx & BIT(0)); > > if (guest_cpuid_aperfmerf != guest_has_aperfmperf(vcpu->kvm)) >     return -EINVAL; > > > In fact, I think we

Re: 答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-04 Thread Like Xu
...@google.com; wanpen...@tencent.com; vkuzn...@redhat.com; sean.j.christopher...@intel.com; pbonz...@redhat.com; xiaoyao...@intel.com; wei.hua...@amd.com 主题: Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers Hi RongQing, On 2020/6/5 9:44, Li RongQing wrote: Guest kernel reports a fixed cpu frequency

Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-04 Thread Xiaoyao Li
On 6/5/2020 9:44 AM, Li RongQing wrote: Guest kernel reports a fixed cpu frequency in /proc/cpuinfo, this is confused to user when turbo is enable, and aperf/mperf can be used to show current cpu frequency after 7d5905dc14a "(x86 / CPU: Always show current CPU frequency in /proc/cpuinfo)" so

答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-04 Thread Li,Rongqing
wanpen...@tencent.com; vkuzn...@redhat.com; > sean.j.christopher...@intel.com; pbonz...@redhat.com; xiaoyao...@intel.com; > wei.hua...@amd.com > 主题: Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers > > Hi RongQing, > > On 2020/6/5 9:44, Li RongQing wrote: > > Gue

Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-04 Thread Xu, Like
Hi RongQing, On 2020/6/5 9:44, Li RongQing wrote: Guest kernel reports a fixed cpu frequency in /proc/cpuinfo, this is confused to user when turbo is enable, and aperf/mperf can be used to show current cpu frequency after 7d5905dc14a "(x86 / CPU: Always show current CPU frequency in

[PATCH][v6] KVM: X86: support APERF/MPERF registers

2020-06-04 Thread Li RongQing
Guest kernel reports a fixed cpu frequency in /proc/cpuinfo, this is confused to user when turbo is enable, and aperf/mperf can be used to show current cpu frequency after 7d5905dc14a "(x86 / CPU: Always show current CPU frequency in /proc/cpuinfo)" so guest should support aperf/mperf capability