linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ben Skeggs <skeggsb@gmail.com>
To: Ralph Campbell <rcampbell@nvidia.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
	linux-rdma@vger.kernel.org,  linux-mm@kvack.org,
	LKML <linux-kernel@vger.kernel.org>,
	 ML nouveau <nouveau@lists.freedesktop.org>,
	Jason Gunthorpe <jgg@mellanox.com>,
	 Ben Skeggs <bskeggs@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Christoph Hellwig <hch@lst.de>
Subject: Re: [Nouveau] [PATCH v3 1/4] nouveau/hmm: fix vma range check for migration
Date: Thu, 12 Mar 2020 17:55:39 +1000	[thread overview]
Message-ID: <CACAvsv4+od30K-FAr5Fet7kOz1APRDTXmHRc3fN4eiCVDhY02w@mail.gmail.com> (raw)
In-Reply-To: <20200304001339.8248-2-rcampbell@nvidia.com>

I've taken all 4 patches in my tree.

Thanks Ralph,
Ben.

On Wed, 4 Mar 2020 at 10:14, Ralph Campbell <rcampbell@nvidia.com> wrote:
>
> find_vma_intersection(mm, start, end) only guarantees that end is greater
> than or equal to vma->vm_start but doesn't guarantee that start is
> greater than or equal to vma->vm_start. The calculation for the
> intersecting range in nouveau_svmm_bind() isn't accounting for this and
> can call migrate_vma_setup() with a starting address less than
> vma->vm_start. This results in migrate_vma_setup() returning -EINVAL for
> the range instead of nouveau skipping that part of the range and migrating
> the rest.
>
> Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_svm.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c
> index df9bf1fd1bc0..169320409286 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_svm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
> @@ -179,6 +179,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
>                 if (!vma)
>                         break;
>
> +               addr = max(addr, vma->vm_start);
>                 next = min(vma->vm_end, end);
>                 /* This is a best effort so we ignore errors */
>                 nouveau_dmem_migrate_vma(cli->drm, vma, addr, next);
> --
> 2.20.1
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau


  reply	other threads:[~2020-03-12  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  0:13 [PATCH v3 0/4] nouveau/hmm: map pages after migration Ralph Campbell
2020-03-04  0:13 ` [PATCH v3 1/4] nouveau/hmm: fix vma range check for migration Ralph Campbell
2020-03-12  7:55   ` Ben Skeggs [this message]
2020-03-04  0:13 ` [PATCH v3 2/4] nouveau/hmm: check for SVM initialized before migrating Ralph Campbell
2020-03-04  0:13 ` [PATCH v3 3/4] nouveau: remove useless SVM range check Ralph Campbell
2020-03-04  0:13 ` [PATCH v3 4/4] nouveau/hmm: map pages after migration Ralph Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACAvsv4+od30K-FAr5Fet7kOz1APRDTXmHRc3fN4eiCVDhY02w@mail.gmail.com \
    --to=skeggsb@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=jgg@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rcampbell@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).