Re: [PATCH 1/1] drm/ttm: Set memory as decrypted for ttm framebuffer mappings

From: kbuild test robot
Date: Thu Aug 23 2018 - 02:49:11 EST


Hi Jiandi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18 next-20180822]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Jiandi-An/drm-ttm-Set-memory-as-decrypted-for-ttm-framebuffer-mappings/20180823-113546
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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
GCC_VERSION=7.2.0 make.cross ARCH=arm64

All errors (new ones prefixed by >>):

drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap':
>> drivers/gpu/drm/ttm/ttm_bo_util.c:644:15: error: implicit declaration of function 'sev_active'; did you mean 'cpu_active'? [-Werror=implicit-function-declaration]
if (!ret && sev_active())
^~~~~~~~~~
cpu_active
>> drivers/gpu/drm/ttm/ttm_bo_util.c:645:4: error: implicit declaration of function 'set_memory_decrypted'; did you mean 'set_memory_valid'? [-Werror=implicit-function-declaration]
set_memory_decrypted((unsigned long) map->virtual,
^~~~~~~~~~~~~~~~~~~~
set_memory_valid
drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
>> drivers/gpu/drm/ttm/ttm_bo_util.c:670:4: error: implicit declaration of function 'set_memory_encrypted'; did you mean 'set_memory_valid'? [-Werror=implicit-function-declaration]
set_memory_encrypted((unsigned long) map->virtual,
^~~~~~~~~~~~~~~~~~~~
set_memory_valid
cc1: some warnings being treated as errors

vim +644 drivers/gpu/drm/ttm/ttm_bo_util.c

617
618 int ttm_bo_kmap(struct ttm_buffer_object *bo,
619 unsigned long start_page, unsigned long num_pages,
620 struct ttm_bo_kmap_obj *map)
621 {
622 struct ttm_mem_type_manager *man =
623 &bo->bdev->man[bo->mem.mem_type];
624 unsigned long offset, size;
625 int ret;
626
627 map->virtual = NULL;
628 map->bo = bo;
629 if (num_pages > bo->num_pages)
630 return -EINVAL;
631 if (start_page > bo->num_pages)
632 return -EINVAL;
633 #if 0
634 if (num_pages > 1 && !capable(CAP_SYS_ADMIN))
635 return -EPERM;
636 #endif
637 (void) ttm_mem_io_lock(man, false);
638 ret = ttm_mem_io_reserve(bo->bdev, &bo->mem);
639 ttm_mem_io_unlock(man);
640 if (ret)
641 return ret;
642 if (!bo->mem.bus.is_iomem) {
643 ret = ttm_bo_kmap_ttm(bo, start_page, num_pages, map);
> 644 if (!ret && sev_active())
> 645 set_memory_decrypted((unsigned long) map->virtual,
646 num_pages);
647 return ret;
648 } else {
649 offset = start_page << PAGE_SHIFT;
650 size = num_pages << PAGE_SHIFT;
651 return ttm_bo_ioremap(bo, offset, size, map);
652 }
653 }
654 EXPORT_SYMBOL(ttm_bo_kmap);
655
656 void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
657 {
658 struct ttm_buffer_object *bo = map->bo;
659 struct ttm_mem_type_manager *man =
660 &bo->bdev->man[bo->mem.mem_type];
661
662 if (!map->virtual)
663 return;
664 switch (map->bo_kmap_type) {
665 case ttm_bo_map_iomap:
666 iounmap(map->virtual);
667 break;
668 case ttm_bo_map_vmap:
669 if (sev_active())
> 670 set_memory_encrypted((unsigned long) map->virtual,
671 bo->num_pages);
672 vunmap(map->virtual);
673 break;
674 case ttm_bo_map_kmap:
675 if (sev_active())
676 set_memory_encrypted((unsigned long) map->virtual, 1);
677 kunmap(map->page);
678 break;
679 case ttm_bo_map_premapped:
680 break;
681 default:
682 BUG();
683 }
684 (void) ttm_mem_io_lock(man, false);
685 ttm_mem_io_free(map->bo->bdev, &map->bo->mem);
686 ttm_mem_io_unlock(man);
687 map->virtual = NULL;
688 map->page = NULL;
689 }
690 EXPORT_SYMBOL(ttm_bo_kunmap);
691

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip