lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 27/34] drm/i915/gvt: remove kvmgt_guest_{init,exit}
On Mon, Apr 11, 2022 at 04:13:56PM +0200, Christoph Hellwig wrote:
> Merge these into their only callers.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/gpu/drm/i915/gvt/kvmgt.c | 129 ++++++++++++++-----------------
> 1 file changed, 60 insertions(+), 69 deletions(-)

It is nice

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

> @@ -847,14 +873,37 @@ static int intel_vgpu_open_device(struct mdev_device *mdev)
> goto undo_group;
> }
>
> - ret = kvmgt_guest_init(mdev);
> - if (ret)
> + ret = -EEXIST;
> + if (vgpu->attached)
> + goto undo_group;
> +
> + ret = -ESRCH;
> + if (!vgpu->kvm || vgpu->kvm->mm != current->mm) {

For instance once all the obfuscation is stripped away it is easy to
see how the vgpu->kvm access here is unlocked against the notifier and
racy.

Jason

\
 
 \ /
  Last update: 2022-04-11 20:42    [W:0.346 / U:1.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site