The Linux Kernel Mailing List
 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 09/13] accel/amdxdna: Use unsigned long for nr_pages in amdxdna_hmm_register()
Date: Mon, 6 Jul 2026 15:01:04 -0700	[thread overview]
Message-ID: <d4576d55-b33b-4fb6-a10a-e553637cc911@amd.com> (raw)
In-Reply-To: <20260616061532.3533469-1-lizhi.hou@amd.com>



On 6/15/2026 Mon 23:15, Lizhi Hou wrote:
> nr_pages is declared as u32 in amdxdna_hmm_register(), which may not be
> large enough to represent the number of pages for large mappings.
> 
> Use unsigned long for nr_pages to avoid potential overflow.
> 
> Fixes: ac49797c1815 ("accel/amdxdna: Add GEM buffer object management")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Max Zhen <max.zhen@amd.com>> ---
>   drivers/accel/amdxdna/amdxdna_gem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
> index aef4c23a1a66..201536aff440 100644
> --- a/drivers/accel/amdxdna/amdxdna_gem.c
> +++ b/drivers/accel/amdxdna/amdxdna_gem.c
> @@ -351,7 +351,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
>   	unsigned long len = vma->vm_end - vma->vm_start;
>   	unsigned long addr = vma->vm_start;
>   	struct amdxdna_umap *mapp;
> -	u32 nr_pages;
> +	unsigned long nr_pages;
>   	int ret;
>   
>   	if (!amdxdna_pasid_on(abo->client)) {


  reply	other threads:[~2026-07-06 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16  6:15 [PATCH V1 09/13] accel/amdxdna: Use unsigned long for nr_pages in amdxdna_hmm_register() Lizhi Hou
2026-07-06 22:01 ` Max Zhen [this message]
2026-07-07  5:47   ` Lizhi Hou

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=d4576d55-b33b-4fb6-a10a-e553637cc911@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