]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: KVM: Explicitly use movq to read xmm registers
authorOliver Upton <oupton@google.com>
Fri, 24 Sep 2021 00:51:47 +0000 (00:51 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Sep 2021 06:32:58 +0000 (02:32 -0400)
commit5398c2a529d9a8cae87dbf254e38bff07896edaa
treeaeff27138618427a35b21ba96743249ff2d37622
parent95287bdd781cfe72ec9b0258216b06772a1fb443
selftests: KVM: Explicitly use movq to read xmm registers

Compiling the KVM selftests with clang emits the following warning:

>> include/x86_64/processor.h:297:25: error: variable 'xmm0' is uninitialized when used here [-Werror,-Wuninitialized]
>>                return (unsigned long)xmm0;

where xmm0 is accessed via an uninitialized register variable.

Indeed, this is a misuse of register variables, which really should only
be used for specifying register constraints on variables passed to
inline assembly. Rather than attempting to read xmm registers via
register variables, just explicitly perform the movq from the desired
xmm register.

Fixes: 150755a8b7d8 ("kvm: selftests: add API testing infrastructure")
Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20210924005147.1122357-1-oupton@google.com>
Reviewed-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/x86_64/processor.h