Skip to content

Commit 83a34ad

Browse files
Jinrong Liangbonzini
authored andcommitted
selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c
The following warning appears when executing make -C tools/testing/selftests/kvm include/x86_64/processor.h:290:2: warning: 'ecx' may be used uninitialized in this function [-Wmaybe-uninitialized] asm volatile("cpuid" ^~~ lib/x86_64/processor.c:1523:21: note: 'ecx' was declared here uint32_t eax, ebx, ecx, edx, max_ext_leaf; Just initialize ecx to remove this warning. Fixes: c8cc43c ("selftests: KVM: avoid failures due to reserved HyperTransport region") Signed-off-by: Jinrong Liang <cloudliang@tencent.com> Message-Id: <20220119140325.59369-1-cloudliang@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent a0f4ba7 commit 83a34ad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/kvm/lib/x86_64/processor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,7 @@ unsigned long vm_compute_max_gfn(struct kvm_vm *vm)
15351535
/* Before family 17h, the HyperTransport area is just below 1T. */
15361536
ht_gfn = (1 << 28) - num_ht_pages;
15371537
eax = 1;
1538+
ecx = 0;
15381539
cpuid(&eax, &ebx, &ecx, &edx);
15391540
if (x86_family(eax) < 0x17)
15401541
goto done;

0 commit comments

Comments
 (0)