1. 15 11月, 2020 1 次提交
  2. 08 11月, 2020 6 次提交
  3. 31 10月, 2020 1 次提交
  4. 28 9月, 2020 2 次提交
    • P
      KVM: x86: do not attempt TSC synchronization on guest writes · 0c899c25
      Paolo Bonzini 提交于
      KVM special-cases writes to MSR_IA32_TSC so that all CPUs have
      the same base for the TSC.  This logic is complicated, and we
      do not want it to have any effect once the VM is started.
      
      In particular, if any guest started to synchronize its TSCs
      with writes to MSR_IA32_TSC rather than MSR_IA32_TSC_ADJUST,
      the additional effect of kvm_write_tsc code would be uncharted
      territory.
      
      Therefore, this patch makes writes to MSR_IA32_TSC behave
      essentially the same as writes to MSR_IA32_TSC_ADJUST when
      they come from the guest.  A new selftest (which passes
      both before and after the patch) checks the current semantics
      of writes to MSR_IA32_TSC and MSR_IA32_TSC_ADJUST originating
      from both the host and the guest.
      
      Upcoming work to remove the special side effects
      of host-initiated writes to MSR_IA32_TSC and MSR_IA32_TSC_ADJUST
      will be able to build onto this test, adjusting the host side
      to use the new APIs and achieve the same effect.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0c899c25
    • A
      KVM: selftests: Add test for user space MSR handling · d468706e
      Alexander Graf 提交于
      Now that we have the ability to handle MSRs from user space and also to
      select which ones we do want to prevent in-kernel KVM code from handling,
      let's add a selftest to show case and verify the API.
      Signed-off-by: NAlexander Graf <graf@amazon.com>
      
      Message-Id: <20200925143422.21718-9-graf@amazon.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d468706e
  5. 05 6月, 2020 1 次提交
    • V
      KVM: selftests: Fix build with "make ARCH=x86_64" · b80db73d
      Vitaly Kuznetsov 提交于
      Marcelo reports that kvm selftests fail to build with
      "make ARCH=x86_64":
      
      gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99
       -fno-stack-protector -fno-PIE -I../../../../tools/include
       -I../../../../tools/arch/x86_64/include  -I../../../../usr/include/
       -Iinclude -Ilib -Iinclude/x86_64 -I.. -c lib/kvm_util.c
       -o /var/tmp/20200604202744-bin/lib/kvm_util.o
      
      In file included from lib/kvm_util.c:11:
      include/x86_64/processor.h:14:10: fatal error: asm/msr-index.h: No such
       file or directory
      
       #include <asm/msr-index.h>
                ^~~~~~~~~~~~~~~~~
      compilation terminated.
      
      "make ARCH=x86", however, works. The problem is that arch specific headers
      for x86_64 live in 'tools/arch/x86/include', not in
      'tools/arch/x86_64/include'.
      
      Fixes: 66d69e08 ("selftests: fix kvm relocatable native/cross builds and installs")
      Reported-by: NMarcelo Bandeira Condotta <mcondotta@redhat.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20200605142028.550068-1-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b80db73d
  6. 01 6月, 2020 1 次提交
  7. 07 5月, 2020 1 次提交
  8. 01 5月, 2020 1 次提交
    • S
      selftests: fix kvm relocatable native/cross builds and installs · 66d69e08
      Shuah Khan 提交于
      kvm test Makefile doesn't fully support cross-builds and installs.
      UNAME_M = $(shell uname -m) variable is used to define the target
      programs and libraries to be built from arch specific sources in
      sub-directories.
      
      For cross-builds to work, UNAME_M has to map to ARCH and arch specific
      directories and targets in this Makefile.
      
      UNAME_M variable to used to run the compiles pointing to the right arch
      directories and build the right targets for these supported architectures.
      
      TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable.
      LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable.
      
      x86_64 targets are named to include x86_64 as a suffix and directories
      for includes are in x86_64 sub-directory. s390x and aarch64 follow the
      same convention. "uname -m" doesn't result in the correct mapping for
      s390x and aarch64. Fix it to set UNAME_M correctly for s390x and aarch64
      cross-builds.
      
      In addition, Makefile doesn't create arch sub-directories in the case of
      relocatable builds and test programs under s390x and x86_64 directories
      fail to build. This is a problem for native and cross-builds. Fix it to
      create all necessary directories keying off of TEST_GEN_PROGS.
      
      The following use-cases work with this change:
      
      Native x86_64:
      make O=/tmp/kselftest -C tools/testing/selftests TARGETS=kvm install \
       INSTALL_PATH=$HOME/x86_64
      
      arm64 cross-build:
      make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
      	CROSS_COMPILE=aarch64-linux-gnu- defconfig
      
      make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
      	CROSS_COMPILE=aarch64-linux-gnu- all
      
      make kselftest-install TARGETS=kvm O=$HOME/arm64_build ARCH=arm64 \
      	HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu-
      
      s390x cross-build:
      make O=$HOME/s390x_build/ ARCH=s390 HOSTCC=gcc \
      	CROSS_COMPILE=s390x-linux-gnu- defconfig
      
      make O=$HOME/s390x_build/ ARCH=s390 HOSTCC=gcc \
      	CROSS_COMPILE=s390x-linux-gnu- all
      
      make kselftest-install TARGETS=kvm O=$HOME/s390x_build/ ARCH=s390 \
      	HOSTCC=gcc CROSS_COMPILE=s390x-linux-gnu- all
      
      No regressions in the following use-cases:
      make -C tools/testing/selftests TARGETS=kvm
      make kselftest-all TARGETS=kvm
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      66d69e08
  9. 16 4月, 2020 1 次提交
  10. 17 3月, 2020 3 次提交
  11. 25 2月, 2020 1 次提交
  12. 13 2月, 2020 2 次提交
  13. 31 1月, 2020 1 次提交
  14. 14 1月, 2020 1 次提交
  15. 22 10月, 2019 1 次提交
  16. 03 10月, 2019 1 次提交
    • S
      selftests: kvm: Fix libkvm build error · 6e06983d
      Shuah Khan 提交于
      Fix the following build error from "make TARGETS=kvm kselftest":
      
      libkvm.a(assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
      
      This error is seen when build is done from the main Makefile using
      kselftest target. In this case KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
      are defined.
      
      When build is invoked using:
      
      "make -C tools/testing/selftests/kvm" KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
      aren't defined.
      
      There is no need to pass in KBUILD_CPPFLAGS and CC_OPTION_CFLAGS for the
      check to determine if --no-pie is necessary, which is the case when these
      two aren't defined when "make -C tools/testing/selftests/kvm" runs.
      
      Fix it by simplifying the no-pie-option logic. With this change, both
      build variations work.
      
      "make TARGETS=kvm kselftest"
      "make -C tools/testing/selftests/kvm"
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6e06983d
  17. 27 9月, 2019 1 次提交
  18. 29 8月, 2019 1 次提交
  19. 02 8月, 2019 3 次提交
  20. 19 6月, 2019 2 次提交
  21. 04 6月, 2019 4 次提交
  22. 25 5月, 2019 1 次提交
  23. 21 5月, 2019 1 次提交
  24. 08 5月, 2019 2 次提交