]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Fix life cycle reference on KVM mm
authorZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 31 Aug 2018 02:58:52 +0000 (10:58 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 4 Sep 2018 06:55:23 +0000 (14:55 +0800)
commit2571183b9bac7336a7889d28e51017f7247b010e
treeec6633c8130a8f1c1539b797d69d92c45fa990ea
parent082f5e5c62e9a57032e07e9498c675fd56d33470
drm/i915/gvt: Fix life cycle reference on KVM mm

Handle guest mm access life cycle properly with mmget()/mmput().
As noted by Linus, use_mm() depends on valid live page table but
KVM's mmgrab() doesn't guarantee that. As vGPU usage depends on
guest VM life cycle, need to make sure to use mmget()/mmput() to
guarantee VM address access.

v3: fix build

v2: v1 caused a weird dependence issue which failed for vfio
device release, which result invalid mdev vgpu and kvm state
without proper release taken. This trys to put right reference
around VM address space access instead.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/kvmgt.c