Re: [PATCH v3 2/3] swiotlb: dma: its: Enforce host page-size alignment for shared buffers

Aneesh Kumar K.V
2026-03-23T13:52:53Z

kernel test robot <lkp@intel.com> writes:

> Hi Aneesh,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on arm64/for-next/core]
> [also build test ERROR on tip/irq/core arm/for-next arm/fixes kvmarm/next soc/for-next linus/master v7.0-rc3 next-20260306]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Aneesh-Kumar-K-V-Arm/dma-direct-swiotlb-handle-swiotlb-alloc-free-outside-__dma_direct_alloc_pages/20260309-182834
> base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
> patch link: https://lore.kernel.org/r/20260309102625.2315725-3-aneesh.kumar%40kernel.org
> patch subject: [PATCH v3 2/3] swiotlb: dma: its: Enforce host page-size alignment for shared buffers
> config: i386-randconfig-012-20260309 (https://download.01.org/0day-ci/archive/20260309/202603092320.JgtItJg0-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260309/202603092320.JgtItJg0-lkp@intel.com/reproduce)
>
> 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/202603092320.JgtItJg0-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> In file included from arch/x86/kernel/asm-offsets.c:9:
> In file included from include/linux/crypto.h:15:
> In file included from include/linux/completion.h:12:
> In file included from include/linux/swait.h:7:
> In file included from include/linux/spinlock.h:59:
> In file included from include/linux/irqflags.h:18:
> In file included from arch/x86/include/asm/irqflags.h:5:
> In file included from arch/x86/include/asm/processor-flags.h:6:
>>> include/linux/mem_encrypt.h:60:9: error: use of undeclared identifier 'PAGE_SIZE'
> 60 | return PAGE_SIZE;
> | ^
>>> include/linux/mem_encrypt.h:66:9: error: call to undeclared function 'ALIGN'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 66 | return ALIGN(size, mem_decrypt_granule_size());
> | ^
>

Fixed this by including

modified include/linux/mem_encrypt.h
@@ -11,6 +11,8 @@
#define __MEM_ENCRYPT_H__

#ifndef __ASSEMBLY__
+#include <linux/align.h>
+#include <vdso/page.h>

#ifdef CONFIG_ARCH_HAS_MEM_ENCRYPT

Will include this in the next patch update.

The other alternative is to switch that to a macro

modified include/linux/mem_encrypt.h
@@ -55,16 +55,10 @@
#endif

#ifndef mem_decrypt_granule_size
-static inline size_t mem_decrypt_granule_size(void)
-{
- return PAGE_SIZE;
-}
+#define mem_decrypt_granule_size() PAGE_SIZE
#endif

-static inline size_t mem_decrypt_align(size_t size)
-{
- return ALIGN(size, mem_decrypt_granule_size());
-}
+#define mem_decrypt_align(size) ALIGN((size), mem_decrypt_granule_size())