summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2009-03-23 17:51:25 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-02 10:57:07 -0700
commit8e70c4b199e53b33004edbe710ca5425a4b40c94 (patch)
tree194f7aa38bc3c704162527971181c9751aaefbd6 /arch
parente93d4df4cf013df5ab84c4967b9bfeecbb0f8c0d (diff)
KVM: Fix cpuid leaf 0xb loop termination
(cherry picked from 0853d2c1d849ef69884d2447d90d04007590b72b) For cpuid leaf 0xb the bits 8-15 in ECX register define the end of counting leaf. The previous code was using bits 0-7 for this purpose, which is a bug. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4e2135a780b2..d818088f929b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1218,7 +1218,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
/* read more entries until level_type is zero */
for (i = 1; *nent < maxnent; ++i) {
- level_type = entry[i - 1].ecx & 0xff;
+ level_type = entry[i - 1].ecx & 0xff00;
if (!level_type)
break;
do_cpuid_1_ent(&entry[i], function, i);