All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC][PATCH 1/2] Add a layer of abstraction to use the memory reserved by device tree for ima buffer pass.
Date: Tue, 05 May 2020 22:44:17 +0800	[thread overview]
Message-ID: <202005052224.sdlTIk7L%lkp@intel.com> (raw)
In-Reply-To: <20200504203829.6330-2-prsriva@linux.microsoft.com>

[-- Attachment #1: Type: text/plain, Size: 16147 bytes --]

Hi Prakhar,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on robh/for-next powerpc/next v5.7-rc4 next-20200505]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Prakhar-Srivastava/Add-support-for-using-reserved-memory-for-ima-buffer-pass/20200505-184302
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: h8300-h8s-sim_defconfig (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=h8300 

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

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

   In file included from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
   drivers/of/of_ima.c: In function 'of_ima_write_buffer':
>> drivers/of/of_ima.c:47:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      47 |  (u64)vaddr, mem_res.start, resource_size(&mem_res));
         |  ^
   include/linux/printk.h:305:34: note: in definition of macro 'pr_info'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
>> include/linux/kern_levels.h:5:18: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:305:9: note: in expansion of macro 'KERN_INFO'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
>> drivers/of/of_ima.c:46:2: note: in expansion of macro 'pr_info'
      46 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n , size : %lld",
         |  ^~~~~~~
   drivers/of/of_ima.c:46:64: note: format string is defined here
      46 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n , size : %lld",
         |                                                            ~~~~^
         |                                                                |
         |                                                                long long unsigned int
         |                                                            %0X
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
>> include/linux/kern_levels.h:5:18: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:305:9: note: in expansion of macro 'KERN_INFO'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
>> drivers/of/of_ima.c:46:2: note: in expansion of macro 'pr_info'
      46 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n , size : %lld",
         |  ^~~~~~~
   drivers/of/of_ima.c:46:80: note: format string is defined here
      46 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n , size : %lld",
         |                                                                             ~~~^
         |                                                                                |
         |                                                                                long long int
         |                                                                             %d
   In file included from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
   drivers/of/of_ima.c: In function 'of_get_ima_buffer':
   drivers/of/of_ima.c:114:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     114 |  (u64)vaddr, mem_res.start, resource_size(&mem_res), *(size_t *)vaddr);
         |  ^
   include/linux/printk.h:305:34: note: in definition of macro 'pr_info'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
>> include/linux/kern_levels.h:5:18: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:305:9: note: in expansion of macro 'KERN_INFO'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/of/of_ima.c:113:2: note: in expansion of macro 'pr_info'
     113 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX,\n allocated size : %lld, ima_buffer_size: %ld ",
         |  ^~~~~~~
   drivers/of/of_ima.c:113:64: note: format string is defined here
     113 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX,\n allocated size : %lld, ima_buffer_size: %ld ",
         |                                                            ~~~~^
         |                                                                |
         |                                                                long long unsigned int
         |                                                            %0X
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/asm-generic/bug.h:19,
                    from arch/h8300/include/asm/bug.h:8,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:15,
                    from drivers/of/of_ima.c:6:
>> include/linux/kern_levels.h:5:18: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:305:9: note: in expansion of macro 'KERN_INFO'
     305 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/of/of_ima.c:113:2: note: in expansion of macro 'pr_info'
     113 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX,\n allocated size : %lld, ima_buffer_size: %ld ",
         |  ^~~~~~~
   drivers/of/of_ima.c:113:89: note: format string is defined here
     113 |  pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX,\n allocated size : %lld, ima_buffer_size: %ld ",
         |                                                                                      ~~~^
         |                                                                                         |
         |                                                                                         long long int
         |                                                                                      %d
   drivers/of/of_ima.c: At top level:
>> drivers/of/of_ima.c:133:1: warning: data definition has no type or storage class
     133 | MODULE_DEVICE_TABLE(of, ima_buffer_pass_match);
         | ^~~~~~~~~~~~~~~~~~~
>> drivers/of/of_ima.c:133:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
>> drivers/of/of_ima.c:133:1: warning: parameter names (without types) in function declaration
   drivers/of/of_ima.c:164:1: warning: data definition has no type or storage class
     164 | module_init(ima_buffer_pass_init);
         | ^~~~~~~~~~~
>> drivers/of/of_ima.c:164:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]
   drivers/of/of_ima.c:164:1: warning: parameter names (without types) in function declaration
   drivers/of/of_ima.c:165:1: warning: data definition has no type or storage class
     165 | module_exit(ima_buffer_pass_exit);
         | ^~~~~~~~~~~
>> drivers/of/of_ima.c:165:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int]
   drivers/of/of_ima.c:165:1: warning: parameter names (without types) in function declaration
   drivers/of/of_ima.c:135:19: warning: 'ima_buffer_pass_init' defined but not used [-Wunused-function]
     135 | static int __init ima_buffer_pass_init(void)
         |                   ^~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +133 drivers/of/of_ima.c

    29	
    30	/**
    31	 * of_ima_write_buffer - Write the ima buffer into the reserved memory.
    32	 *
    33	 * ima_buffer - buffer starting address.
    34	 * ima_buffer_size - size of segment.
    35	 *
    36	 * Return: 0 on success, negative errno on error.
    37	 */
    38	int of_ima_write_buffer(void *ima_buffer, size_t ima_buffer_size)
    39	{
    40		void *addr;
    41	
    42		if (!dtb_status_enabled)
    43			return -EOPNOTSUPP;
    44	
    45		vaddr = memremap(mem_res.start, resource_size(&mem_res), MEMREMAP_WB);
  > 46		pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n , size : %lld",
  > 47		(u64)vaddr, mem_res.start, resource_size(&mem_res));
    48	
    49		if (vaddr) {
    50			memcpy(vaddr, &ima_buffer_size, sizeof(size_t));
    51			addr =  vaddr + sizeof(size_t);
    52			memcpy(addr, ima_buffer, ima_buffer_size);
    53			memunmap(vaddr);
    54			vaddr = NULL;
    55		}
    56	
    57		return 0;
    58	}
    59	
    60	/**
    61	 * of_remove_ima_buffer - Write 0(Zero length buffer to read)to the
    62	 *                        size location of the buffer.
    63	 *
    64	 * Return: 0 on success, negative errno on error.
    65	 */
    66	int of_remove_ima_buffer(void)
    67	{
    68		size_t empty_buffer_size = 0;
    69	
    70		if (!dtb_status_enabled)
    71			return -ENOTSUPP;
    72	
    73		if (vaddr) {
    74			memcpy(vaddr, &empty_buffer_size, sizeof(size_t));
    75			memunmap(vaddr);
    76			vaddr = NULL;
    77		}
    78	
    79		return 0;
    80	}
    81	
    82	/**
    83	 * of_ima_get_size_allocated - Get the usable buffer size thats allocated in
    84	 *                             the device-tree.
    85	 *
    86	 * Return: 0 on unavailable node, size of the memory block - (size_t)
    87	 */
    88	size_t of_ima_get_size_allocated(void)
    89	{
    90		size_t size = 0;
    91	
    92		if (!dtb_status_enabled)
    93			return size;
    94	
    95		size = resource_size(&mem_res) - sizeof(size_t);
    96		return size;
    97	}
    98	
    99	/**
   100	 * of_get_ima_buffer - Get IMA buffer address.
   101	 *
   102	 * @addr:       On successful return, set to point to the buffer contents.
   103	 * @size:       On successful return, set to the buffer size.
   104	 *
   105	 * Return: 0 on success, negative errno on error.
   106	 */
   107	int of_get_ima_buffer(void **addr, size_t *size)
   108	{
   109		if (!dtb_status_enabled)
   110			return -ENOTSUPP;
   111	
   112		vaddr = memremap(mem_res.start, resource_size(&mem_res), MEMREMAP_WB);
   113		pr_info("Mapped reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX,\n allocated size : %lld, ima_buffer_size: %ld ",
   114		(u64)vaddr, mem_res.start, resource_size(&mem_res), *(size_t *)vaddr);
   115	
   116		*size = *(size_t *)vaddr;
   117		*addr = vaddr + sizeof(size_t);
   118		return 0;
   119	}
   120	
   121	static const struct of_device_id ima_buffer_pass_ids[] = {
   122		{
   123			.compatible = "linux,ima_buffer_pass",
   124		},
   125		{}
   126	};
   127	
   128	static const struct of_device_id ima_buffer_pass_match[] = {
   129		{
   130			.name = "ima_buffer_pass",
   131		},
   132	};
 > 133	MODULE_DEVICE_TABLE(of, ima_buffer_pass_match);
   134	
   135	static int __init ima_buffer_pass_init(void)
   136	{
   137		int ret = 0;
   138		struct device_node *memnp;
   139		struct device_node *ima_buffer_pass_node;
   140	
   141		ima_buffer_pass_node = of_find_matching_node(NULL, ima_buffer_pass_ids);
   142		if (!ima_buffer_pass_node)
   143			return -ENOENT;
   144	
   145		memnp = of_parse_phandle(ima_buffer_pass_node, "memory-region", 0);
   146		if (!memnp)
   147			return -ENXIO;
   148	
   149		ret = of_address_to_resource(memnp, 0, &mem_res);
   150		if (ret < 0)
   151			return -ENOENT;
   152	
   153		of_node_put(memnp);
   154		dtb_status_enabled = true;
   155	
   156		return ret;
   157	}
   158	
   159	static void __exit ima_buffer_pass_exit(void)
   160	{
   161		pr_info("trying to exit the ima driver\n");
   162	}
   163	
 > 164	module_init(ima_buffer_pass_init);
 > 165	module_exit(ima_buffer_pass_exit);

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 5383 bytes --]

  parent reply	other threads:[~2020-05-05 14:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 20:38 [RFC][PATCH 0/2] Add support for using reserved memory for ima buffer pass Prakhar Srivastava
2020-05-04 20:38 ` Prakhar Srivastava
2020-05-04 20:38 ` Prakhar Srivastava
2020-05-04 20:38 ` [RFC][PATCH 1/2] Add a layer of abstraction to use the memory reserved by device tree " Prakhar Srivastava
2020-05-04 20:38   ` Prakhar Srivastava
2020-05-04 20:38   ` Prakhar Srivastava
2020-05-05 13:50   ` kbuild test robot
2020-05-05 14:44   ` kbuild test robot [this message]
2020-05-12 23:09   ` Rob Herring
2020-05-12 23:09     ` Rob Herring
2020-05-12 23:09     ` Rob Herring
2020-05-18 20:34     ` Prakhar Srivastava
2020-05-18 20:34       ` Prakhar Srivastava
2020-05-18 20:34       ` Prakhar Srivastava
2020-05-04 20:38 ` [RFC][PATCH 2/2] Add support for ima buffer pass using reserved memory arm64 Prakhar Srivastava
2020-05-04 20:38   ` Prakhar Srivastava
2020-05-04 20:38   ` Prakhar Srivastava
2020-05-05  9:59 ` [RFC][PATCH 0/2] Add support for using reserved memory for ima buffer pass Mark Rutland
2020-05-05  9:59   ` Mark Rutland
2020-05-05  9:59   ` Mark Rutland
2020-05-07  5:50   ` Prakhar Srivastava
2020-05-07  5:50     ` Prakhar Srivastava
2020-05-07  5:50     ` Prakhar Srivastava
2020-05-12 23:05     ` Rob Herring
2020-05-12 23:05       ` Rob Herring
2020-05-12 23:05       ` Rob Herring
2020-05-18 20:16       ` Prakhar Srivastava
2020-05-18 20:16         ` Prakhar Srivastava
2020-05-18 20:16         ` Prakhar Srivastava
2020-05-23  4:08         ` Thiago Jung Bauermann
2020-05-23  4:08           ` Thiago Jung Bauermann
2020-05-23  4:08           ` Thiago Jung Bauermann
2020-06-01  4:05           ` Prakhar Srivastava
2020-06-01  4:05             ` Prakhar Srivastava
2020-06-01  4:05             ` Prakhar Srivastava
  -- strict thread matches above, loose matches on Subject: below --
2020-05-01 18:15 Prakhar Srivastava
2020-05-01 18:15 ` [RFC]{PATCH 1/2] Add a layer of abstraction to use the memory reserved by device tree " Prakhar Srivastava

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=202005052224.sdlTIk7L%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.