Skip to content

Commit

Permalink
i386/cpuid: Move leaf 7 to correct group
Browse files Browse the repository at this point in the history
CPUID leaf 7 was grouped together with SGX leaf 0x12 by commit
b9edbad ("i386: Propagate SGX CPUID sub-leafs to KVM") by mistake.

SGX leaf 0x12 has its specific logic to check if subleaf (starting from 2)
is valid or not by checking the bit 0:3 of corresponding EAX is 1 or
not.

Leaf 7 follows the logic that EAX of subleaf 0 enumerates the maximum
valid subleaf.

Fixes: b9edbad ("i386: Propagate SGX CPUID sub-leafs to KVM")
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20240125024016.2521244-4-xiaoyao.li@intel.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0729857)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
calmisi authored and Michael Tokarev committed Feb 20, 2024
1 parent e8d2772 commit f5dddb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/i386/kvm/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
c = &cpuid_data.entries[cpuid_i++];
}
break;
case 0x7:
case 0x12:
for (j = 0; ; j++) {
c->function = i;
Expand All @@ -1975,6 +1974,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
c = &cpuid_data.entries[cpuid_i++];
}
break;
case 0x7:
case 0x14:
case 0x1d:
case 0x1e: {
Expand Down

0 comments on commit f5dddb8

Please sign in to comment.