All of lore.kernel.org
 help / color / mirror / Atom feed
* [agd5f:drm-next 260/362] drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:422:54: error: '_pfp.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33
@ 2024-05-03 14:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-03 14:24 UTC (permalink / raw)
  To: Likun Gao; +Cc: oe-kbuild-all, Alex Deucher, Hawking Zhang

tree:   https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head:   b0923d5d80facb205cc2b7f82994ab5c3eef3181
commit: 52cb80c12e8a647aa9c903903d58916e6c1c4d38 [260/362] drm/amdgpu: Add gfx v12_0 ip block support (v6)
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20240503/202405032208.8mieAYda-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240503/202405032208.8mieAYda-lkp@intel.com/reproduce)

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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405032208.8mieAYda-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c: In function 'gfx_v12_0_init_microcode':
>> drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:422:54: error: '_pfp.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Werror=format-truncation=]
     422 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", ucode_prefix);
         |                                                      ^~~~~~~~
   drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:422:9: note: 'snprintf' output between 16 and 45 bytes into a destination of size 40
     422 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", ucode_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:429:54: error: '_me.bin' directive output may be truncated writing 7 bytes into a region of size between 4 and 33 [-Werror=format-truncation=]
     429 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", ucode_prefix);
         |                                                      ^~~~~~~
   drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:429:9: note: 'snprintf' output between 15 and 44 bytes into a destination of size 40
     429 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", ucode_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:437:62: error: '_rlc.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Werror=format-truncation=]
     437 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
         |                                                              ^~~~~~~~
   drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:437:17: note: 'snprintf' output between 16 and 45 bytes into a destination of size 40
     437 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:449:54: error: '_mec.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Werror=format-truncation=]
     449 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", ucode_prefix);
         |                                                      ^~~~~~~~
   drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:449:9: note: 'snprintf' output between 16 and 45 bytes into a destination of size 40
     449 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", ucode_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +422 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

   408	
   409	static int gfx_v12_0_init_microcode(struct amdgpu_device *adev)
   410	{
   411		char fw_name[40];
   412		char ucode_prefix[30];
   413		int err;
   414		const struct rlc_firmware_header_v2_0 *rlc_hdr;
   415		uint16_t version_major;
   416		uint16_t version_minor;
   417	
   418		DRM_DEBUG("\n");
   419	
   420		amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix));
   421	
 > 422		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", ucode_prefix);
   423		err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw, fw_name);
   424		if (err)
   425			goto out;
   426		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_PFP);
   427		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK);
   428	
 > 429		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", ucode_prefix);
   430		err = amdgpu_ucode_request(adev, &adev->gfx.me_fw, fw_name);
   431		if (err)
   432			goto out;
   433		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_ME);
   434		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK);
   435	
   436		if (!amdgpu_sriov_vf(adev)) {
 > 437			snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
   438			err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, fw_name);
   439			if (err)
   440				goto out;
   441			rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
   442			version_major = le16_to_cpu(rlc_hdr->header.header_version_major);
   443			version_minor = le16_to_cpu(rlc_hdr->header.header_version_minor);
   444			err = amdgpu_gfx_rlc_init_microcode(adev, version_major, version_minor);
   445			if (err)
   446				goto out;
   447		}
   448	
 > 449		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", ucode_prefix);
   450		err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw, fw_name);
   451		if (err)
   452			goto out;
   453		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_MEC);
   454		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_MEC_P0_STACK);
   455		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_MEC_P1_STACK);
   456	
   457		if (adev->firmware.load_type == AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO)
   458			err = gfx_v12_0_init_toc_microcode(adev, ucode_prefix);
   459	
   460		/* only one MEC for gfx 12 */
   461		adev->gfx.mec2_fw = NULL;
   462	
   463	out:
   464		if (err) {
   465			amdgpu_ucode_release(&adev->gfx.pfp_fw);
   466			amdgpu_ucode_release(&adev->gfx.me_fw);
   467			amdgpu_ucode_release(&adev->gfx.rlc_fw);
   468			amdgpu_ucode_release(&adev->gfx.mec_fw);
   469		}
   470	
   471		return err;
   472	}
   473	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-03 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-03 14:24 [agd5f:drm-next 260/362] drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c:422:54: error: '_pfp.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 kernel test robot

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.