* [freescale-fslc:pr/485 13126/15145] drivers/firmware/imx/s400-api.c:455:17: error: implicit declaration of function '__cpuc_flush_dcache_area'
@ 2021-11-10 1:51 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-10 1:51 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7737 bytes --]
Hi Pankaj,
FYI, the error/warning still remains.
tree: https://github.com/Freescale/linux-fslc pr/485
head: 3ff8c24dfb1fc13343e3e0bc54344b213b5a618b
commit: b57b8221587134978fbcd522e87aab6f44fea710 [13126/15145] s4muap arm: fix for compilation issue.
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 11.2.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://github.com/Freescale/linux-fslc/commit/b57b8221587134978fbcd522e87aab6f44fea710
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/485
git checkout b57b8221587134978fbcd522e87aab6f44fea710
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/firmware/imx/s400-api.c:245:16: warning: no previous prototype for 'imx_soc_device_register' [-Wmissing-prototypes]
245 | struct device *imx_soc_device_register(void)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/imx/s400-api.c: In function 's4_muap_ioctl_img_auth_cmd_handler':
drivers/firmware/imx/s400-api.c:446:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
446 | memcpy((void *)img->dst, (const void *)(img->offset + phdr),
| ^
>> drivers/firmware/imx/s400-api.c:455:17: error: implicit declaration of function '__cpuc_flush_dcache_area' [-Werror=implicit-function-declaration]
455 | __cpuc_flush_dcache_area((void *) s, e);
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/__cpuc_flush_dcache_area +455 drivers/firmware/imx/s400-api.c
338
339 static int s4_muap_ioctl_get_info(struct s4_mu_device_ctx *dev_ctx,
340 unsigned long arg)
341 {
342 struct imx_s400_api *s400_muap_priv = dev_ctx->s400_muap_priv;
343 struct s4_read_info info;
344
345 int ret = -EINVAL;
346
347 ret = (int)copy_from_user(&info, (u8 *)arg,
348 sizeof(info));
349 if (ret) {
350 devctx_err(dev_ctx, "Fail copy shared memory config to user\n");
351 ret = -EFAULT;
352 goto exit;
353 }
354
355 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
356 (info.cmd_id << 16) |
357 (info.size << 8) |
358 S400_VERSION;
359
360 ret = imx_s400_api_call(s400_muap_priv, (void *) &info.resp);
361 if (ret) {
362 devctx_err(dev_ctx, "%s: imx_s400_api_call failed for cmd [0x%x]\n",
363 __func__, info.cmd_id);
364 ret = -EIO;
365 }
366
367 ret = (int)copy_to_user((u8 *)arg, &info,
368 sizeof(info));
369 if (ret) {
370 devctx_err(dev_ctx, "Failed to copy iobuff setup to user\n");
371 ret = -EFAULT;
372 }
373
374 exit:
375 return ret;
376 }
377 static int s4_muap_ioctl_img_auth_cmd_handler(struct s4_mu_device_ctx *dev_ctx,
378 unsigned long arg)
379 {
380 struct imx_s400_api *s400_muap_priv = dev_ctx->s400_muap_priv;
381 struct s4_muap_auth_image s4_muap_auth_image;
382 struct container_hdr *phdr = &s4_muap_auth_image.chdr;
383 struct image_info *img = &s4_muap_auth_image.img_info[0];
384 unsigned long base_addr = (unsigned long) &s4_muap_auth_image;
385
386 int i;
387 u16 length;
388 unsigned long s, e;
389 int ret = -EINVAL;
390
391 /* Check if not already configured. */
392 if (dev_ctx->secure_mem.dma_addr != 0u) {
393 devctx_err(dev_ctx, "Shared memory not configured\n");
394 goto exit;
395 }
396
397 ret = (int)copy_from_user(&s4_muap_auth_image, (u8 *)arg,
398 sizeof(s4_muap_auth_image));
399 if (ret) {
400 devctx_err(dev_ctx, "Fail copy shared memory config to user\n");
401 ret = -EFAULT;
402 goto exit;
403 }
404
405
406 if (!IS_ALIGNED(base_addr, 4)) {
407 devctx_err(dev_ctx, "Error: Image's address is not 4 byte aligned\n");
408 return -EINVAL;
409 }
410
411 if (phdr->tag != 0x87 && phdr->version != 0x0) {
412 devctx_err(dev_ctx, "Error: Wrong container header\n");
413 return -EFAULT;
414 }
415
416 if (!phdr->num_images) {
417 devctx_err(dev_ctx, "Error: Wrong container, no image found\n");
418 return -EFAULT;
419 }
420 length = phdr->length_lsb + (phdr->length_msb << 8);
421
422 devctx_dbg(dev_ctx, "container length %u\n", length);
423
424 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
425 (S400_OEM_CNTN_AUTH_REQ << 16) |
426 (S400_OEM_CNTN_AUTH_REQ_SIZE << 8) |
427 S400_VERSION;
428 s400_muap_priv->tx_msg.data[0] = ((u32)(((base_addr) >> 16) >> 16));
429 s400_muap_priv->tx_msg.data[1] = ((u32)(base_addr));
430
431 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
432 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
433 devctx_err(dev_ctx, "Error: Container Authentication failed.\n");
434 ret = -EIO;
435 goto exit;
436 }
437
438 /* Copy images to dest address */
439 for (i = 0; i < phdr->num_images; i++) {
440 img = img + i;
441
442 //devctx_dbg(dev_ctx, "img %d, dst 0x%x, src 0x%lux, size 0x%x\n",
443 // i, (u32) img->dst,
444 // (unsigned long)img->offset + phdr, img->size);
445
446 memcpy((void *)img->dst, (const void *)(img->offset + phdr),
447 img->size);
448
449 s = img->dst & ~(CACHELINE_SIZE - 1);
450 e = ALIGN(img->dst + img->size, CACHELINE_SIZE) - 1;
451
452 #ifdef CONFIG_ARM64
453 __flush_dcache_area((void *) s, e);
454 #else
> 455 __cpuc_flush_dcache_area((void *) s, e);
456 #endif
457 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
458 (S400_VERIFY_IMAGE_REQ << 16) |
459 (S400_VERIFY_IMAGE_REQ_SIZE << 8) |
460 S400_VERSION;
461 s400_muap_priv->tx_msg.data[0] = 1 << i;
462 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
463 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
464 devctx_err(dev_ctx, "Error: Image Verification failed.\n");
465 ret = -EIO;
466 goto exit;
467 }
468 }
469
470 exit:
471 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
472 (S400_RELEASE_CONTAINER_REQ << 16) |
473 (S400_RELEASE_CONTAINER_REQ_SIZE << 8) |
474 S400_VERSION;
475 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
476 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
477 devctx_err(dev_ctx, "Error: Release Container failed.\n");
478 ret = -EIO;
479 }
480
481 ret = (int)copy_to_user((u8 *)arg, &s4_muap_auth_image,
482 sizeof(s4_muap_auth_image));
483 if (ret) {
484 devctx_err(dev_ctx, "Failed to copy iobuff setup to user\n");
485 ret = -EFAULT;
486 }
487 return ret;
488 }
489
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 68544 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-10 1:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 1:51 [freescale-fslc:pr/485 13126/15145] drivers/firmware/imx/s400-api.c:455:17: error: implicit declaration of function '__cpuc_flush_dcache_area' 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.