mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Max Zhen <max.zhen@amd.com>
To: Lizhi Hou <lizhi.hou@amd.com>, <ogabbay@kernel.org>,
	<quic_jhugo@quicinc.com>, <dri-devel@lists.freedesktop.org>,
	<mario.limonciello@amd.com>, <karol.wachowski@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <sonal.santan@amd.com>
Subject: Re: [PATCH V1] accel/amdxdna: Use vma->vm_mm consistently in amdxdna_hmm_register()
Date: Fri, 6 Nov 2026 12:45:56 -0800	[thread overview]
Message-ID: <eecbf66e-d2f8-4872-bd97-672ffaa2c7b4@amd.com> (raw)
In-Reply-To: <20261106203516.2734090-1-lizhi.hou@amd.com>



On 11/6/2026 Fri 12:35, Lizhi Hou wrote:
> amdxdna_hmm_register() keys the umap list lookup and the interval
> notifier insertion on current->mm, while amdxdna_hmm_unregister() and
> amdxdna_mark_mapp_invalid() match the same list entries against
> vma->vm_mm. The two are identical for the ->mmap() callback, so this is
> not a functional change, but the inconsistency makes the code harder to
> follow.
> 
> Use vma->vm_mm in both places. It is the mm whose mmap_lock is held
> across ->mmap(), which is what mmu_interval_notifier_insert_locked()
> asserts on, and it is the mm the teardown paths look the mapping up by.
> 
> Assisted-by: LLM
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Max Zhen <max.zhen@amd.com>
> ---
>   drivers/accel/amdxdna/amdxdna_gem.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
> index 09e48c794e1b..92125bc753c7 100644
> --- a/drivers/accel/amdxdna/amdxdna_gem.c
> +++ b/drivers/accel/amdxdna/amdxdna_gem.c
> @@ -443,7 +443,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
>   
>   	down_read(&xdna->notifier_lock);
>   	list_for_each_entry(mapp, &abo->mem.umap_list, node) {
> -		if (compare_range(mapp, current->mm, addr, addr + len)) {
> +		if (compare_range(mapp, vma->vm_mm, addr, addr + len)) {
>   			up_read(&xdna->notifier_lock);
>   			return 0;
>   		}
> @@ -477,7 +477,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
>   	kref_init(&mapp->refcnt);
>   
>   	ret = mmu_interval_notifier_insert_locked(&mapp->notifier,
> -						  current->mm,
> +						  vma->vm_mm,
>   						  addr,
>   						  len,
>   						  &amdxdna_hmm_ops);
> 
> base-commit: d2a8cee91bfa8616f713c7c8f539a81e8e3554ea


      reply	other threads:[~2026-11-06 20:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 20:35 Lizhi Hou
2026-11-06 20:45 ` Max Zhen [this message]

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=eecbf66e-d2f8-4872-bd97-672ffaa2c7b4@amd.com \
    --to=max.zhen@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=karol.wachowski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.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

all inboxes | Powered by JetHome®