lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202110121647.vjcpVKTk-lkp@intel.com>
Date:   Tue, 12 Oct 2021 16:12:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Marc Bonnici <marc.bonnici@....com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Sudeep Holla <sudeep.holla@....com>
Subject: [sudeep-holla:ffa_el3_spmc 7/7]
 drivers/firmware/arm_ffa_test/test_driver_ffa.c:431:1: error: passing 'const
 struct ffa_driver *' to parameter of type 'struct ffa_driver *' discards
 qualifiers

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git ffa_el3_spmc
head:   39d86dc85a6f4c5d0f56e8e7ddd94296c1774460
commit: 39d86dc85a6f4c5d0f56e8e7ddd94296c1774460 [7/7] firmware: test_ffa: Add Test FFA driver
config: arm64-randconfig-r033-20211011 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f95d9c95bbf4cf662b9a181245fc6dcede39f590)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/commit/?id=39d86dc85a6f4c5d0f56e8e7ddd94296c1774460
        git remote add sudeep-holla https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git
        git fetch --no-tags sudeep-holla ffa_el3_spmc
        git checkout 39d86dc85a6f4c5d0f56e8e7ddd94296c1774460
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All error/warnings (new ones prefixed by >>):

>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:74:5: warning: no previous prototype for function 'check_status' [-Wmissing-prototypes]
   int check_status(int status, int test_id) {
       ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:74:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int check_status(int status, int test_id) {
   ^
   static 
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:150:52: warning: format specifies type 'unsigned long long' but the argument has type 'struct page *' [-Wformat]
                   pr_debug("Page: %d at 0x%llx (0x%llx)\n", index, virt_to_page(mem_region + (index*4096*2)),
                                           ~~~~                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:576:38: note: expanded from macro 'pr_debug'
           no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
                                       ~~~     ^~~~~~~~~~~
   include/linux/printk.h:132:17: note: expanded from macro 'no_printk'
                   printk(fmt, ##__VA_ARGS__);             \
                          ~~~    ^~~~~~~~~~~
   include/linux/printk.h:446:60: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                                                       ~~~    ^~~~~~~~~~~
   include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
                   _p_func(_fmt, ##__VA_ARGS__);                           \
                           ~~~~    ^~~~~~~~~~~
   arch/arm64/include/asm/memory.h:343:25: note: expanded from macro 'virt_to_page'
   #define virt_to_page(x) ({                                              \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:115:12: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
           const u32 magic_number = 42;
                     ^
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:84:6: warning: no previous prototype for function 'test_memory_send' [-Wmissing-prototypes]
   long test_memory_send(struct ffa_device *dev, bool share, bool fragmented)
        ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:84:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   long test_memory_send(struct ffa_device *dev, bool share, bool fragmented)
   ^
   static 
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:227:5: warning: no previous prototype for function 'relay_message' [-Wmissing-prototypes]
   int relay_message(u32 message, struct ffa_device *ffa_dev, ffa_partition_id_t target)
       ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:227:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int relay_message(u32 message, struct ffa_device *ffa_dev, ffa_partition_id_t target)
   ^
   static 
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:253:5: warning: no previous prototype for function 'echo_message' [-Wmissing-prototypes]
   int echo_message(u32 message, struct ffa_device *ffa_dev)
       ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:253:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int echo_message(u32 message, struct ffa_device *ffa_dev)
   ^
   static 
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:276:6: warning: no previous prototype for function 'run_test' [-Wmissing-prototypes]
   long run_test(int test_id){
        ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:276:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   long run_test(int test_id){
   ^
   static 
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:431:1: error: passing 'const struct ffa_driver *' to parameter of type 'struct ffa_driver *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
   module_ffa_driver(test_ffa_driver);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/arm_ffa.h:95:2: note: expanded from macro 'module_ffa_driver'
           module_driver(__ffa_driver, ffa_register, ffa_unregister)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device/driver.h:261:20: note: expanded from macro 'module_driver'
           return __register(&(__driver) , ##__VA_ARGS__); \
                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/arm_ffa.h:82:22: note: expanded from macro 'ffa_register'
           ffa_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
                               ^~~~~~
   include/linux/arm_ffa.h:47:44: note: passing argument to parameter 'driver' here
   int ffa_driver_register(struct ffa_driver *driver, struct module *owner,
                                              ^
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:431:1: error: passing 'const struct ffa_driver *' to parameter of type 'struct ffa_driver *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
   module_ffa_driver(test_ffa_driver);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/arm_ffa.h:95:2: note: expanded from macro 'module_ffa_driver'
           module_driver(__ffa_driver, ffa_register, ffa_unregister)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device/driver.h:266:15: note: expanded from macro 'module_driver'
           __unregister(&(__driver) , ##__VA_ARGS__); \
           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/arm_ffa.h:84:24: note: expanded from macro 'ffa_unregister'
           ffa_driver_unregister(driver)
                                 ^~~~~~
   include/linux/arm_ffa.h:49:47: note: passing argument to parameter 'driver' here
   void ffa_driver_unregister(struct ffa_driver *driver);
                                                 ^
>> drivers/firmware/arm_ffa_test/test_driver_ffa.c:433:5: warning: no previous prototype for function 'ff_a_test_init' [-Wmissing-prototypes]
   int ff_a_test_init(void)
       ^
   drivers/firmware/arm_ffa_test/test_driver_ffa.c:433:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int ff_a_test_init(void)
   ^
   static 
   8 warnings and 2 errors generated.


vim +431 drivers/firmware/arm_ffa_test/test_driver_ffa.c

   249	
   250	
   251	
   252	/* Test basic communication. Echo message back. */
 > 253	int echo_message(u32 message, struct ffa_device *ffa_dev)
   254	{
   255		int rc;
   256		struct ffa_send_direct_data data = { FF_A_ECHO_MESSAGE, message };
   257	
   258		if (ffa_dev == NULL) {
   259			return -1;
   260		}
   261	
   262		rc = ffa_ops->sync_send_receive(ffa_dev, &data);
   263		while (rc == -EBUSY) {
   264			pr_debug("DIR_REQ: Busy - Retrying...\n");
   265			rc = ffa_ops->sync_send_receive(ffa_dev, &data);
   266		}
   267	
   268		pr_debug("Echoed data: 0x%lx 0x%lx 0x%lx\n", data.data0, data.data1, data.data2);
   269		if (message != data.data0){
   270			pr_err("ERROR: Echo Test Case to %x Failed!: %lx\n", ffa_dev->vm_id, data.data0);
   271			return -1;
   272		}
   273		return 0;
   274	}
   275	
 > 276	long run_test(int test_id){
   277	
   278		long ret = -3;
   279	
   280		switch (test_id) {
   281		case FF_A_MEMORY_SHARE:
   282			ret = test_memory_send(sp_partition_dev, true, false);
   283			break;
   284		case FF_A_MEMORY_SHARE_FRAGMENTED:
   285			ret = test_memory_send(sp_partition_dev, true, true);
   286			break;
   287		case FF_A_MEMORY_LEND:
   288			ret = test_memory_send(sp_partition_dev, false, false);
   289			break;
   290		case FF_A_MEMORY_LEND_FRAGMENTED:
   291			ret = test_memory_send(sp_partition_dev, false, true);
   292			break;
   293		case FF_A_ECHO_MESSAGE:
   294			ret = echo_message(0xDEADBEEF, sp_partition_dev);
   295			break;
   296		case FF_A_RELAY_MESSAGE_EL3:
   297			ret = relay_message(0xDEADBEEF, sp_partition_dev, lsp_partition_id);
   298			break;
   299		default:
   300			ret = -2;
   301			break;
   302		}
   303		return ret;
   304	}
   305	
   306	long ff_a_test_ioctl(struct file *fd, unsigned int cmd, unsigned long arg)
   307	{
   308		long ret;
   309		int user_cmd = 0;
   310		int i;
   311		int failed = 0;
   312	
   313		ret = copy_from_user(&user_cmd, (void *)arg, 1);
   314		if(ret!=0)
   315		{
   316			pr_err("Failed to obtain data from userspaced\n");
   317			return -1;
   318		}
   319	
   320		/* Run individual test cases. */
   321		if (user_cmd != FF_A_RUN_ALL) {
   322			ret = run_test(user_cmd);
   323			if (ret == -2){
   324					pr_err("Invalid Test ID: %ld\n", ret);
   325					return 0;
   326				}
   327			else {
   328				check_status(ret, user_cmd);
   329			}
   330		}
   331		/* Run all tests at once. */
   332		else {
   333			for (i = 0; i < LAST; i++) {
   334				ret = run_test(i);
   335				if (ret == -2){
   336					// Ignore invalid test IDs.
   337					continue;
   338				}
   339				else {
   340					pr_info("Completed Test Case: %d\n", i);
   341					ret = check_status(ret, i);
   342					if (ret) {
   343						failed++;
   344						break;
   345					}
   346				}
   347			}
   348			pr_info("\n\n\n%d Tests Failed\n\n\n", failed);
   349		}
   350	
   351		pr_info("Exiting Test Application -  Total Failures: %d\n", failed);
   352		return 0;
   353	}
   354	
   355	static int device_driver_init(void)
   356	{
   357		struct class *cl;
   358		int rc;
   359	
   360		cl = class_create(THIS_MODULE, "ff_a_test");
   361		if (IS_ERR(cl))
   362			return PTR_ERR(cl);
   363	
   364		/* Create char device. */
   365		rc = register_chrdev(0, "FF_A_TEST", &fops);
   366	
   367		/* Create device file in the /dev directory. */
   368		device_create(cl, NULL, MKDEV(rc, 0),NULL, "FF_A_TEST_DEVICE");
   369	
   370		return rc;
   371	}
   372	
   373	static int ffa_test_driver_probe(struct ffa_device *ffa_dev)
   374	{
   375		pr_info("Initialising driver for Partition: 0x%x\n", ffa_dev->vm_id);
   376	
   377		/* Check if we've discovered the Logical SP ID. */
   378		if (IS_LOGICAL_SP_ID(ffa_dev->vm_id)) {
   379			pr_info("Found Logical SP with ID 0x%x\n", ffa_dev->vm_id);
   380			lsp_partition_id = ffa_dev->vm_id;
   381		}
   382		else if (IS_PHYSICAL_SP_ID(ffa_dev->vm_id)) {
   383			/* Store the discovered phyiscal partition ID.
   384			 * This is the partition we will interact directly with.
   385			 */
   386			sp_partition_id = ffa_dev->vm_id;
   387			sp_partition_dev = ffa_dev;
   388			pr_info("Found Physical SP with ID 0x%x\n", ffa_dev->vm_id);
   389		} else {
   390			pr_warn("Discovered unknown partition type.\n");
   391			return -1;
   392		}
   393	
   394	
   395		ffa_ops = ffa_dev_ops_get(ffa_dev);
   396		if (IS_ERR_OR_NULL(ffa_ops))
   397		{
   398			pr_err("Failed to obtain FFA ops %s:%d\n", __FILE__, __LINE__);
   399			return -1;
   400		}
   401	
   402		/* Only do this setup once */
   403		if (!device_driver_initalized) {
   404			device_driver_init();
   405			device_driver_initalized = true;
   406		}
   407	
   408		pr_info("FF-A test module init finalized\n");
   409		return 0;
   410	}
   411	
   412	static const struct of_device_id int_driver_id[] = {
   413		{ .compatible = "arm,ffa-1.0" },
   414		{},
   415	};
   416	
   417	static const struct ffa_device_id test_ffa_device_id[] = {
   418		/* Physical SP UUID - BE Format */
   419		{ UUID_INIT(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0) },
   420		/* Logical SP UUID - BE Format*/
   421		{ UUID_INIT(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0) },
   422		{}
   423	};
   424	
   425	static const struct ffa_driver test_ffa_driver = {
   426		.name = "test_ffa",
   427		.probe = ffa_test_driver_probe,
   428		.id_table = test_ffa_device_id,
   429	};
   430	
 > 431	module_ffa_driver(test_ffa_driver);
   432	
 > 433	int ff_a_test_init(void)
   434	{
   435		pr_debug("FF-A test module init\n");
   436		return 0;
   437	}
   438	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (39216 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ