aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2008-11-05 18:37:36 -0500
committerAvi Kivity <avi@redhat.com>2008-12-31 09:52:24 -0500
commit0853d2c1d849ef69884d2447d90d04007590b72b (patch)
tree6501a31cffdc2fcb992d66173ad799439b73d118 /arch
parentfcfdbd266a41d3e41d17666de410a24995fde03a (diff)
KVM: Fix cpuid leaf 0xb loop termination
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>
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 9a4a39cfe6ef..2889a0f359ea 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1276,7 +1276,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1276 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1276 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1277 /* read more entries until level_type is zero */ 1277 /* read more entries until level_type is zero */
1278 for (i = 1; *nent < maxnent; ++i) { 1278 for (i = 1; *nent < maxnent; ++i) {
1279 level_type = entry[i - 1].ecx & 0xff; 1279 level_type = entry[i - 1].ecx & 0xff00;
1280 if (!level_type) 1280 if (!level_type)
1281 break; 1281 break;
1282 do_cpuid_1_ent(&entry[i], function, i); 1282 do_cpuid_1_ent(&entry[i], function, i);