All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Likun Gao <Likun.Gao@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Alex Deucher <alexander.deucher@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: [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
Date: Fri, 3 May 2024 22:24:08 +0800	[thread overview]
Message-ID: <202405032208.8mieAYda-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-05-03 14:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202405032208.8mieAYda-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Likun.Gao@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=oe-kbuild-all@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.