tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: b6fc3fddade7a194bd141a49f2689e50f796ef46 commit: c0cc999f3c32e65a7c88fb323893ddf897b24488 [4936/6121] drm/amdkfd: Fix the warning of array-index-out-of-bounds config: arm64-allyesconfig compiler: aarch64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c0cc999f3c32e65a7c88fb323893ddf897b24488 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout c0cc999f3c32e65a7c88fb323893ddf897b24488 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1726:6: warning: no previous prototype for 'kfd_fill_cache_non_crat_info' [-Wmissing-prototypes] 1726 | void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct kfd_dev *kdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/kfd_fill_cache_non_crat_info +1726 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c 1722 1723 /* kfd_fill_cache_non_crat_info - Fill GPU cache info using kfd_gpu_cache_info 1724 * tables 1725 */ > 1726 void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct kfd_dev *kdev) 1727 { 1728 struct kfd_gpu_cache_info *pcache_info = NULL; 1729 int i, j, k; 1730 int ct = 0; 1731 unsigned int cu_processor_id; 1732 int ret; 1733 unsigned int num_cu_shared; 1734 struct kfd_cu_info cu_info; 1735 struct kfd_cu_info *pcu_info; 1736 int gpu_processor_id; 1737 struct kfd_cache_properties *props_ext; 1738 int num_of_entries = 0; 1739 int num_of_cache_types = 0; 1740 struct kfd_gpu_cache_info cache_info[KFD_MAX_CACHE_TYPES]; 1741 1742 amdgpu_amdkfd_get_cu_info(kdev->adev, &cu_info); 1743 pcu_info = &cu_info; 1744 1745 gpu_processor_id = dev->node_props.simd_id_base; 1746 1747 pcache_info = cache_info; 1748 num_of_cache_types = kfd_get_gpu_cache_info(kdev, &pcache_info); 1749 if (!num_of_cache_types) { 1750 pr_warn("no cache info found\n"); 1751 return; 1752 } 1753 1754 /* For each type of cache listed in the kfd_gpu_cache_info table, 1755 * go through all available Compute Units. 1756 * The [i,j,k] loop will 1757 * if kfd_gpu_cache_info.num_cu_shared = 1 1758 * will parse through all available CU 1759 * If (kfd_gpu_cache_info.num_cu_shared != 1) 1760 * then it will consider only one CU from 1761 * the shared unit 1762 */ 1763 for (ct = 0; ct < num_of_cache_types; ct++) { 1764 cu_processor_id = gpu_processor_id; 1765 if (pcache_info[ct].cache_level == 1) { 1766 for (i = 0; i < pcu_info->num_shader_engines; i++) { 1767 for (j = 0; j < pcu_info->num_shader_arrays_per_engine; j++) { 1768 for (k = 0; k < pcu_info->num_cu_per_sh; k += pcache_info[ct].num_cu_shared) { 1769 1770 ret = fill_in_l1_pcache(&props_ext, pcache_info, pcu_info, 1771 pcu_info->cu_bitmap[i % 4][j + i / 4], ct, 1772 cu_processor_id, k); 1773 1774 if (ret < 0) 1775 break; 1776 1777 if (!ret) { 1778 num_of_entries++; 1779 list_add_tail(&props_ext->list, &dev->cache_props); 1780 } 1781 1782 /* Move to next CU block */ 1783 num_cu_shared = ((k + pcache_info[ct].num_cu_shared) <= 1784 pcu_info->num_cu_per_sh) ? 1785 pcache_info[ct].num_cu_shared : 1786 (pcu_info->num_cu_per_sh - k); 1787 cu_processor_id += num_cu_shared; 1788 } 1789 } 1790 } 1791 } else { 1792 ret = fill_in_l2_l3_pcache(&props_ext, pcache_info, 1793 pcu_info, ct, cu_processor_id); 1794 1795 if (ret < 0) 1796 break; 1797 1798 if (!ret) { 1799 num_of_entries++; 1800 list_add_tail(&props_ext->list, &dev->cache_props); 1801 } 1802 } 1803 } 1804 dev->node_props.caches_count += num_of_entries; 1805 pr_debug("Added [%d] GPU cache entries\n", num_of_entries); 1806 } 1807 -- 0-DAY CI Kernel Test Service https://01.org/lkp