virt: fix detection of avx2 and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Jan 2024 10:59:32 +0000 (19:59 +0900)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Jan 2024 15:04:17 +0000 (16:04 +0100)
commite701439998a5697317f7692aa5f169bd7315b733
tree614cccf0cb19943af59b7859d9a26af603925fa5
parentc9f096969a77e34cf52bd3b6c63fa686ab25c471
virt: fix detection of avx2 and friends

To get the CPUID with EAX=7, we need explicitly set 0 to ECX.

From IntelĀ® Architecture Instruction Set Extensions Programming
Reference and Related Specifications,
===
Leaf 07H output depends on the initial value in ECX.
If ECX contains an invalid sub leaf index, EAX/EBX/ECX/EDX return 0
===

Fixes #30822.
src/basic/virt.c