1. 28 12月, 2021 6 次提交
  2. 18 11月, 2021 1 次提交
    • A
      selftests: KVM: Add /x86_64/sev_migrate_tests to .gitignore · b768f60b
      Arnaldo Carvalho de Melo 提交于
        $ git status
        nothing to commit, working tree clean
        $
        $ make -C tools/testing/selftests/kvm/ > /dev/null 2>&1
        $ git status
      
        Untracked files:
          (use "git add <file>..." to include in what will be committed)
        	tools/testing/selftests/kvm/x86_64/sev_migrate_tests
      
        nothing added to commit but untracked files present (use "git add" to track)
        $
      
      Fixes: 6a581508 ("selftest: KVM: Add intra host migration tests")
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Marc Orr <marcorr@google.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Gonda <pgonda@google.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Message-Id: <YZPIPfvYgRDCZi/w@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b768f60b
  3. 16 11月, 2021 17 次提交
  4. 11 11月, 2021 2 次提交
  5. 23 10月, 2021 1 次提交
    • J
      KVM: selftests: Fix nested SVM tests when built with clang · ed290e1c
      Jim Mattson 提交于
      Though gcc conveniently compiles a simple memset to "rep stos," clang
      prefers to call the libc version of memset. If a test is dynamically
      linked, the libc memset isn't available in L1 (nor is the PLT or the
      GOT, for that matter). Even if the test is statically linked, the libc
      memset may choose to use some CPU features, like AVX, which may not be
      enabled in L1. Note that __builtin_memset doesn't solve the problem,
      because (a) the compiler is free to call memset anyway, and (b)
      __builtin_memset may also choose to use features like AVX, which may
      not be available in L1.
      
      To avoid a myriad of problems, use an explicit "rep stos" to clear the
      VMCB in generic_svm_setup(), which is called both from L0 and L1.
      Reported-by: NRicardo Koller <ricarkol@google.com>
      Signed-off-by: NJim Mattson <jmattson@google.com>
      Fixes: 20ba262f ("selftests: KVM: AMD Nested test infrastructure")
      Message-Id: <20210930003649.4026553-1-jmattson@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ed290e1c
  6. 22 10月, 2021 2 次提交
    • M
      KVM: selftests: set CPUID before setting sregs in vcpu creation · 413eaa4e
      Michael Roth 提交于
      Recent kernels have checks to ensure the GPA values in special-purpose
      registers like CR3 are within the maximum physical address range and
      don't overlap with anything in the upper/reserved range. In the case of
      SEV kselftest guests booting directly into 64-bit mode, CR3 needs to be
      initialized to the GPA of the page table root, with the encryption bit
      set. The kernel accounts for this encryption bit by removing it from
      reserved bit range when the guest advertises the bit position via
      KVM_SET_CPUID*, but kselftests currently call KVM_SET_SREGS as part of
      vm_vcpu_add_default(), before KVM_SET_CPUID*.
      
      As a result, KVM_SET_SREGS will return an error in these cases.
      Address this by moving vcpu_set_cpuid() (which calls KVM_SET_CPUID*)
      ahead of vcpu_setup() (which calls KVM_SET_SREGS).
      
      While there, address a typo in the assertion that triggers when
      KVM_SET_SREGS fails.
      Suggested-by: NSean Christopherson <seanjc@google.com>
      Signed-off-by: NMichael Roth <michael.roth@amd.com>
      Message-Id: <20211006203617.13045-1-michael.roth@amd.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NNathan Tempelman <natet@google.com>
      413eaa4e
    • S
      selftests: kvm: fix mismatched fclose() after popen() · c3867ab5
      Shuah Khan 提交于
      get_warnings_count() does fclose() using File * returned from popen().
      Fix it to call pclose() as it should.
      
      tools/testing/selftests/kvm/x86_64/mmio_warning_test
      x86_64/mmio_warning_test.c: In function ‘get_warnings_count’:
      x86_64/mmio_warning_test.c:87:9: warning: ‘fclose’ called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
         87 |         fclose(f);
            |         ^~~~~~~~~
      x86_64/mmio_warning_test.c:84:13: note: returned from ‘popen’
         84 |         f = popen("dmesg | grep \"WARNING:\" | wc -l", "r");
            |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      c3867ab5
  7. 21 10月, 2021 2 次提交
  8. 19 10月, 2021 4 次提交
  9. 17 10月, 2021 5 次提交