[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41235370-c095-6d8a-2546-be88b3974bfe@redhat.com>
Date: Wed, 4 Mar 2020 12:18:12 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>,
Jim Mattson <jmattson@...gle.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Joerg Roedel <joro@...tes.org>, kvm list <kvm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Jan Kiszka <jan.kiszka@...mens.com>,
Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH 2/6] KVM: x86: Fix CPUID range check for Centaur and
Hypervisor ranges
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
Powered by blists - more mailing lists