提交 0853d2c1 编写于 作者: N Nitin A Kamble 提交者: Avi Kivity

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: NNitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 fcfdbd26
...@@ -1276,7 +1276,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -1276,7 +1276,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
/* read more entries until level_type is zero */ /* read more entries until level_type is zero */
for (i = 1; *nent < maxnent; ++i) { for (i = 1; *nent < maxnent; ++i) {
level_type = entry[i - 1].ecx & 0xff; level_type = entry[i - 1].ecx & 0xff00;
if (!level_type) if (!level_type)
break; break;
do_cpuid_1_ent(&entry[i], function, i); do_cpuid_1_ent(&entry[i], function, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册