Skip to content

Replace current->mm by kvm->mm on powerpc/kvm

Leonardo Bras kvm-ppc linuxppc-dev lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v24 patches 3 repliesSuperseded
  3. v13 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on torvalds/master and updated the remaining patches.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2powerpc/kvm/book3s: Replace current->mm by kvm->mmarch/powerpc/kvm/book3s_64_mmu_hv.c arch/powerpc/kvm/book3s_64_vio.c arch/powerpc/kvm/book3s_hv.c+13 -110 replies
2/2powerpc/kvm/book3e: Replace current->mm by kvm->mmarch/powerpc/kvm/booke.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] Replace current->mm by kvm->mm on powerpc/kvm

Replace current->mm by kvm->mm on powerpc/kvm

By replacing, we would reduce the use of 'global' current on code, relying more in the contents of kvm struct.

On code, I found that in kvm_create_vm() there is:
kvm->mm = current->mm;

And that on every kvm_*_ioctl we have tests like that:
if (kvm->mm != current->mm)

        return -EIO;

So this change would be safe.

---
Changes since v2:
- Rebased on torvalds/master and updated the remaining patches.

Changes since v1:
- Fixes possible 'use after free' on kvm_spapr_tce_release (from v1)
- Fixes possible 'use after free' on kvm_vm_ioctl_create_spapr_tce
- Fixes undeclared variable error

Leonardo Bras (2):
powerpc/kvm/book3s: Replace current->mm by kvm->mm powerpc/kvm/book3e: Replace current->mm by kvm->mm

 arch/powerpc/kvm/book3s_64_mmu_hv.c |  4 ++--
 arch/powerpc/kvm/book3s_64_vio.c    | 10 ++++++----
 arch/powerpc/kvm/book3s_hv.c        | 10 +++++-----
 arch/powerpc/kvm/booke.c            |  2 +-
 4 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
2.23.0