1. 25 1月, 2022 1 次提交
  2. 21 1月, 2022 2 次提交
    • J
      selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c · 83a34ad8
      Jinrong Liang 提交于
      The following warning appears when executing
      make -C tools/testing/selftests/kvm
      
      include/x86_64/processor.h:290:2: warning: 'ecx' may be used uninitialized in this
      function [-Wmaybe-uninitialized]
        asm volatile("cpuid"
        ^~~
      lib/x86_64/processor.c:1523:21: note: 'ecx' was declared here
        uint32_t eax, ebx, ecx, edx, max_ext_leaf;
      
      Just initialize ecx to remove this warning.
      
      Fixes: c8cc43c1 ("selftests: KVM: avoid failures due to reserved HyperTransport region")
      Signed-off-by: NJinrong Liang <cloudliang@tencent.com>
      Message-Id: <20220119140325.59369-1-cloudliang@tencent.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83a34ad8
    • J
      selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c · a0f4ba7f
      Jinrong Liang 提交于
      The following warning appears when executing
      make -C tools/testing/selftests/kvm
      
      x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_intel_br_retired':
      x86_64/pmu_event_filter_test.c:241:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable]
        241 |         struct kvm_cpuid2 *cpuid;
            |                            ^~~~~
      x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_amd_zen_br_retired':
      x86_64/pmu_event_filter_test.c:258:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable]
        258 |         struct kvm_cpuid2 *cpuid;
            |                            ^~~~~
      
      Just delete the unused variables to stay away from warnings.
      
      Fixes: dc7e75b3b3ee ("selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER")
      Signed-off-by: NJinrong Liang <cloudliang@tencent.com>
      Message-Id: <20220119133910.56285-1-cloudliang@tencent.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a0f4ba7f
  3. 20 1月, 2022 9 次提交
  4. 18 1月, 2022 2 次提交
  5. 15 1月, 2022 4 次提交
  6. 08 1月, 2022 2 次提交
    • M
      kvm: selftests: move ucall declarations into ucall_common.h · 96c1a628
      Michael Roth 提交于
      Now that core kvm_util declarations have special home in
      kvm_util_base.h, move ucall-related declarations out into a separate
      header.
      Signed-off-by: NMichael Roth <michael.roth@amd.com>
      Message-Id: <20211210164620.11636-3-michael.roth@amd.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      96c1a628
    • M
      kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h · 7d9a662e
      Michael Roth 提交于
      Between helper macros and interfaces that will be introduced in
      subsequent patches, much of kvm_util.h would end up being declarations
      specific to ucall. Ideally these could be separated out into a separate
      header since they are not strictly required for writing guest tests and
      are mostly self-contained interfaces other than a reliance on a few
      core declarations like struct kvm_vm. This doesn't make a big
      difference as far as how tests will be compiled/written since all these
      interfaces will still be packaged up into a single/common libkvm.a used
      by all tests, but it is still nice to be able to compartmentalize to
      improve readabilty and reduce merge conflicts in the future for common
      tasks like adding new interfaces to kvm_util.h.
      
      Furthermore, some of the ucall declarations will be arch-specific,
      requiring various #ifdef'ery in kvm_util.h. Ideally these declarations
      could live in separate arch-specific headers, e.g.
      include/<arch>/ucall.h, which would handle arch-specific declarations
      as well as pulling in common ucall-related declarations shared by all
      archs.
      
      One simple way to do this would be to #include ucall.h at the bottom of
      kvm_util.h, after declarations it relies upon like struct kvm_vm.
      This is brittle however, and doesn't scale easily to other sets of
      interfaces that may be added in the future.
      
      Instead, move all declarations currently in kvm_util.h into
      kvm_util_base.h, then have kvm_util.h #include it. With this change,
      non-base declarations can be selectively moved/introduced into separate
      headers, which can then be included in kvm_util.h so that individual
      tests don't need to be touched. Subsequent patches will then move
      ucall-related declarations into a separate header to meet the above
      goals.
      Signed-off-by: NMichael Roth <michael.roth@amd.com>
      Message-Id: <20211210164620.11636-2-michael.roth@amd.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7d9a662e
  7. 07 1月, 2022 4 次提交
    • D
      KVM: x86/xen: Add KVM_IRQ_ROUTING_XEN_EVTCHN and event channel delivery · 14243b38
      David Woodhouse 提交于
      This adds basic support for delivering 2 level event channels to a guest.
      
      Initially, it only supports delivery via the IRQ routing table, triggered
      by an eventfd. In order to do so, it has a kvm_xen_set_evtchn_fast()
      function which will use the pre-mapped shared_info page if it already
      exists and is still valid, while the slow path through the irqfd_inject
      workqueue will remap the shared_info page if necessary.
      
      It sets the bits in the shared_info page but not the vcpu_info; that is
      deferred to __kvm_xen_has_interrupt() which raises the vector to the
      appropriate vCPU.
      
      Add a 'verbose' mode to xen_shinfo_test while adding test cases for this.
      Signed-off-by: NDavid Woodhouse <dwmw@amazon.co.uk>
      Message-Id: <20211210163625.2886-5-dwmw2@infradead.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      14243b38
    • P
      selftests: KVM: sev_migrate_tests: Add mirror command tests · a6fec539
      Peter Gonda 提交于
      Add tests to confirm mirror vms can only run correct subset of commands.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Marc Orr <marcorr@google.com>
      Signed-off-by: NPeter Gonda <pgonda@google.com>
      Message-Id: <20211208191642.3792819-4-pgonda@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a6fec539
    • P
      selftests: KVM: sev_migrate_tests: Fix sev_ioctl() · 427d046a
      Peter Gonda 提交于
      TEST_ASSERT in SEV ioctl was allowing errors because it checked return
      value was good OR the FW error code was OK. This TEST_ASSERT should
      require both (aka. AND) values are OK. Removes the LAUNCH_START from the
      mirror VM because this call correctly fails because mirror VMs cannot
      call this command. Currently issues with the PSP driver functions mean
      the firmware error is not always reset to SEV_RET_SUCCESS when a call is
      successful. Mainly sev_platform_init() doesn't correctly set the fw
      error if the platform has already been initialized.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Marc Orr <marcorr@google.com>
      Signed-off-by: NPeter Gonda <pgonda@google.com>
      Message-Id: <20211208191642.3792819-3-pgonda@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      427d046a
    • P
      selftests: KVM: sev_migrate_tests: Fix test_sev_mirror() · 4c66b567
      Peter Gonda 提交于
      Mirrors should not be able to call LAUNCH_START. Remove the call on the
      mirror to correct the test before fixing sev_ioctl() to correctly assert
      on this failed ioctl.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Marc Orr <marcorr@google.com>
      Signed-off-by: NPeter Gonda <pgonda@google.com>
      Message-Id: <20211208191642.3792819-2-pgonda@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4c66b567
  8. 06 1月, 2022 2 次提交
  9. 04 1月, 2022 1 次提交
  10. 29 12月, 2021 13 次提交