lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/6] KVM: x86: Fix CPUID range check for Centaur and Hypervisor ranges
From
Date
On 03/03/20 19:01, Sean Christopherson wrote:
> static bool cpuid_function_in_range(struct kvm_vcpu *vcpu, u32 function)
> {
> struct kvm_cpuid_entry2 *max;
>
> if (function >= 0x40000000 && function <= 0x4fffffff)
> max = kvm_find_cpuid_entry(vcpu, function & 0xffffff00, 0);
> else
> max = kvm_find_cpuid_entry(vcpu, function & 0x80000000, 0);
> return max && function <= max->eax;
> }

Yes, this is a good idea (except it should be & 0xc0000000 to cover
Centaur).

Paolo

\
 
 \ /
  Last update: 2020-03-04 12:19    [W:0.080 / U:14.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site