]> xenbits.xensource.com Git - xen.git/commit
tools/hvmloader: Fix non-deterministic cpuid()
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Tue, 13 Aug 2024 14:39:10 +0000 (16:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Aug 2024 14:39:10 +0000 (16:39 +0200)
commitcc47813c4a2c07a5c6c6a1491b98f3f8549835a7
treed8b8b80ffe53267ada6e619a135e7cdbb77606b3
parentb2e8c8f42083afcac8b4720c50680d7c9eaaf90a
tools/hvmloader: Fix non-deterministic cpuid()

hvmloader's cpuid() implementation deviates from Xen's in that the value
passed on ecx is unspecified. This means that when used on leaves that
implement subleaves it's unspecified which one you get; though it's more
than likely an invalid one.

Import Xen's implementation so there are no surprises.

Fixes: 318ac791f9f9 ("Add utilities needed for SMBIOS generation to hvmloader")
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/firmware/hvmloader/util.c
tools/firmware/hvmloader/util.h