Re: [PATCH v7 1/2] x86/tboot: Add support for parsing DTPR table and disabling TPRs

From: kernel test robot

Date: Fri Oct 30 2026 - 08:23:41 EST


Hi Michal,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/master]
[also build test WARNING on tip/x86/core linus/master v7.3 next-20261029]
[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/Michal-Camacho-Romero/x86-tboot-Add-support-for-parsing-DTPR-table-and-disabling-TPRs/20261029-125726
base: tip/master
patch link: https://lore.kernel.org/r/8549af9ea60b73e120be377877c26d929f1ad25e.1793273244.git.michal.camacho.romero%40linux.intel.com
patch subject: [PATCH v7 1/2] x86/tboot: Add support for parsing DTPR table and disabling TPRs
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20261030/202610302057.2LOBfy3p-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261030/202610302057.2LOBfy3p-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610302057.2LOBfy3p-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

arch/x86/kernel/tboot.c: In function 'tboot_check_txt_heap_section_bounds':
>> arch/x86/kernel/tboot.c:253:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
253 | if ((u64)heap_section > heap_end || heap_end - (u64)heap_section < 8) {
| ^
arch/x86/kernel/tboot.c:253:56: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
253 | if ((u64)heap_section > heap_end || heap_end - (u64)heap_section < 8) {
| ^
arch/x86/kernel/tboot.c:266:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
266 | if (*heap_section_size > heap_end - (u64)heap_section) {
| ^
arch/x86/kernel/tboot.c: In function 'tboot_get_dtpr_table':
arch/x86/kernel/tboot.c:699:31: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
699 | if (heap_size == 0 || (u64)txt_heap + heap_size < (u64)txt_heap) {
| ^
arch/x86/kernel/tboot.c:699:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
699 | if (heap_size == 0 || (u64)txt_heap + heap_size < (u64)txt_heap) {
| ^
arch/x86/kernel/tboot.c:704:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
704 | heap_end = (u64)txt_heap + heap_size;
| ^
arch/x86/kernel/tboot.c: In function 'tboot_check_tprs':
arch/x86/kernel/tboot.c:862:40: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Wimplicit-function-declaration]
862 | tpr_base_val = readq(base);
| ^~~~~
| readl
In file included from include/asm-generic/bug.h:31,
from arch/x86/include/asm/bug.h:195,
from arch/x86/include/asm/alternative.h:9,
from arch/x86/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/rcupdate.h:25,
from include/linux/init_task.h:5,
from arch/x86/kernel/tboot.c:9:
>> include/linux/kern_levels.h:5:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:483:25: note: in definition of macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:584:9: note: in expansion of macro 'printk'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:14:25: note: in expansion of macro 'KERN_SOH'
14 | #define KERN_INFO KERN_SOH "6" /* informational */
| ^~~~~~~~
include/linux/printk.h:584:16: note: in expansion of macro 'KERN_INFO'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~
arch/x86/kernel/tboot.c:863:25: note: in expansion of macro 'pr_info'
863 | pr_info("TPR instance %u, TPR %u:base 0x%llx, limit 0x%llx\n", i, j,
| ^~~~~~~
arch/x86/kernel/tboot.c: In function 'tboot_disable_tprs':
>> include/linux/kern_levels.h:5:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:483:25: note: in definition of macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:584:9: note: in expansion of macro 'printk'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:14:25: note: in expansion of macro 'KERN_SOH'
14 | #define KERN_INFO KERN_SOH "6" /* informational */
| ^~~~~~~~
include/linux/printk.h:584:16: note: in expansion of macro 'KERN_INFO'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~
arch/x86/kernel/tboot.c:936:25: note: in expansion of macro 'pr_info'
936 | pr_info("TPR instance %u, TPR %u:base 0x%llx, limit 0x%llx\n", i, j,
| ^~~~~~~
arch/x86/kernel/tboot.c:941:33: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Wimplicit-function-declaration]
941 | writeq(tpr_base_val | TPR_BASE_DISABLE_BIT, base);
| ^~~~~~
| writel


vim +253 arch/x86/kernel/tboot.c

235
236 static bool tboot_check_txt_heap_section_bounds(const u64 heap_end,
237 void *heap_section,
238 u64 *heap_section_size,
239 const char *section_name)
240 {
241 if (!heap_section) {
242 pr_err("%s section is NULL\n", section_name);
243 return false;
244 }
245
246 if (!heap_section_size) {
247 pr_err("%s section size pointer is NULL\n", section_name);
248 return false;
249 }
250
251 *heap_section_size = 0;
252
> 253 if ((u64)heap_section > heap_end || heap_end - (u64)heap_section < 8) {
254 pr_err("%s size field exceeds heap boundary\n", section_name);
255 return false;
256 }
257
258 /* Read the size of the current TXT Heap section */
259 *heap_section_size = *(u64 __force *)heap_section;
260
261 if (*heap_section_size < 8) {
262 pr_err("%s size is too small\n", section_name);
263 return false;
264 }
265
266 if (*heap_section_size > heap_end - (u64)heap_section) {
267 pr_err("%s exceeds heap boundary\n", section_name);
268 return false;
269 }
270
271 return true;
272 }
273

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki