Skip to content

Commit

Permalink
i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
Browse files Browse the repository at this point in the history
Existing code misses a decrement of cpuid_i when skip leaf 0x1F.
There's a blank CPUID entry(with leaf, subleaf as 0, and all fields
stuffed 0s) left in the CPUID array.

It conflicts with correct CPUID leaf 0.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by:Yang Weijiang <weijiang.yang@intel.com>
Message-ID: <20240125024016.2521244-2-xiaoyao.li@intel.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 10f9279)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
calmisi authored and Michael Tokarev committed Feb 20, 2024
1 parent f18b018 commit 46f701c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions target/i386/kvm/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
}
case 0x1f:
if (env->nr_dies < 2) {
cpuid_i--;
break;
}
/* fallthrough */
Expand Down

0 comments on commit 46f701c

Please sign in to comment.