All of lore.kernel.org
 help / color / mirror / Atom feed
* [opencloudos:linux-5.4/lts/5.4.119-20.0009.spr 2441/2441] drivers/iommu/intel/debugfs.c:650:13: error: redefinition of 'latency_show_one'
@ 2025-01-24 16:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-01-24 16:45 UTC (permalink / raw)
  To: kaixuxia, frankjpliu, kasong, sagazchen, kernelxing, aurelianliu,
	deshengwu, flyingpeng, jingqunli, jason.zeng, lin.x.wang,
	yingbao.jia, pei.p.jia
  Cc: oe-kbuild-all

tree:   https://gitee.com/OpenCloudOS/OpenCloudOS-Kernel.git linux-5.4/lts/5.4.119-20.0009.spr
head:   f1811f6442501fe34d2339158aed4f85a64f0398
commit: 589132a513fbf4f1c0b7627cda829e7bba9e7e5f [2441/2441] iommu/vt-d: Expose latency monitor data through debugfs
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250125/202501250033.JDGWG9ls-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/202501250033.JDGWG9ls-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/202501250033.JDGWG9ls-lkp@intel.com/

Note: the opencloudos/linux-5.4/lts/5.4.119-20.0009.spr HEAD f1811f6442501fe34d2339158aed4f85a64f0398 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from arch/x86/include/asm/bug.h:6,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/debugfs.h:15,
                    from drivers/iommu/intel/debugfs.c:11:
   include/linux/instrumentation.h:8: warning: "instrumentation_begin" redefined
       8 | #define instrumentation_begin() ({                                      \
         | 
   In file included from include/linux/export.h:42,
                    from include/linux/linkage.h:7,
                    from include/linux/fs.h:5:
   include/linux/compiler.h:139: note: this is the location of the previous definition
     139 | #define instrumentation_begin() ({                                      \
         | 
   drivers/iommu/intel/debugfs.c: In function 'dmar_perf_latency_write':
   drivers/iommu/intel/debugfs.c:591:13: error: implicit declaration of function 'copy_from_user'; did you mean 'copy_from_user_page'? [-Werror=implicit-function-declaration]
     591 |         if (copy_from_user(&buf, ubuf, cnt))
         |             ^~~~~~~~~~~~~~
         |             copy_from_user_page
   drivers/iommu/intel/debugfs.c: At top level:
>> drivers/iommu/intel/debugfs.c:650:13: error: redefinition of 'latency_show_one'
     650 | static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
         |             ^~~~~~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:545:13: note: previous definition of 'latency_show_one' with type 'void(struct seq_file *, struct intel_iommu *, struct dmar_drhd_unit *)'
     545 | static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
         |             ^~~~~~~~~~~~~~~~
>> drivers/iommu/intel/debugfs.c:666:12: error: redefinition of 'latency_show'
     666 | static int latency_show(struct seq_file *m, void *v)
         |            ^~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:561:12: note: previous definition of 'latency_show' with type 'int(struct seq_file *, void *)'
     561 | static int latency_show(struct seq_file *m, void *v)
         |            ^~~~~~~~~~~~
>> drivers/iommu/intel/debugfs.c:679:12: error: redefinition of 'dmar_perf_latency_open'
     679 | static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
         |            ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:574:12: note: previous definition of 'dmar_perf_latency_open' with type 'int(struct inode *, struct file *)'
     574 | static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
         |            ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/iommu/intel/debugfs.c:684:16: error: redefinition of 'dmar_perf_latency_write'
     684 | static ssize_t dmar_perf_latency_write(struct file *filp,
         |                ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:579:16: note: previous definition of 'dmar_perf_latency_write' with type 'ssize_t(struct file *, const char *, size_t,  loff_t *)' {aka 'long int(struct file *, const char *, long unsigned int,  long long int *)'}
     579 | static ssize_t dmar_perf_latency_write(struct file *filp,
         |                ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iommu/intel/debugfs.c:747:37: error: redefinition of 'dmar_perf_latency_fops'
     747 | static const struct file_operations dmar_perf_latency_fops = {
         |                                     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:642:37: note: previous definition of 'dmar_perf_latency_fops' with type 'const struct file_operations'
     642 | static const struct file_operations dmar_perf_latency_fops = {
         |                                     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c: In function 'intel_iommu_debugfs_init':
>> drivers/iommu/intel/debugfs.c:774:36: error: 'qi_done_fops' undeclared (first use in this function)
     774 |                             NULL, &qi_done_fops);
         |                                    ^~~~~~~~~~~~
   drivers/iommu/intel/debugfs.c:774:36: note: each undeclared identifier is reported only once for each function it appears in
   drivers/iommu/intel/debugfs.c: At top level:
   drivers/iommu/intel/debugfs.c:642:37: warning: 'dmar_perf_latency_fops' defined but not used [-Wunused-const-variable=]
     642 | static const struct file_operations dmar_perf_latency_fops = {
         |                                     ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/latency_show_one +650 drivers/iommu/intel/debugfs.c

   544	
 > 545	static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
   546				     struct dmar_drhd_unit *drhd)
   547	{
   548		int ret;
   549	
   550		seq_printf(m, "IOMMU: %s Register Base Address: %llx\n",
   551			   iommu->name, drhd->reg_base_addr);
   552	
   553		ret = dmar_latency_snapshot(iommu, debug_buf, DEBUG_BUFFER_SIZE);
   554		if (ret < 0)
   555			seq_puts(m, "Failed to get latency snapshot");
   556		else
   557			seq_puts(m, debug_buf);
   558		seq_puts(m, "\n");
   559	}
   560	
 > 561	static int latency_show(struct seq_file *m, void *v)
   562	{
   563		struct dmar_drhd_unit *drhd;
   564		struct intel_iommu *iommu;
   565	
   566		rcu_read_lock();
   567		for_each_active_iommu(iommu, drhd)
   568			latency_show_one(m, iommu, drhd);
   569		rcu_read_unlock();
   570	
   571		return 0;
   572	}
   573	
 > 574	static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
   575	{
   576		return single_open(filp, latency_show, NULL);
   577	}
   578	
   579	static ssize_t dmar_perf_latency_write(struct file *filp,
   580					       const char __user *ubuf,
   581					       size_t cnt, loff_t *ppos)
   582	{
   583		struct dmar_drhd_unit *drhd;
   584		struct intel_iommu *iommu;
   585		int counting;
   586		char buf[64];
   587	
   588		if (cnt > 63)
   589			cnt = 63;
   590	
 > 591		if (copy_from_user(&buf, ubuf, cnt))
   592			return -EFAULT;
   593	
   594		buf[cnt] = 0;
   595	
   596		if (kstrtoint(buf, 0, &counting))
   597			return -EINVAL;
   598	
   599		switch (counting) {
   600		case 0:
   601			rcu_read_lock();
   602			for_each_active_iommu(iommu, drhd) {
   603				dmar_latency_disable(iommu, DMAR_LATENCY_INV_IOTLB);
   604				dmar_latency_disable(iommu, DMAR_LATENCY_INV_DEVTLB);
   605				dmar_latency_disable(iommu, DMAR_LATENCY_INV_IEC);
   606				dmar_latency_disable(iommu, DMAR_LATENCY_PRQ);
   607			}
   608			rcu_read_unlock();
   609			break;
   610		case 1:
   611			rcu_read_lock();
   612			for_each_active_iommu(iommu, drhd)
   613				dmar_latency_enable(iommu, DMAR_LATENCY_INV_IOTLB);
   614			rcu_read_unlock();
   615			break;
   616		case 2:
   617			rcu_read_lock();
   618			for_each_active_iommu(iommu, drhd)
   619				dmar_latency_enable(iommu, DMAR_LATENCY_INV_DEVTLB);
   620			rcu_read_unlock();
   621			break;
   622		case 3:
   623			rcu_read_lock();
   624			for_each_active_iommu(iommu, drhd)
   625				dmar_latency_enable(iommu, DMAR_LATENCY_INV_IEC);
   626			rcu_read_unlock();
   627			break;
   628		case 4:
   629			rcu_read_lock();
   630			for_each_active_iommu(iommu, drhd)
   631				dmar_latency_enable(iommu, DMAR_LATENCY_PRQ);
   632			rcu_read_unlock();
   633			break;
   634		default:
   635			return -EINVAL;
   636		}
   637	
   638		*ppos += cnt;
   639		return cnt;
   640	}
   641	
   642	static const struct file_operations dmar_perf_latency_fops = {
   643		.open		= dmar_perf_latency_open,
   644		.write		= dmar_perf_latency_write,
   645		.read		= seq_read,
   646		.llseek		= seq_lseek,
   647		.release	= single_release,
   648	};
   649	
 > 650	static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
   651				     struct dmar_drhd_unit *drhd)
   652	{
   653		int ret;
   654	
   655		seq_printf(m, "IOMMU: %s Register Base Address: %llx\n",
   656			   iommu->name, drhd->reg_base_addr);
   657	
   658		ret = dmar_latency_snapshot(iommu, debug_buf, DEBUG_BUFFER_SIZE);
   659		if (ret < 0)
   660			seq_printf(m, "Failed to get latency snapshot");
   661		else
   662			seq_puts(m, debug_buf);
   663		seq_puts(m, "\n");
   664	}
   665	
 > 666	static int latency_show(struct seq_file *m, void *v)
   667	{
   668		struct dmar_drhd_unit *drhd;
   669		struct intel_iommu *iommu;
   670	
   671		rcu_read_lock();
   672		for_each_active_iommu(iommu, drhd)
   673			latency_show_one(m, iommu, drhd);
   674		rcu_read_unlock();
   675	
   676		return 0;
   677	}
   678	
 > 679	static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
   680	{
   681		return single_open(filp, latency_show, NULL);
   682	}
   683	
 > 684	static ssize_t dmar_perf_latency_write(struct file *filp,
   685					       const char __user *ubuf,
   686					       size_t cnt, loff_t *ppos)
   687	{
   688		struct dmar_drhd_unit *drhd;
   689		struct intel_iommu *iommu;
   690		int counting;
   691		char buf[64];
   692	
   693		if (cnt > 63)
   694			cnt = 63;
   695	
   696		if (copy_from_user(&buf, ubuf, cnt))
   697			return -EFAULT;
   698	
   699		buf[cnt] = 0;
   700	
   701		if (kstrtoint(buf, 0, &counting))
   702			return -EINVAL;
   703	
   704		switch (counting) {
   705		case 0:
   706			rcu_read_lock();
   707			for_each_active_iommu(iommu, drhd) {
   708				dmar_latency_disable(iommu, DMAR_LATENCY_INV_IOTLB);
   709				dmar_latency_disable(iommu, DMAR_LATENCY_INV_DEVTLB);
   710				dmar_latency_disable(iommu, DMAR_LATENCY_INV_IEC);
   711				dmar_latency_disable(iommu, DMAR_LATENCY_PRQ);
   712			}
   713			rcu_read_unlock();
   714			break;
   715		case 1:
   716			rcu_read_lock();
   717			for_each_active_iommu(iommu, drhd)
   718				dmar_latency_enable(iommu, DMAR_LATENCY_INV_IOTLB);
   719			rcu_read_unlock();
   720			break;
   721		case 2:
   722			rcu_read_lock();
   723			for_each_active_iommu(iommu, drhd)
   724				dmar_latency_enable(iommu, DMAR_LATENCY_INV_DEVTLB);
   725			rcu_read_unlock();
   726			break;
   727		case 3:
   728			rcu_read_lock();
   729			for_each_active_iommu(iommu, drhd)
   730				dmar_latency_enable(iommu, DMAR_LATENCY_INV_IEC);
   731			rcu_read_unlock();
   732			break;
   733		case 4:
   734			rcu_read_lock();
   735			for_each_active_iommu(iommu, drhd)
   736				dmar_latency_enable(iommu, DMAR_LATENCY_PRQ);
   737			rcu_read_unlock();
   738			break;
   739		default:
   740			return -EINVAL;
   741		}
   742	
   743		*ppos += cnt;
   744		return cnt;
   745	}
   746	
 > 747	static const struct file_operations dmar_perf_latency_fops = {
   748		.open		= dmar_perf_latency_open,
   749		.write		= dmar_perf_latency_write,
   750		.read		= seq_read,
   751		.llseek		= seq_lseek,
   752		.release	= single_release,
   753	};
   754	
   755	void __init intel_iommu_debugfs_init(void)
   756	{
   757		struct dentry *intel_iommu_debug = debugfs_create_dir("intel",
   758							iommu_debugfs_dir);
   759	
   760		debugfs_create_file("iommu_regset", 0444, intel_iommu_debug, NULL,
   761				    &iommu_regset_fops);
   762		debugfs_create_file("dmar_translation_struct", 0444, intel_iommu_debug,
   763				    NULL, &dmar_translation_struct_fops);
   764		debugfs_create_file("domain_translation_struct", 0444,
   765				    intel_iommu_debug, NULL,
   766				    &domain_translation_struct_fops);
   767		debugfs_create_file("invalidation_queue", 0444, intel_iommu_debug,
   768				    NULL, &invalidation_queue_fops);
   769	#ifdef CONFIG_IRQ_REMAP
   770		debugfs_create_file("ir_translation_struct", 0444, intel_iommu_debug,
   771				    NULL, &ir_translation_struct_fops);
   772	#endif
   773		debugfs_create_file("qi_done", 0644, intel_iommu_debug,
 > 774				    NULL, &qi_done_fops);

-- 
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:[~2025-01-24 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 16:45 [opencloudos:linux-5.4/lts/5.4.119-20.0009.spr 2441/2441] drivers/iommu/intel/debugfs.c:650:13: error: redefinition of 'latency_show_one' 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.