Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0853d2c1 authored by Nitin A Kamble's avatar Nitin A Kamble Committed by Avi Kivity
Browse files

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: default avatarNitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent fcfdbd26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1276,7 +1276,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);