summaryrefslogtreecommitdiff
path: root/include/uapi/linux/kvm.h
diff options
context:
space:
mode:
authorJim Mattson <jmattson@google.com>2021-09-30 03:36:49 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-22 19:46:37 +0300
commited290e1c20da19fa100a3e0f421aa31b65984960 (patch)
tree92335b7007afd0ee1930c0e7ad09a974404ff2a9 /include/uapi/linux/kvm.h
parentdfd3c713a9c87ade13c7bf618455a57f4d01e97b (diff)
downloadlinux-ed290e1c20da19fa100a3e0f421aa31b65984960.tar.xz
KVM: selftests: Fix nested SVM tests when built with clang
Though gcc conveniently compiles a simple memset to "rep stos," clang prefers to call the libc version of memset. If a test is dynamically linked, the libc memset isn't available in L1 (nor is the PLT or the GOT, for that matter). Even if the test is statically linked, the libc memset may choose to use some CPU features, like AVX, which may not be enabled in L1. Note that __builtin_memset doesn't solve the problem, because (a) the compiler is free to call memset anyway, and (b) __builtin_memset may also choose to use features like AVX, which may not be available in L1. To avoid a myriad of problems, use an explicit "rep stos" to clear the VMCB in generic_svm_setup(), which is called both from L0 and L1. Reported-by: Ricardo Koller <ricarkol@google.com> Signed-off-by: Jim Mattson <jmattson@google.com> Fixes: 20ba262f8631a ("selftests: KVM: AMD Nested test infrastructure") Message-Id: <20210930003649.4026553-1-jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/uapi/linux/kvm.h')
0 files changed, 0 insertions, 0 deletions