lkml.org 
[lkml]   [2020]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject答复: [PATCH][v6] KVM: X86: support APERF/M PERF registers
Date


> -----邮件原件-----
> 发件人: Paolo Bonzini [mailto:pbonzini@redhat.com]
> 发送时间: 2020年6月6日 1:22
> 收件人: Jim Mattson <jmattson@google.com>
> 抄送: Xiaoyao Li <xiaoyao.li@intel.com>; Li,Rongqing <lirongqing@baidu.com>;
> LKML <linux-kernel@vger.kernel.org>; kvm list <kvm@vger.kernel.org>; the
> arch/x86 maintainers <x86@kernel.org>; H . Peter Anvin <hpa@zytor.com>;
> Borislav Petkov <bp@alien8.de>; Ingo Molnar <mingo@redhat.com>; Thomas
> Gleixner <tglx@linutronix.de>; Wanpeng Li <wanpengli@tencent.com>; Vitaly
> Kuznetsov <vkuznets@redhat.com>; Sean Christopherson
> <sean.j.christopherson@intel.com>; wei.huang2@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,
> >>>> kvm->arch.exception_payload_enabled = cap->args[0];
> >>>> r = 0;
> >>>> break;
> >>>> + case KVM_CAP_APERFMPERF:
> >>>> + kvm->arch.aperfmperf_mode =
> >>>> + boot_cpu_has(X86_FEATURE_APERFMPERF) ?
> cap->args[0] :
> >>>> + 0;
> >>> Shouldn't check whether cap->args[0] is a valid value?
> >> Yes, only valid values should be allowed.
> >>
> >> Also, it should fail with -EINVAL if the host does not have
> >> X86_FEATURE_APERFMPERF.
> > Should enabling/disabling this capability be disallowed once vCPUs
> > have been created?
> >
>
> That's a good idea, yes.
>
> Paolo


Thank you all, I will send a new version

-Li
\
 
 \ /
  Last update: 2020-06-06 13:55    [W:0.053 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site