]> Git Repo - linux.git/commitdiff
Merge tag 'powerpc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <[email protected]>
Sat, 13 Jun 2020 17:56:31 +0000 (10:56 -0700)
committerLinus Torvalds <[email protected]>
Sat, 13 Jun 2020 17:56:31 +0000 (10:56 -0700)
Pull powerpc fix from Michael Ellerman:
 "One fix for a recent change which broke nested KVM guests on Power9.

  Thanks to Alexey Kardashevskiy"

* tag 'powerpc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  KVM: PPC: Fix nested guest RC bits update

1  2 
arch/powerpc/kvm/book3s_hv_nested.c

index 0989751c9d5e0c95190fef9951822549efd9889c,75993f44519b22344e9a2e8bca3b09e22f3ccee0..2c849a65db7708377d9ac93d7e58a0ba575c3217
  #include <linux/kernel.h>
  #include <linux/kvm_host.h>
  #include <linux/llist.h>
 +#include <linux/pgtable.h>
  
  #include <asm/kvm_ppc.h>
  #include <asm/kvm_book3s.h>
  #include <asm/mmu.h>
 -#include <asm/pgtable.h>
  #include <asm/pgalloc.h>
  #include <asm/pte-walk.h>
  #include <asm/reg.h>
@@@ -290,7 -290,8 +290,7 @@@ long kvmhv_enter_nested_guest(struct kv
                        r = RESUME_HOST;
                        break;
                }
 -              r = kvmhv_run_single_vcpu(vcpu->arch.kvm_run, vcpu, hdec_exp,
 -                                        lpcr);
 +              r = kvmhv_run_single_vcpu(vcpu, hdec_exp, lpcr);
        } while (is_kvmppc_resume_guest(r));
  
        /* save L2 state for return */
@@@ -1233,7 -1234,7 +1233,7 @@@ static long kvmhv_handle_nested_set_rc(
  
        /* Set the rc bit in the pte of the shadow_pgtable for the nest guest */
        ret = kvmppc_hv_handle_set_rc(kvm, true, writing,
-                                     n_gpa, gp->shadow_lpid);
+                                     n_gpa, gp->l1_lpid);
        if (!ret)
                ret = -EINVAL;
        else
@@@ -1269,7 -1270,8 +1269,7 @@@ static inline int kvmppc_radix_shift_to
  }
  
  /* called with gp->tlb_lock held */
 -static long int __kvmhv_nested_page_fault(struct kvm_run *run,
 -                                        struct kvm_vcpu *vcpu,
 +static long int __kvmhv_nested_page_fault(struct kvm_vcpu *vcpu,
                                          struct kvm_nested_guest *gp)
  {
        struct kvm *kvm = vcpu->kvm;
                }
  
                /* passthrough of emulated MMIO case */
 -              return kvmppc_hv_emulate_mmio(run, vcpu, gpa, ea, writing);
 +              return kvmppc_hv_emulate_mmio(vcpu, gpa, ea, writing);
        }
        if (memslot->flags & KVM_MEM_READONLY) {
                if (writing) {
        rmapp = &memslot->arch.rmap[gfn - memslot->base_gfn];
        ret = kvmppc_create_pte(kvm, gp->shadow_pgtable, pte, n_gpa, level,
                                mmu_seq, gp->shadow_lpid, rmapp, &n_rmap);
 -      if (n_rmap)
 -              kfree(n_rmap);
 +      kfree(n_rmap);
        if (ret == -EAGAIN)
                ret = RESUME_GUEST;     /* Let the guest try again */
  
        return RESUME_GUEST;
  }
  
 -long int kvmhv_nested_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu)
 +long int kvmhv_nested_page_fault(struct kvm_vcpu *vcpu)
  {
        struct kvm_nested_guest *gp = vcpu->arch.nested;
        long int ret;
  
        mutex_lock(&gp->tlb_lock);
 -      ret = __kvmhv_nested_page_fault(run, vcpu, gp);
 +      ret = __kvmhv_nested_page_fault(vcpu, gp);
        mutex_unlock(&gp->tlb_lock);
        return ret;
  }
This page took 0.082774 seconds and 4 git commands to generate.