1. 19 10月, 2021 4 次提交
  2. 30 9月, 2021 4 次提交
  3. 28 9月, 2021 1 次提交
  4. 24 9月, 2021 2 次提交
    • O
      selftests: KVM: Explicitly use movq to read xmm registers · 386ca9d7
      Oliver Upton 提交于
      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: 783e9e51 ("kvm: selftests: add API testing infrastructure")
      Signed-off-by: NOliver Upton <oupton@google.com>
      Message-Id: <20210924005147.1122357-1-oupton@google.com>
      Reviewed-by: NRicardo Koller <ricarkol@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      386ca9d7
    • O
      selftests: KVM: Call ucall_init when setting up in rseq_test · fbf094ce
      Oliver Upton 提交于
      While x86 does not require any additional setup to use the ucall
      infrastructure, arm64 needs to set up the MMIO address used to signal a
      ucall to userspace. rseq_test does not initialize the MMIO address,
      resulting in the test spinning indefinitely.
      
      Fix the issue by calling ucall_init() during setup.
      
      Fixes: 61e52f16 ("KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs")
      Signed-off-by: NOliver Upton <oupton@google.com>
      Message-Id: <20210923220033.4172362-1-oupton@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fbf094ce
  5. 23 9月, 2021 1 次提交
    • M
      KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0 · 1ad32105
      Maxim Levitsky 提交于
      Test that if:
      
      * L1 disables virtual interrupt masking, and INTR intercept.
      
      * L1 setups a virtual interrupt to be injected to L2 and enters L2 with
        interrupts disabled, thus the virtual interrupt is pending.
      
      * Now an external interrupt arrives in L1 and since
        L1 doesn't intercept it, it should be delivered to L2 when
        it enables interrupts.
      
        to do this L0 (abuses) V_IRQ to setup an
        interrupt window, and returns to L2.
      
      * L2 enables interrupts.
        This should trigger the interrupt window,
        injection of the external interrupt and delivery
        of the virtual interrupt that can now be done.
      
      * Test that now L2 gets those interrupts.
      
      This is the test that demonstrates the issue that was
      fixed in the previous patch.
      Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210914154825.104886-3-mlevitsk@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1ad32105
  6. 22 9月, 2021 6 次提交
  7. 09 9月, 2021 1 次提交
  8. 21 8月, 2021 2 次提交
  9. 19 8月, 2021 1 次提交
  10. 06 8月, 2021 2 次提交
    • D
      KVM: selftests: Move vcpu_args_set into perf_test_util · 32bdc019
      David Matlack 提交于
      perf_test_util is used to set up KVM selftests where vCPUs touch a
      region of memory. The guest code is implemented in perf_test_util.c (not
      the calling selftests). The guest code requires a 1 parameter, the
      vcpuid, which has to be set by calling vcpu_args_set(vm, vcpu_id, 1,
      vcpu_id).
      
      Today all of the selftests that use perf_test_util are making this call.
      Instead, perf_test_util should just do it. This will save some code but
      more importantly prevents mistakes since totally non-obvious that this
      needs to be called and failing to do so results in vCPUs not accessing
      the right regions of memory.
      Signed-off-by: NDavid Matlack <dmatlack@google.com>
      Message-Id: <20210805172821.2622793-1-dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      32bdc019
    • D
      KVM: selftests: Support multiple slots in dirty_log_perf_test · 609e6202
      David Matlack 提交于
      Introduce a new option to dirty_log_perf_test: -x number_of_slots. This
      causes the test to attempt to split the region of memory into the given
      number of slots. If the region cannot be evenly divided, the test will
      fail.
      
      This allows testing with more than one slot and therefore measure how
      performance scales with the number of memslots.
      Signed-off-by: NDavid Matlack <dmatlack@google.com>
      Message-Id: <20210804222844.1419481-8-dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      609e6202
  11. 04 8月, 2021 1 次提交
  12. 03 8月, 2021 1 次提交
  13. 28 7月, 2021 2 次提交
    • D
      KVM: selftests: Introduce access_tracking_perf_test · c33e05d9
      David Matlack 提交于
      This test measures the performance effects of KVM's access tracking.
      Access tracking is driven by the MMU notifiers test_young, clear_young,
      and clear_flush_young. These notifiers do not have a direct userspace
      API, however the clear_young notifier can be triggered by marking a
      pages as idle in /sys/kernel/mm/page_idle/bitmap. This test leverages
      that mechanism to enable access tracking on guest memory.
      
      To measure performance this test runs a VM with a configurable number of
      vCPUs that each touch every page in disjoint regions of memory.
      Performance is measured in the time it takes all vCPUs to finish
      touching their predefined region.
      
      Example invocation:
      
        $ ./access_tracking_perf_test -v 8
        Testing guest mode: PA-bits:ANY, VA-bits:48,  4K pages
        guest physical test memory offset: 0xffdfffff000
      
        Populating memory             : 1.337752570s
        Writing to populated memory   : 0.010177640s
        Reading from populated memory : 0.009548239s
        Mark memory idle              : 23.973131748s
        Writing to idle memory        : 0.063584496s
        Mark memory idle              : 24.924652964s
        Reading from idle memory      : 0.062042814s
      
      Breaking down the results:
      
       * "Populating memory": The time it takes for all vCPUs to perform the
         first write to every page in their region.
      
       * "Writing to populated memory" / "Reading from populated memory": The
         time it takes for all vCPUs to write and read to every page in their
         region after it has been populated. This serves as a control for the
         later results.
      
       * "Mark memory idle": The time it takes for every vCPU to mark every
         page in their region as idle through page_idle.
      
       * "Writing to idle memory" / "Reading from idle memory": The time it
         takes for all vCPUs to write and read to every page in their region
         after it has been marked idle.
      
      This test should be portable across architectures but it is only enabled
      for x86_64 since that's all I have tested.
      Reviewed-by: NBen Gardon <bgardon@google.com>
      Signed-off-by: NDavid Matlack <dmatlack@google.com>
      Message-Id: <20210713220957.3493520-7-dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c33e05d9
    • D
      KVM: selftests: Fix missing break in dirty_log_perf_test arg parsing · 15b7b737
      David Matlack 提交于
      There is a missing break statement which causes a fallthrough to the
      next statement where optarg will be null and a segmentation fault will
      be generated.
      
      Fixes: 9e965bb7 ("KVM: selftests: Add backing src parameter to dirty_log_perf_test")
      Reviewed-by: NBen Gardon <bgardon@google.com>
      Signed-off-by: NDavid Matlack <dmatlack@google.com>
      Message-Id: <20210713220957.3493520-6-dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      15b7b737
  14. 15 7月, 2021 3 次提交
  15. 14 7月, 2021 2 次提交
  16. 06 7月, 2021 2 次提交
  17. 25 6月, 2021 2 次提交
  18. 24 6月, 2021 3 次提交
    • S
      KVM: sefltests: Add x86-64 test to verify MMU reacts to CPUID updates · ef6a74b2
      Sean Christopherson 提交于
      Add an x86-only test to verify that x86's MMU reacts to CPUID updates
      that impact the MMU.  KVM has had multiple bugs where it fails to
      reconfigure the MMU after the guest's vCPU model changes.
      
      Sadly, this test is effectively limited to shadow paging because the
      hardware page walk handler doesn't support software disabling of GBPAGES
      support, and KVM doesn't manually walk the GVA->GPA on faults for
      performance reasons (doing so would large defeat the benefits of TDP).
      
      Don't require !TDP for the tests as there is still value in running the
      tests with TDP, even though the tests will fail (barring KVM hacks).
      E.g. KVM should not completely explode if MAXPHYADDR results in KVM using
      4-level vs. 5-level paging for the guest.
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20210622200529.3650424-20-seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ef6a74b2
    • S
      KVM: selftests: Add hugepage support for x86-64 · ad5f16e4
      Sean Christopherson 提交于
      Add x86-64 hugepage support in the form of a x86-only variant of
      virt_pg_map() that takes an explicit page size.  To keep things simple,
      follow the existing logic for 4k pages and disallow creating a hugepage
      if the upper-level entry is present, even if the desired pfn matches.
      
      Opportunistically fix a double "beyond beyond" reported by checkpatch.
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20210622200529.3650424-19-seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ad5f16e4
    • S
      KVM: selftests: Genericize upper level page table entry struct · b007e904
      Sean Christopherson 提交于
      In preparation for adding hugepage support, replace "pageMapL4Entry",
      "pageDirectoryPointerEntry", and "pageDirectoryEntry" with a common
      "pageUpperEntry", and add a helper to create an upper level entry. All
      upper level entries have the same layout, using unique structs provides
      minimal value and requires a non-trivial amount of code duplication.
      
      No functional change intended.
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20210622200529.3650424-18-seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b007e904