• Vitaly Kuznetsov's avatar
    KVM: selftests: fix vmx_preemption_timer_test build with GCC10 · 75ad6e80
    Vitaly Kuznetsov authored
    GCC10 fails to build vmx_preemption_timer_test:
    
    gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99
    -fno-stack-protector -fno-PIE -I../../../../tools/include
     -I../../../../tools/arch/x86/include -I../../../../usr/include/
     -Iinclude -Ix86_64 -Iinclude/x86_64 -I..  -pthread  -no-pie
     x86_64/evmcs_test.c ./linux/tools/testing/selftests/kselftest_harness.h
     ./linux/tools/testing/selftests/kselftest.h
     ./linux/tools/testing/selftests/kvm/libkvm.a
     -o ./linux/tools/testing/selftests/kvm/x86_64/evmcs_test
    /usr/bin/ld: ./linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):
     ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:603:
     multiple definition of `ctrl_exit_rev'; /tmp/ccMQpvNt.o:
     ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:603:
     first defined here
    /usr/bin/ld: ./linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):
     ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:602:
     multiple definition of `ctrl_pin_rev'; /tmp/ccMQpvNt.o:
     ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:602:
     first defined here
     ...
    
    ctrl_exit_rev/ctrl_pin_rev/basic variables are only used in
    vmx_preemption_timer_test.c, just move them there.
    
    Fixes: 8d7fbf01 ("KVM: selftests: VMX preemption timer migration test")
    Reported-by: default avatarMarcelo Bandeira Condotta <mcondotta@redhat.com>
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Message-Id: <20200608112346.593513-2-vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    75ad6e80
vmx.h 16.9 KB