Linux IOMMU Development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Steve Sistare <steven.sistare@oracle.com>, iommu@lists.linux.dev
Cc: oe-kbuild-all@lists.linux.dev, Jason Gunthorpe <jgg@nvidia.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Nicolin Chen <nicolinc@nvidia.com>,
	Steve Sistare <steven.sistare@oracle.com>
Subject: Re: [PATCH V4 6/9] iommufd: pfn reader for file mappings
Date: Sun, 20 Oct 2024 02:41:57 +0800	[thread overview]
Message-ID: <202410200205.mriS8xuS-lkp@intel.com> (raw)
In-Reply-To: <1729286856-127844-7-git-send-email-steven.sistare@oracle.com>

Hi Steve,

kernel test robot noticed the following build errors:

[auto build test ERROR on e2d8fe9148b79ed1cbf0663edc988db7769173dc]

url:    https://github.com/intel-lab-lkp/linux/commits/Steve-Sistare/mm-gup-folio_add_pins/20241019-053644
base:   e2d8fe9148b79ed1cbf0663edc988db7769173dc
patch link:    https://lore.kernel.org/r/1729286856-127844-7-git-send-email-steven.sistare%40oracle.com
patch subject: [PATCH V4 6/9] iommufd: pfn reader for file mappings
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241020/202410200205.mriS8xuS-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241020/202410200205.mriS8xuS-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/202410200205.mriS8xuS-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/iommu/iommufd/pages.c: In function 'pfn_reader_user_pin':
>> drivers/iommu/iommufd/pages.c:886:46: error: passing argument 1 of 'temp_kmalloc' from incompatible pointer type [-Wincompatible-pointer-types]
     886 |                 user->ufolios = temp_kmalloc(&user->ufolios_len, NULL, 0);
         |                                              ^~~~~~~~~~~~~~~~~~
         |                                              |
         |                                              long unsigned int *
   drivers/iommu/iommufd/pages.c:74:35: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'long unsigned int *'
      74 | static void *temp_kmalloc(size_t *size, void *backup, size_t backup_len)
         |                           ~~~~~~~~^~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [m]:
   - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +/temp_kmalloc +886 drivers/iommu/iommufd/pages.c

   859	
   860	static int pfn_reader_user_pin(struct pfn_reader_user *user,
   861				       struct iopt_pages *pages,
   862				       unsigned long start_index,
   863				       unsigned long last_index)
   864	{
   865		bool remote_mm = pages->source_mm != current->mm;
   866		unsigned long npages = last_index - start_index + 1;
   867		unsigned long start;
   868		unsigned long unum;
   869		uintptr_t uptr;
   870		long rc;
   871	
   872		if (IS_ENABLED(CONFIG_IOMMUFD_TEST) &&
   873		    WARN_ON(last_index < start_index))
   874			return -EINVAL;
   875	
   876		if (!user->file && !user->upages) {
   877			/* All undone in pfn_reader_destroy() */
   878			user->upages_len = npages * sizeof(*user->upages);
   879			user->upages = temp_kmalloc(&user->upages_len, NULL, 0);
   880			if (!user->upages)
   881				return -ENOMEM;
   882		}
   883	
   884		if (user->file && !user->ufolios) {
   885			user->ufolios_len = npages * sizeof(*user->ufolios);
 > 886			user->ufolios = temp_kmalloc(&user->ufolios_len, NULL, 0);
   887			if (!user->ufolios)
   888				return -ENOMEM;
   889		}
   890	
   891		if (user->locked == -1) {
   892			/*
   893			 * The majority of usages will run the map task within the mm
   894			 * providing the pages, so we can optimize into
   895			 * get_user_pages_fast()
   896			 */
   897			if (!user->file && remote_mm) {
   898				if (!mmget_not_zero(pages->source_mm))
   899					return -EFAULT;
   900			}
   901			user->locked = 0;
   902		}
   903	
   904		unum = user->file ? user->ufolios_len / sizeof(*user->ufolios) :
   905				    user->upages_len / sizeof(*user->upages);
   906		npages = min_t(unsigned long, npages, unum);
   907	
   908		if (iommufd_should_fail())
   909			return -EFAULT;
   910	
   911		if (user->file) {
   912			start = pages->start + (start_index * PAGE_SIZE);
   913			rc = pin_memfd_pages(user, start, npages);
   914		} else if (!remote_mm) {
   915			uptr = (uintptr_t)(pages->uptr + start_index * PAGE_SIZE);
   916			rc = pin_user_pages_fast(uptr, npages, user->gup_flags,
   917						 user->upages);
   918		} else {
   919			uptr = (uintptr_t)(pages->uptr + start_index * PAGE_SIZE);
   920			if (!user->locked) {
   921				mmap_read_lock(pages->source_mm);
   922				user->locked = 1;
   923			}
   924			rc = pin_user_pages_remote(pages->source_mm, uptr, npages,
   925						   user->gup_flags, user->upages,
   926						   &user->locked);
   927		}
   928		if (rc <= 0) {
   929			if (WARN_ON(!rc))
   930				return -EFAULT;
   931			return rc;
   932		}
   933		iopt_pages_add_npinned(pages, rc);
   934		user->upages_start = start_index;
   935		user->upages_end = start_index + rc;
   936		return 0;
   937	}
   938	

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

  reply	other threads:[~2024-10-19 18:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 21:27 [PATCH V4 0/9] iommu_ioas_map_file Steve Sistare
2024-10-18 21:27 ` [PATCH V4 1/9] mm/gup: folio_add_pins Steve Sistare
2024-10-18 21:27 ` [PATCH V4 2/9] iommufd: rename uptr in iopt_alloc_iova Steve Sistare
2024-10-22 18:32   ` Nicolin Chen
2024-10-18 21:27 ` [PATCH V4 3/9] iommufd: generalize iopt_pages address Steve Sistare
2024-10-22 18:38   ` Nicolin Chen
2024-10-18 21:27 ` [PATCH V4 4/9] iommufd: pfn reader local variables Steve Sistare
2024-10-18 21:27 ` [PATCH V4 5/9] iommufd: folio subroutines Steve Sistare
2024-10-21 17:30   ` Jason Gunthorpe
2024-10-22 13:26     ` Steven Sistare
2024-10-18 21:27 ` [PATCH V4 6/9] iommufd: pfn reader for file mappings Steve Sistare
2024-10-19 18:41   ` kernel test robot [this message]
2024-10-21 17:32   ` Jason Gunthorpe
2024-10-18 21:27 ` [PATCH V4 7/9] iommufd: IOMMU_IOAS_MAP_FILE Steve Sistare
2024-10-21 17:34   ` Jason Gunthorpe
2024-10-18 21:27 ` [PATCH V4 8/9] iommufd: file mappings for mdev Steve Sistare
2024-10-18 21:27 ` [PATCH V4 9/9] iommufd: map file selftest Steve Sistare
2024-10-18 22:51   ` Nicolin Chen
2024-10-22 13:27     ` Steven Sistare

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=202410200205.mriS8xuS-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=nicolinc@nvidia.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=steven.sistare@oracle.com \
    /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