Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1418042pxj; Fri, 4 Jun 2021 14:01:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs7v0npfObGxmXzIXIPaZ6fwhvYtvvIv61sI2ruricVsRxXTlqZ24JPKIz1Kcwx0zq/MUD X-Received: by 2002:aa7:cad4:: with SMTP id l20mr6685501edt.382.1622840513167; Fri, 04 Jun 2021 14:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622840513; cv=none; d=google.com; s=arc-20160816; b=g1MMP0bJjXUKqrr8ClSTn3aLCEcZ0qRz3ksiNqKykdp9g8bg+Uw99yRnTnIlng5GPv ZZhm1WgWicoaFgFiJ36g3ORDUsNf54M3nr92KCHMZFBrQ9aVTjeBW8XuzaMZVj5ay3mG +kj+ntAuPp2EER3BZXVEItftM2MEvhmeI/DjolsOe8FRFTR6aUBBDKtJL3HoLNlsQIZH hWyq1kxhfvVKanjrvA6hzq9iEZ0wQdNixalO4xd7kw5qCUkKfaMmJtTQ/TXYTc1bA69s wLo5KnOMR9wq8P4G+obT65mn4hvpcey08qoEySQBlpbRKyx2hRPhc4Mv/RQQ822BAjmD hZdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hcL1duf2cmVS2FFozNPUZ6B5aiW4MPId9J+rVmkQUYk=; b=Z1NK8pwsJlqZp5dxul38FSJS+rxEVTCDnn76b2U3sfdHKuhpry4bgRNEsZzcmECQaZ MVLAXJi14x3UwqunqG4scbp5sfCkMrt6o05wnwVH5ON7v/Qauxx5ANg8p3N5pjkW+s1l RTFF6U9RW3cyaONGWG3QI9hMINjjR+DcDcCnsh1u3I83WQwmT+8tpO5wFfe4xqZSuX7n 3FIqz/39f3OnsMQuRs8W0LQgXXFfw/0jDK4uRkk62KMBfE97V7lDbfPb4Y5A/m3KyKNH D6nBW78IzbnzRSm2ng9hvUERf+V9lCNJfD4zMBIC/vheYn1HvZ41Ym/lys06O4lQV5LC u0Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y3QUX1ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si5757424ejd.575.2021.06.04.14.01.28; Fri, 04 Jun 2021 14:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y3QUX1ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230177AbhFDVCY (ORCPT + 99 others); Fri, 4 Jun 2021 17:02:24 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:34677 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbhFDVCX (ORCPT ); Fri, 4 Jun 2021 17:02:23 -0400 Received: by mail-oi1-f174.google.com with SMTP id u11so11057339oiv.1 for ; Fri, 04 Jun 2021 14:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hcL1duf2cmVS2FFozNPUZ6B5aiW4MPId9J+rVmkQUYk=; b=Y3QUX1ZAvnl/3ato47zA/tKEluRFWys/uYy3LhRgHryxJy2v3HpkGSBbNRtRMeFYv/ ygX8EevDFP1KKbg1U2360M0YCC720fLNFdPjNlRkeqlJs1HSqOFPDZRYpiLcy+j2K5+D 3vcB/6sobewdj640tdMhp4agMFL8k3XJzAE8zJS75Z/gEBQ2vhZeg4dzDb54oBcKxnHt OSPTZ0/CaLJlC0rZRtm9tWghIbGTcd8B3KSN+0oTMRrkqzTwqmrIEaOQLT2vgDfkfTeE hWPaCj0fH+m2+XE5/THM8CXTNPd73SeWW9RO1wE1eLKtsGrmDRR9bNZ3AV0cZj2ZZ173 RY9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hcL1duf2cmVS2FFozNPUZ6B5aiW4MPId9J+rVmkQUYk=; b=QDpQcjbVEgN7eA9dJFqEhesqJ4attGKF0xMyLDpu5YGxhSPzHvGHV4wj8fjUBPEXvK VyJ2Ea7DCTDYwSyp5hzkKMrom+jWN7E0/a55E2pxKok/WpCxgAnwY/C1dDObw1+f8P8B qamDlLhCQhJzJ1vsLQyJbSHd2oaWh0/0yGyoqxA6qo+dZ3Bf3Zb1siLC7a4Ejg/6xuMq edcyEITbPQ0sa3+UduA6ovYH0as3BqjftirtirWDB5pz4D9fNngx7SDyvw7zoLpbfrEs wpYNgVAQYI/JIBT/S57ko/ymfatTBibhLEM0+GguGaM32ej877m20gGQDi5WtWsM0+TI +UNA== X-Gm-Message-State: AOAM533LfT21uPDIbhEGPDUgJefZFzCw5WOuA+bmSKZulUyawbtaHg+9 5CbRnUxnjiZFl7Hp7PPv25tBsdsBHs2+LcLwREw= X-Received: by 2002:a05:6808:206:: with SMTP id l6mr11541621oie.5.1622840361985; Fri, 04 Jun 2021 13:59:21 -0700 (PDT) MIME-Version: 1.0 References: <20210603160928.3854180-1-Liam.Howlett@Oracle.com> <4d2e62c7-af4c-b977-a05c-97b664b532b3@gmail.com> In-Reply-To: <4d2e62c7-af4c-b977-a05c-97b664b532b3@gmail.com> From: Alex Deucher Date: Fri, 4 Jun 2021 16:59:10 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages() To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Liam Howlett , Andrew Morton , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , David Airlie Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 4, 2021 at 7:11 AM Christian K=C3=B6nig wrote: > > Am 03.06.21 um 18:09 schrieb Liam Howlett: > > Use vma_lookup() to find the VMA at a specific address. As vma_lookup(= ) > > will return NULL if the address is not within any VMA, the start addres= s > > no longer needs to be validated. > > > > Signed-off-by: Liam R. Howlett > > Reviewed-by: Christian K=C3=B6nig > I'm fine to have this go through whatever tree makes sense. Acked-by: Alex Deucher > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/= amd/amdgpu/amdgpu_ttm.c > > index 7cb7ffdd1900..dfb5ca3f8da8 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > > @@ -680,9 +680,9 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *= bo, struct page **pages) > > return -ESRCH; > > > > mmap_read_lock(mm); > > - vma =3D find_vma(mm, start); > > + vma =3D vma_lookup(mm, start); > > mmap_read_unlock(mm); > > - if (unlikely(!vma || start < vma->vm_start)) { > > + if (unlikely(!vma)) { > > r =3D -EFAULT; > > goto out_putmm; > > } >