[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1aa9cc5-96c7-11fe-17e1-22fe46b940f3@redhat.com>
Date: Fri, 5 Jun 2020 19:22:01 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Jim Mattson <jmattson@...gle.com>
Cc: Xiaoyao Li <xiaoyao.li@...el.com>,
Li RongQing <lirongqing@...du.com>,
LKML <linux-kernel@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Wanpeng Li <wanpengli@...cent.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
wei.huang2@....com
Subject: 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
Powered by blists - more mailing lists