1. 20 Jun, 2022 19 commits
  2. 15 Jun, 2022 13 commits
  3. 14 Jun, 2022 5 commits
  4. 11 Jun, 2022 3 commits
    • Sean Christopherson's avatar
      KVM: selftests: Sanity check input to ioctls() at build time · fcba483e
      Sean Christopherson authored
      Add a static assert to the KVM/VM/vCPU ioctl() helpers to verify that the
      size of the argument provided matches the expected size of the IOCTL.
      Because ioctl() ultimately takes a "void *", it's all too easy to pass in
      garbage and not detect the error until runtime.  E.g. while working on a
      CPUID rework, selftests happily compiled when vcpu_set_cpuid()
      unintentionally passed the cpuid() function as the parameter to ioctl()
      (a local "cpuid" parameter was removed, but its use was not replaced with
      "vcpu->cpuid" as intended).
      
      Tweak a variety of benign issues that aren't compatible with the sanity
      check, e.g. passing a non-pointer for ioctls().
      
      Note, static_assert() requires a string on older versions of GCC.  Feed
      it an empty string to make the compiler happy.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fcba483e
    • Sean Christopherson's avatar
      KVM: selftests: Use TAP-friendly ksft_exit_skip() in __TEST_REQUIRE · 5321270b
      Sean Christopherson authored
      Use the TAP-friendly ksft_exit_skip() instead of KVM's custom print_skip()
      when skipping a test via __TEST_REQUIRE.  KVM's "skipping test" has no
      known benefit, whereas some setups rely on TAP output.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5321270b
    • Sean Christopherson's avatar
      KVM: selftests: Add TEST_REQUIRE macros to reduce skipping copy+paste · 7ed397d1
      Sean Christopherson authored
      Add TEST_REQUIRE() and __TEST_REQUIRE() to replace the myriad open coded
      instances of selftests exiting with KSFT_SKIP after printing an
      informational message.  In addition to reducing the amount of boilerplate
      code in selftests, the UPPERCASE macro names make it easier to visually
      identify a test's requirements.
      
      Convert usage that erroneously uses something other than print_skip()
      and/or "exits" with '0' or some other non-KSFT_SKIP value.
      
      Intentionally drop a kvm_vm_free() in aarch64/debug-exceptions.c as part
      of the conversion.  All memory and file descriptors are freed on process
      exit, so the explicit free is superfluous.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7ed397d1