LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [intel-tdx:kvm 23/181] arch/x86/kernel/cpu/tdx/tdmr-sysmem.c:39:7: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast
@ 2021-08-31 17:12 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-31 17:12 UTC (permalink / raw)
  To: Kai Huang; +Cc: kbuild-all, linux-kernel, Isaku Yamahata

[-- Attachment #1: Type: text/plain, Size: 3202 bytes --]

tree:   https://github.com/intel/tdx.git kvm
head:   0c7944582999466d6d979000c4c11a62b78f5472
commit: 8d0a6f4d22c62fbc7a98efda46e1146c218a59a0 [23/181] x86/cpu/tdx: Implement PAMT allocation for system memory
config: x86_64-buildonly-randconfig-r001-20210831 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel/tdx/commit/8d0a6f4d22c62fbc7a98efda46e1146c218a59a0
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx kvm
        git checkout 8d0a6f4d22c62fbc7a98efda46e1146c218a59a0
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/tdx/tdmr-sysmem.c: In function 'sysmem_pamt_alloc':
   arch/x86/kernel/cpu/tdx/tdmr-sysmem.c:39:9: error: implicit declaration of function 'alloc_contig_pages' [-Werror=implicit-function-declaration]
      39 |  page = alloc_contig_pages(nr_pages, GFP_KERNEL, tmb->nid,
         |         ^~~~~~~~~~~~~~~~~~
>> arch/x86/kernel/cpu/tdx/tdmr-sysmem.c:39:7: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      39 |  page = alloc_contig_pages(nr_pages, GFP_KERNEL, tmb->nid,
         |       ^
   arch/x86/kernel/cpu/tdx/tdmr-sysmem.c:42:8: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      42 |   page = alloc_contig_pages(nr_pages, GFP_KERNEL, tmb->nid,
         |        ^
   cc1: some warnings being treated as errors


vim +39 arch/x86/kernel/cpu/tdx/tdmr-sysmem.c

    18	
    19	/*
    20	 * Using alloc_contig_pages() to allocate PAMT for system memory, instead of
    21	 * memblock_phys_alloc_range(), because PAMT allocation needs to happen after
    22	 * all TDMR ranges are finalized after *all* TDX memory blocks from *all* types
    23	 * are added to final TDX memory instance.  This is because PAMT size depends
    24	 * on TDMR ranges, or final TDMRs, which depends on both CMR info, and TDX
    25	 * module info such as maximum TDMR number, etc.  The other reason is PAMT size
    26	 * also depends on TDX module info, specifically, PAMT entry sizes.  Therefore
    27	 * PAMT allocation must happen after TDX module is loaded, which happens during
    28	 * or after smp_init(), at which point memblock APIs don't work anymore.
    29	 *
    30	 * TODO:
    31	 *
    32	 * Allocate one big PAMT pool for each node, and divide?
    33	 */
    34	static unsigned long __init sysmem_pamt_alloc(struct tdx_memblock *tmb,
    35			unsigned long nr_pages)
    36	{
    37		struct page *page;
    38	
  > 39		page = alloc_contig_pages(nr_pages, GFP_KERNEL, tmb->nid,
    40				NULL);
    41		if (!page)
    42			page = alloc_contig_pages(nr_pages, GFP_KERNEL, tmb->nid,
    43					&node_online_map);
    44	
    45		return page ? page_to_pfn(page) : 0;
    46	}
    47	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37935 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-31 17:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 17:12 [intel-tdx:kvm 23/181] arch/x86/kernel/cpu/tdx/tdmr-sysmem.c:39:7: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).