1. 19 3月, 2021 1 次提交
  2. 18 3月, 2021 1 次提交
    • V
      selftests: kvm: Add basic Hyper-V clocksources tests · 2c7f76b4
      Vitaly Kuznetsov 提交于
      Introduce a new selftest for Hyper-V clocksources (MSR-based reference TSC
      and TSC page). As a starting point, test the following:
      1) Reference TSC is 1Ghz clock.
      2) Reference TSC and TSC page give the same reading.
      3) TSC page gets updated upon KVM_SET_CLOCK call.
      4) TSC page does not get updated when guest opted for reenlightenment.
      5) Disabled TSC page doesn't get updated.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20210318140949.1065740-1-vkuznets@redhat.com>
      [Add a host-side test using TSC + KVM_GET_MSR too. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2c7f76b4
  3. 16 2月, 2021 1 次提交
  4. 11 2月, 2021 1 次提交
  5. 04 2月, 2021 4 次提交
  6. 12 12月, 2020 2 次提交
    • A
      selftests: kvm: Merge user_msr_test into userspace_msr_exit_test · fb636053
      Aaron Lewis 提交于
      Both user_msr_test and userspace_msr_exit_test tests the functionality
      of kvm_msr_filter.  Instead of testing this feature in two tests, merge
      them together, so there is only one test for this feature.
      Signed-off-by: NAaron Lewis <aaronlewis@google.com>
      Message-Id: <20201204172530.2958493-1-aaronlewis@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fb636053
    • A
      selftests: kvm: Test MSR exiting to userspace · 3cea1891
      Aaron Lewis 提交于
      Add a selftest to test that when the ioctl KVM_X86_SET_MSR_FILTER is
      called with an MSR list, those MSRs exit to userspace.
      
      This test uses 3 MSRs to test this:
        1. MSR_IA32_XSS, an MSR the kernel knows about.
        2. MSR_IA32_FLUSH_CMD, an MSR the kernel does not know about.
        3. MSR_NON_EXISTENT, an MSR invented in this test for the purposes of
           passing a fake MSR from the guest to userspace.  KVM just acts as a
           pass through.
      
      Userspace is also able to inject a #GP.  This is demonstrated when
      MSR_IA32_XSS and MSR_IA32_FLUSH_CMD are misused in the test.  When this
      happens a #GP is initiated in userspace to be thrown in the guest which is
      handled gracefully by the exception handling framework introduced earlier
      in this series.
      
      Tests for the generic instruction emulator were also added.  For this to
      work the module parameter kvm.force_emulation_prefix=1 has to be enabled.
      If it isn't enabled the tests will be skipped.
      
      A test was also added to ensure the MSR permission bitmap is being set
      correctly by executing reads and writes of MSR_FS_BASE and MSR_GS_BASE
      in the guest while alternating which MSR userspace should intercept.  If
      the permission bitmap is being set correctly only one of the MSRs should
      be coming through at a time, and the guest should be able to read and
      write the other one directly.
      Signed-off-by: NAaron Lewis <aaronlewis@google.com>
      Reviewed-by: NAlexander Graf <graf@amazon.com>
      Message-Id: <20201012194716.3950330-5-aaronlewis@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3cea1891
  7. 15 11月, 2020 1 次提交
  8. 08 11月, 2020 4 次提交
    • B
      KVM: selftests: Introduce the dirty log perf test · 4fd94ec7
      Ben Gardon 提交于
      The dirty log perf test will time verious dirty logging operations
      (enabling dirty logging, dirtying memory, getting the dirty log,
      clearing the dirty log, and disabling dirty logging) in order to
      quantify dirty logging performance. This test can be used to inform
      future performance improvements to KVM's dirty logging infrastructure.
      
      This series was tested by running the following invocations on an Intel
      Skylake machine:
      dirty_log_perf_test -b 20m -i 100 -v 64
      dirty_log_perf_test -b 20g -i 5 -v 4
      dirty_log_perf_test -b 4g -i 5 -v 32
      demand_paging_test -b 20m -v 64
      demand_paging_test -b 20g -v 4
      demand_paging_test -b 4g -v 32
      All behaved as expected.
      Signed-off-by: NBen Gardon <bgardon@google.com>
      Message-Id: <20201027233733.1484855-6-bgardon@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4fd94ec7
    • A
      KVM: selftests: Add blessed SVE registers to get-reg-list · 31d21295
      Andrew Jones 提交于
      Add support for the SVE registers to get-reg-list and create a
      new test, get-reg-list-sve, which tests them when running on a
      machine with SVE support.
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Message-Id: <20201029201703.102716-5-drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      31d21295
    • A
      KVM: selftests: Add aarch64 get-reg-list test · fd02029a
      Andrew Jones 提交于
      Check for KVM_GET_REG_LIST regressions. The blessed list was
      created by running on v4.15 with the --core-reg-fixup option.
      The following script was also used in order to annotate system
      registers with their names when possible. When new system
      registers are added the names can just be added manually using
      the same grep.
      
      while read reg; do
      	if [[ ! $reg =~ ARM64_SYS_REG ]]; then
      		printf "\t$reg\n"
      		continue
      	fi
      	encoding=$(echo "$reg" | sed "s/ARM64_SYS_REG(//;s/),//")
      	if ! name=$(grep "$encoding" ../../../../arch/arm64/include/asm/sysreg.h); then
      		printf "\t$reg\n"
      		continue
      	fi
      	name=$(echo "$name" | sed "s/.*SYS_//;s/[\t ]*sys_reg($encoding)$//")
      	printf "\t$reg\t/* $name */\n"
      done < <(aarch64/get-reg-list --core-reg-fixup --list)
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Message-Id: <20201029201703.102716-3-drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fd02029a
    • O
      selftests: kvm: test enforcement of paravirtual cpuid features · ac4a4d6d
      Oliver Upton 提交于
      Add a set of tests that ensure the guest cannot access paravirtual msrs
      and hypercalls that have been disabled in the KVM_CPUID_FEATURES leaf.
      Expect a #GP in the case of msr accesses and -KVM_ENOSYS from
      hypercalls.
      
      Cc: Jim Mattson <jmattson@google.com>
      Signed-off-by: NOliver Upton <oupton@google.com>
      Reviewed-by: NPeter Shier <pshier@google.com>
      Reviewed-by: NAaron Lewis <aaronlewis@google.com>
      Message-Id: <20201027231044.655110-7-oupton@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ac4a4d6d
  9. 31 10月, 2020 1 次提交
  10. 28 9月, 2020 1 次提交
  11. 08 6月, 2020 1 次提交
  12. 01 6月, 2020 1 次提交
  13. 16 4月, 2020 1 次提交
  14. 25 3月, 2020 1 次提交
  15. 17 3月, 2020 3 次提交
  16. 25 2月, 2020 1 次提交
  17. 22 10月, 2019 2 次提交
  18. 09 8月, 2019 1 次提交
  19. 19 6月, 2019 1 次提交
  20. 08 5月, 2019 3 次提交
  21. 12 2月, 2019 1 次提交
  22. 20 10月, 2018 1 次提交
  23. 17 10月, 2018 2 次提交
  24. 20 9月, 2018 1 次提交
  25. 06 8月, 2018 2 次提交
    • P
      kvm: selftests: add basic test for state save and restore · fa3899ad
      Paolo Bonzini 提交于
      The test calls KVM_RUN repeatedly, and creates an entirely new VM with the
      old memory and vCPU state on every exit to userspace.  The kvm_util API is
      expanded with two functions that manage the lifetime of a kvm_vm struct:
      the first closes the file descriptors and leaves the memory allocated,
      and the second opens the file descriptors and reuses the memory from
      the previous incarnation of the kvm_vm struct.
      
      For now the test is very basic, as it does not test for example XSAVE or
      vCPU events.  However, it will test nested virtualization state starting
      with the next patch.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fa3899ad
    • W
      kvm: selftests: add cr4_cpuid_sync_test · ca359066
      Wei Huang 提交于
      KVM is supposed to update some guest VM's CPUID bits (e.g. OSXSAVE) when
      CR4 is changed. A bug was found in KVM recently and it was fixed by
      Commit c4d21882 ("KVM: x86: Update cpuid properly when CR4.OSXAVE or
      CR4.PKE is changed"). This patch adds a test to verify the synchronization
      between guest VM's CR4 and CPUID bits.
      Signed-off-by: NWei Huang <wei@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ca359066
  26. 31 5月, 2018 1 次提交