1. 20 9月, 2018 1 次提交
  2. 22 8月, 2018 3 次提交
    • P
      kvm: selftest: add dirty logging test · 3b4cd0ff
      Peter Xu 提交于
      Test KVM dirty logging functionality.
      
      The test creates a standalone memory slot to test tracking the dirty
      pages since we can't really write to the default memory slot which still
      contains the guest ELF image.
      
      We have two threads running during the test:
      
      (1) the vcpu thread continuously dirties random guest pages by writting
          a iteration number to the first 8 bytes of the page
      
      (2) the host thread continuously fetches dirty logs for the testing
          memory region and verify each single bit of the dirty bitmap by
          checking against the values written onto the page
      
      Note that since the guest cannot calls the general userspace APIs like
      random(), it depends on the host to provide random numbers for the
      page indexes to dirty.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3b4cd0ff
    • P
      kvm: selftest: include the tools headers · bc8eb2fe
      Peter Xu 提交于
      Let the kvm selftest include the tools headers, then we can start to use
      things there like bitmap operations.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      bc8eb2fe
    • P
      kvm: selftest: unify the guest port macros · 4e18bccc
      Peter Xu 提交于
      Most of the tests are using the same way to do guest to host sync but
      the code is mostly duplicated.  Generalize the guest port macros into
      the common header file and use it in different tests.
      
      Meanwhile provide "struct guest_args" and a helper "guest_args_read()"
      to hide the register details when playing with these port operations on
      RDI and RSI.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4e18bccc
  3. 06 8月, 2018 3 次提交
    • 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
    • P
      kvm: selftests: ensure vcpu file is released · 0a505fe6
      Paolo Bonzini 提交于
      The selftests were not munmap-ing the kvm_run area from the vcpu file descriptor.
      The result was that kvm_vcpu_release was not called and a reference was left in the
      parent "struct kvm".  Ultimately this was visible in the upcoming state save/restore
      test as an error when KVM attempted to create a duplicate debugfs entry.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0a505fe6
    • P
      kvm: selftests: create a GDT and TSS · 2305339e
      Paolo Bonzini 提交于
      The GDT and the TSS base were left to zero, and this has interesting effects
      when the TSS descriptor is later read to set up a VMCS's TR_BASE.  Basically
      it worked by chance, and this patch fixes it by setting up all the protected
      mode data structures properly.
      
      Because the GDT and TSS addresses are virtual, the page tables now always
      exist at the time of vcpu setup.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2305339e
  4. 11 5月, 2018 1 次提交
    • P
      KVM: selftests: exit with 0 status code when tests cannot be run · bcb2b94a
      Paolo Bonzini 提交于
      Right now, skipped tests are returning a failure exit code if /dev/kvm does
      not exists.  Consistently return a zero status code so that various scripts
      over the interwebs do not complain.  Also return a zero status code if
      the KVM_CAP_SYNC_REGS capability is not present, and hardcode in the
      test the register kinds that are covered (rather than just using whatever
      value of KVM_SYNC_X86_VALID_FIELDS is provided by the kernel headers).
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      bcb2b94a
  5. 16 4月, 2018 1 次提交
  6. 10 4月, 2018 1 次提交
  7. 05 4月, 2018 1 次提交