mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kai Huang <kai.huang@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Isaku Yamahata <isaku.yamahata@intel.com>
Subject: [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
Date: Wed, 1 Sep 2021 01:12:45 +0800	[thread overview]
Message-ID: <202109010138.nCcDuh5A-lkp@intel.com> (raw)

[-- 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 --]

                 reply	other threads:[~2021-08-31 17:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202109010138.nCcDuh5A-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®