summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorYu Zhang2017-08-24 14:27:52 +0200
committerPaolo Bonzini2017-08-24 18:09:15 +0200
commite911eb3b3414e62cbd9853e0a91c124f4a545c0f (patch)
treee8ac1e3c35b9d452ef099cd3b04f2c1f40fe5c25 /arch/x86/kvm/x86.c
parentkvm: vmx: Raise #UD on unsupported XSAVES/XRSTORS (diff)
downloadkernel-qcow2-linux-e911eb3b3414e62cbd9853e0a91c124f4a545c0f.tar.gz
kernel-qcow2-linux-e911eb3b3414e62cbd9853e0a91c124f4a545c0f.tar.xz
kernel-qcow2-linux-e911eb3b3414e62cbd9853e0a91c124f4a545c0f.zip
KVM: x86: Add return value to kvm_cpuid().
Return false in kvm_cpuid() when it fails to find the cpuid entry. Also, this routine(and its caller) is optimized with a new argument - check_limit, so that the check_cpuid_limit() fall back can be avoided. Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4e699238a113..cc2c7e413e9c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5206,10 +5206,10 @@ static int emulator_intercept(struct x86_emulate_ctxt *ctxt,
return kvm_x86_ops->check_intercept(emul_to_vcpu(ctxt), info, stage);
}
-static void emulator_get_cpuid(struct x86_emulate_ctxt *ctxt,
- u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
+static bool emulator_get_cpuid(struct x86_emulate_ctxt *ctxt,
+ u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, bool check_limit)
{
- kvm_cpuid(emul_to_vcpu(ctxt), eax, ebx, ecx, edx);
+ return kvm_cpuid(emul_to_vcpu(ctxt), eax, ebx, ecx, edx, check_limit);
}
static ulong emulator_read_gpr(struct x86_emulate_ctxt *ctxt, unsigned reg)