Hi Dan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 0af2f6be1b4281385b618cb86ad946eded089ac8]
url: https://github.com/intel-lab-lkp/linux/commits/Dan-Williams/x86-devmem-Remov... base: 0af2f6be1b4281385b618cb86ad946eded089ac8 patch link: https://lore.kernel.org/r/174491712829.1395340.5054725417641299524.stgit%40d... patch subject: [PATCH v3 2/2] x86/devmem: Drop /dev/mem access for confidential guests config: arm-randconfig-004-20250418 (https://download.01.org/0day-ci/archive/20250418/202504180754.vQCz7zWh-lkp@i...) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250418/202504180754.vQCz7zWh-lkp@i...)
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/202504180754.vQCz7zWh-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/char/mem.c:604:6: error: call to undeclared function 'cc_platform_has'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
604 | cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) | ^
drivers/char/mem.c:604:22: error: use of undeclared identifier 'CC_ATTR_GUEST_MEM_ENCRYPT'
604 | cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) | ^ 2 errors generated.
vim +/cc_platform_has +604 drivers/char/mem.c
586 587 static int open_port(struct inode *inode, struct file *filp) 588 { 589 int rc; 590 591 if (!capable(CAP_SYS_RAWIO)) 592 return -EPERM; 593 594 rc = security_locked_down(LOCKDOWN_DEV_MEM); 595 if (rc) 596 return rc; 597 598 /* 599 * Enforce encrypted mapping consistency and avoid unaccepted 600 * memory conflicts, "lockdown" /dev/mem for confidential 601 * guests. 602 */ 603 if (IS_ENABLED(CONFIG_STRICT_DEVMEM) &&
604 cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
605 return -EPERM; 606 607 if (iminor(inode) != DEVMEM_MINOR) 608 return 0; 609 610 /* 611 * Use a unified address space to have a single point to manage 612 * revocations when drivers want to take over a /dev/mem mapped 613 * range. 614 */ 615 filp->f_mapping = iomem_get_mapping(); 616 617 return 0; 618 } 619