Merge branch 'kvm-amd-fixes' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:14:05 +0000 (12:14 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:14:05 +0000 (12:14 -0400)
16 files changed:
1  2 
arch/arm64/kvm/guest.c
arch/powerpc/kvm/powerpc.c
arch/s390/kvm/kvm-s390.c
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/hyperv.c
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/kvm_util.c
virt/kvm/kvm_main.c

Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1425,8 -1425,9 +1425,8 @@@ static u64 kvm_hv_flush_tlb(struct kvm_
         * vcpu->arch.cr3 may not be up-to-date for running vCPUs so we can't
         * analyze it here, flush TLB regardless of the specified address space.
         */
 -      kvm_make_vcpus_request_mask(kvm,
 -                                  KVM_REQ_TLB_FLUSH | KVM_REQUEST_NO_WAKEUP,
 +      kvm_make_vcpus_request_mask(kvm, KVM_REQ_HV_TLB_FLUSH,
-                                   vcpu_mask, &hv_vcpu->tlb_flush);
+                                   NULL, vcpu_mask, &hv_vcpu->tlb_flush);
  
  ret_success:
        /* We always do full TLB flush, set rep_done = rep_cnt. */
Simple merge
Simple merge
@@@ -5208,35 -5156,16 +5208,35 @@@ static int handle_invept(struct kvm_vcp
                return 1;
        }
  
 -      switch (type) {
 -      case VMX_EPT_EXTENT_GLOBAL:
 -      case VMX_EPT_EXTENT_CONTEXT:
        /*
 -       * TODO: Sync the necessary shadow EPT roots here, rather than
 -       * at the next emulated VM-entry.
 +       * Nested EPT roots are always held through guest_mmu,
 +       * not root_mmu.
         */
 +      mmu = &vcpu->arch.guest_mmu;
 +
 +      switch (type) {
 +      case VMX_EPT_EXTENT_CONTEXT:
 +              if (!nested_vmx_check_eptp(vcpu, operand.eptp))
 +                      return nested_vmx_failValid(vcpu,
 +                              VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
 +
 +              roots_to_free = 0;
 +              if (nested_ept_root_matches(mmu->root_hpa, mmu->root_pgd,
 +                                          operand.eptp))
 +                      roots_to_free |= KVM_MMU_ROOT_CURRENT;
 +
 +              for (i = 0; i < KVM_MMU_NUM_PREV_ROOTS; i++) {
 +                      if (nested_ept_root_matches(mmu->prev_roots[i].hpa,
 +                                                  mmu->prev_roots[i].pgd,
 +                                                  operand.eptp))
 +                              roots_to_free |= KVM_MMU_ROOT_PREVIOUS(i);
 +              }
 +              break;
 +      case VMX_EPT_EXTENT_GLOBAL:
 +              roots_to_free = KVM_MMU_ROOTS_ALL;
                break;
        default:
-               BUG_ON(1);
+               BUG();
                break;
        }
  
@@@ -4710,15 -4672,10 +4729,10 @@@ static int handle_exception_nmi(struct 
                return handle_rmode_exception(vcpu, ex_no, error_code);
  
        switch (ex_no) {
-       case AC_VECTOR:
-               kvm_queue_exception_e(vcpu, AC_VECTOR, error_code);
-               return 1;
        case DB_VECTOR:
 -              dr6 = vmcs_readl(EXIT_QUALIFICATION);
 +              dr6 = vmx_get_exit_qual(vcpu);
                if (!(vcpu->guest_debug &
                      (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
-                       vcpu->arch.dr6 &= ~DR_TRAP_BITS;
-                       vcpu->arch.dr6 |= dr6 | DR6_RTM;
                        if (is_icebp(intr_info))
                                WARN_ON(!skip_emulated_instruction(vcpu));
  
Simple merge
Simple merge
Simple merge
Simple merge