From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org
Cc: kernel test robot <oliver.sang@intel.com>,
Vlastimil Babka <vbabka@suse.cz>,
Matthew Wilcox <willy@infradead.org>, Yu Zhao <yuzhao@google.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/userptr: restore probe_range behaviour
Date: Tue, 25 Oct 2022 16:40:23 +0100 [thread overview]
Message-ID: <992f7687-f56a-e174-9369-b7216d7d6fca@linux.intel.com> (raw)
In-Reply-To: <20221024172139.80435-1-matthew.auld@intel.com>
On 24/10/2022 18:21, Matthew Auld wrote:
> The conversion looks harmless, however the addr value is updated inside
> the loop with the previous vm_end, which then incorrectly leads to
> for_each_vma_range() iterating over stuff outside the range we care
> about. Fix this by storing the end value separately.
>
> Testcase: igt@gem_userptr_blits@probe
> Fixes: f683b9d61319 ("i915: use the VMA iterator")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Yu Zhao <yuzhao@google.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> index b7e24476a0fd..dadb3e3fa9c8 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> @@ -427,9 +427,10 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len)
> {
> VMA_ITERATOR(vmi, mm, addr);
> struct vm_area_struct *vma;
> + unsigned long end = addr + len;
>
> mmap_read_lock(mm);
> - for_each_vma_range(vmi, vma, addr + len) {
> + for_each_vma_range(vmi, vma, end) {
> /* Check for holes, note that we also update the addr below */
> if (vma->vm_start > addr)
> break;
I am unsure of the for_each_vma_range() behaviour regarding holes. If it
just skips overs them and continues to next VMA in the range then patch
looks good to me. Could someone confirm?
Regards,
Tvrtko
next prev parent reply other threads:[~2022-10-25 15:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 17:21 [Intel-gfx] [PATCH] drm/i915/userptr: restore probe_range behaviour Matthew Auld
2022-10-24 23:49 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2022-10-25 15:40 ` Tvrtko Ursulin [this message]
2022-10-25 15:54 ` [Intel-gfx] [PATCH] " Matthew Wilcox
2022-10-25 16:01 ` Tvrtko Ursulin
2022-10-26 10:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/userptr: restore probe_range behaviour (rev2) Patchwork
2022-10-26 20:35 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=992f7687-f56a-e174-9369-b7216d7d6fca@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=oliver.sang@intel.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=yuzhao@google.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