]> Git Repo - J-linux.git/commitdiff
Merge tag 'kvm-ppc-fixes-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorPaolo Bonzini <[email protected]>
Tue, 21 Apr 2020 13:39:55 +0000 (09:39 -0400)
committerPaolo Bonzini <[email protected]>
Tue, 21 Apr 2020 13:39:55 +0000 (09:39 -0400)
PPC KVM fix for 5.7

- Fix a regression introduced in the last merge window, which results
  in guests in HPT mode dying randomly.

1  2 
arch/powerpc/kvm/book3s_64_mmu_hv.c
arch/powerpc/kvm/book3s_64_mmu_radix.c

index 6404df613ea36a0783609b45df72fde12cf9c7ed,20b7dce739ad5c8a4c2480b9a24fae461b4ed2f7..2b35f9bcf8928f8404d4b9781bcbb2d6c2503b62
@@@ -604,18 -604,19 +604,19 @@@ int kvmppc_book3s_hv_page_fault(struct 
         */
        local_irq_disable();
        ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
+       pte = __pte(0);
+       if (ptep)
+               pte = *ptep;
+       local_irq_enable();
        /*
         * If the PTE disappeared temporarily due to a THP
         * collapse, just return and let the guest try again.
         */
-       if (!ptep) {
-               local_irq_enable();
+       if (!pte_present(pte)) {
                if (page)
                        put_page(page);
                return RESUME_GUEST;
        }
-       pte = *ptep;
-       local_irq_enable();
        hpa = pte_pfn(pte) << PAGE_SHIFT;
        pte_size = PAGE_SIZE;
        if (shift)
@@@ -2133,8 -2134,9 +2134,8 @@@ static const struct file_operations deb
  
  void kvmppc_mmu_debugfs_init(struct kvm *kvm)
  {
 -      kvm->arch.htab_dentry = debugfs_create_file("htab", 0400,
 -                                                  kvm->arch.debugfs_dir, kvm,
 -                                                  &debugfs_htab_fops);
 +      debugfs_create_file("htab", 0400, kvm->arch.debugfs_dir, kvm,
 +                          &debugfs_htab_fops);
  }
  
  void kvmppc_mmu_book3s_hv_init(struct kvm_vcpu *vcpu)
index 9f050064d2a2d7523ff0d89222d7bc6e8f3f2bc3,7bf94ba62f6d9abfc1c61987e37eac354968ad3a..aa12cd4078b3205e85d4cdf2d8746229377bd937
@@@ -815,18 -815,19 +815,19 @@@ int kvmppc_book3s_instantiate_page(stru
         */
        local_irq_disable();
        ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
+       pte = __pte(0);
+       if (ptep)
+               pte = *ptep;
+       local_irq_enable();
        /*
         * If the PTE disappeared temporarily due to a THP
         * collapse, just return and let the guest try again.
         */
-       if (!ptep) {
-               local_irq_enable();
+       if (!pte_present(pte)) {
                if (page)
                        put_page(page);
                return RESUME_GUEST;
        }
-       pte = *ptep;
-       local_irq_enable();
  
        /* If we're logging dirty pages, always map single pages */
        large_enable = !(memslot->flags & KVM_MEM_LOG_DIRTY_PAGES);
@@@ -1376,8 -1377,9 +1377,8 @@@ static const struct file_operations deb
  
  void kvmhv_radix_debugfs_init(struct kvm *kvm)
  {
 -      kvm->arch.radix_dentry = debugfs_create_file("radix", 0400,
 -                                                   kvm->arch.debugfs_dir, kvm,
 -                                                   &debugfs_radix_fops);
 +      debugfs_create_file("radix", 0400, kvm->arch.debugfs_dir, kvm,
 +                          &debugfs_radix_fops);
  }
  
  int kvmppc_radix_init(void)
This page took 0.054538 seconds and 4 git commands to generate.