All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:69 gfxhub_v12_1_xcc_setup_vm_pt_regs() error: buffer overflow 'adev->vmhub' 13 <= s32max
Date: Fri, 07 Aug 2026 02:39:17 +0800	[thread overview]
Message-ID: <202608070257.3q9GpqXZ-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Hawking Zhang <Hawking.Zhang@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Le Ma <le.ma@amd.com>
CC: Likun Gao <Likun.Gao@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fcaeecb8b0cd44f77d03b28de0671258d4db18f8
commit: e87bfaf55e7311b9587c0163060c6939c36f077e drm/amdgpu: Add gfxhub v12_1 support
date:   8 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 8 months ago
config: i386-randconfig-141-20260806 (https://download.01.org/0day-ci/archive/20260807/202608070257.3q9GpqXZ-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
smatch: v0.5.0-9187-g5189e3fb

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: e87bfaf55e73 ("drm/amdgpu: Add gfxhub v12_1 support")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202608070257.3q9GpqXZ-lkp@intel.com/

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:69 gfxhub_v12_1_xcc_setup_vm_pt_regs() error: buffer overflow 'adev->vmhub' 13 <= s32max
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:412 gfxhub_v12_1_xcc_setup_vmid_config() error: buffer overflow 'adev->vmhub' 13 <= s32max
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:470 gfxhub_v12_1_xcc_program_invalidation() error: buffer overflow 'adev->vmhub' 13 <= u32max
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:539 gfxhub_v12_1_xcc_gart_disable() error: buffer overflow 'adev->vmhub' 13 <= u32max
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:752 gfxhub_v12_1_xcc_init() error: buffer overflow 'adev->vmhub' 13 <= s32max

vim +69 drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c

e87bfaf55e7311b Hawking Zhang 2025-02-24  59  
e87bfaf55e7311b Hawking Zhang 2025-02-24  60  static void gfxhub_v12_1_xcc_setup_vm_pt_regs(struct amdgpu_device *adev,
e87bfaf55e7311b Hawking Zhang 2025-02-24  61  					      uint32_t vmid,
e87bfaf55e7311b Hawking Zhang 2025-02-24  62  					      uint64_t page_table_base,
e87bfaf55e7311b Hawking Zhang 2025-02-24  63  					      uint32_t xcc_mask)
e87bfaf55e7311b Hawking Zhang 2025-02-24  64  {
e87bfaf55e7311b Hawking Zhang 2025-02-24  65  	struct amdgpu_vmhub *hub;
e87bfaf55e7311b Hawking Zhang 2025-02-24  66  	int i;
e87bfaf55e7311b Hawking Zhang 2025-02-24  67  
e87bfaf55e7311b Hawking Zhang 2025-02-24  68  	for_each_inst(i, xcc_mask) {
e87bfaf55e7311b Hawking Zhang 2025-02-24 @69  		hub = &adev->vmhub[AMDGPU_GFXHUB(i)];
e87bfaf55e7311b Hawking Zhang 2025-02-24  70  		WREG32_SOC15_OFFSET(GC, GET_INST(GC, i),
e87bfaf55e7311b Hawking Zhang 2025-02-24  71  				    regGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32,
e87bfaf55e7311b Hawking Zhang 2025-02-24  72  				    hub->ctx_addr_distance * vmid,
e87bfaf55e7311b Hawking Zhang 2025-02-24  73  				    lower_32_bits(page_table_base));
e87bfaf55e7311b Hawking Zhang 2025-02-24  74  
e87bfaf55e7311b Hawking Zhang 2025-02-24  75  		WREG32_SOC15_OFFSET(GC, GET_INST(GC, i),
e87bfaf55e7311b Hawking Zhang 2025-02-24  76  				    regGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32,
e87bfaf55e7311b Hawking Zhang 2025-02-24  77  				    hub->ctx_addr_distance * vmid,
e87bfaf55e7311b Hawking Zhang 2025-02-24  78  				    upper_32_bits(page_table_base));
e87bfaf55e7311b Hawking Zhang 2025-02-24  79  	}
e87bfaf55e7311b Hawking Zhang 2025-02-24  80  }
e87bfaf55e7311b Hawking Zhang 2025-02-24  81  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-08-06 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 18:39 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-08  7:43 drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c:69 gfxhub_v12_1_xcc_setup_vm_pt_regs() error: buffer overflow 'adev->vmhub' 13 <= s32max kernel test robot

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=202608070257.3q9GpqXZ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.