1. 06 8月, 2018 5 次提交
    • 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: actually use all of lib/vmx.c · 87ccb7db
      Paolo Bonzini 提交于
      The allocation of the VMXON and VMCS is currently done twice, in
      lib/vmx.c and in vmx_tsc_adjust_test.c.  Reorganize the code to
      provide a cleaner and easier to use API to the tests.  lib/vmx.c
      now does the complete setup of the VMX data structures, but does not
      create the VM or set CPUID.  This has to be done by the caller.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      87ccb7db
    • 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
    • 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
  2. 31 5月, 2018 3 次提交
  3. 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
  4. 16 4月, 2018 1 次提交
  5. 13 4月, 2018 1 次提交
  6. 10 4月, 2018 1 次提交
  7. 05 4月, 2018 2 次提交