lkml.org 
[lkml]   [2020]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 51/61] KVM: x86: Use kvm_cpu_caps to detect Intel PT support
    Date
    Sean Christopherson <sean.j.christopherson@intel.com> writes:

    > Check for Intel PT using kvm_cpu_cap_has() to pave the way toward
    > eliminating ->pt_supported().
    >
    > No functional change intended.
    >
    > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
    > ---
    > arch/x86/kvm/cpuid.c | 3 +--
    > 1 file changed, 1 insertion(+), 2 deletions(-)
    >
    > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
    > index a37cb6fda979..3d287fc6eb6e 100644
    > --- a/arch/x86/kvm/cpuid.c
    > +++ b/arch/x86/kvm/cpuid.c
    > @@ -507,7 +507,6 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
    > {
    > struct kvm_cpuid_entry2 *entry;
    > int r, i, max_idx;
    > - unsigned f_intel_pt = kvm_x86_ops->pt_supported() ? F(INTEL_PT) : 0;
    >
    > /* all calls to cpuid_count() should be made on the same cpu */
    > get_cpu();
    > @@ -687,7 +686,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
    > break;
    > /* Intel PT */
    > case 0x14:
    > - if (!f_intel_pt) {
    > + if (!kvm_cpu_cap_has(X86_FEATURE_INTEL_PT)) {
    > entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
    > break;
    > }

    Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

    --
    Vitaly

    \
     
     \ /
      Last update: 2020-02-25 15:07    [W:4.770 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site