summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLeonardo Bras <leonardo@linux.ibm.com>2019-09-24 00:24:08 +0300
committerPaul Mackerras <paulus@ozlabs.org>2019-10-22 08:29:01 +0300
commitf41c4989c8de1fa70aafe950abaf80c56a8b8712 (patch)
treef6535e8d44d066062fb03495d7639c7ed100ffb4 /arch
parent258ed7d02843052d127df2264c8b342276ced18a (diff)
downloadlinux-f41c4989c8de1fa70aafe950abaf80c56a8b8712.tar.xz
KVM: PPC: E500: Replace current->mm by kvm->mm
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more in the contents of kvm struct. Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 321db0fdb9db..425d13806645 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -355,9 +355,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
if (tlbsel == 1) {
struct vm_area_struct *vma;
- down_read(&current->mm->mmap_sem);
+ down_read(&kvm->mm->mmap_sem);
- vma = find_vma(current->mm, hva);
+ vma = find_vma(kvm->mm, hva);
if (vma && hva >= vma->vm_start &&
(vma->vm_flags & VM_PFNMAP)) {
/*
@@ -441,7 +441,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);
}
- up_read(&current->mm->mmap_sem);
+ up_read(&kvm->mm->mmap_sem);
}
if (likely(!pfnmap)) {