All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Michal Camacho Romero <michal.camacho.romero@linux.intel.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Thomas Gleixner <tglx@kernel.org>, Ning Sun <ning.sun@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Michal Camacho Romero <michal.camacho.romero@intel.com>,
	x86@kernel.org, iommu@lists.linux.dev,
	tboot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Mateusz Mowka <mateusz.mowka@intel.com>,
	Adam Pawlicki <adamx.pawlicki@intel.com>,
	Pawel Randzio <pawel.randzio@intel.com>
Subject: Re: [PATCH v7 1/2] x86/tboot: Add support for parsing DTPR table and disabling TPRs
Date: Fri, 30 Oct 2026 20:22:10 +0800	[thread overview]
Message-ID: <202610302057.2LOBfy3p-lkp@intel.com> (raw)
In-Reply-To: <8549af9ea60b73e120be377877c26d929f1ad25e.1793273244.git.michal.camacho.romero@linux.intel.com>

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@intel.com/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@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/202610302057.2LOBfy3p-lkp@intel.com/

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

  parent reply	other threads:[~2026-10-30 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 11:57 [PATCH v7 0/2] x86/tboot: Add Intel TXT Protection Regions (TPR) support Michal Camacho Romero
2026-10-29 11:57 ` [PATCH v7 1/2] x86/tboot: Add support for parsing DTPR table and disabling TPRs Michal Camacho Romero
2026-10-30  4:59   ` Borislav Petkov
2026-10-30 12:22   ` kernel test robot [this message]
2026-10-29 11:57 ` [PATCH v7 2/2] iommu/vt-d: Disable TXT TPRs before enabling queued invalidation Michal Camacho Romero
  -- strict thread matches above, loose matches on Subject: below --
2026-10-27 16:13 [PATCH v6 1/2] x86/tboot: Add support for parsing DTPR table and disabling TPRs Sun, Ning
2026-10-29 13:40 ` [PATCH v7 " Michal Camacho Romero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202610302057.2LOBfy3p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=adamx.pawlicki@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mateusz.mowka@intel.com \
    --cc=michal.camacho.romero@intel.com \
    --cc=michal.camacho.romero@linux.intel.com \
    --cc=ning.sun@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pawel.randzio@intel.com \
    --cc=tboot-devel@lists.sourceforge.net \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.