Content-Type: multipart/mixed; boundary="===============4425893616031561411==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v7 1/4] sgl_alloc_order: remove 4 GiB limit Date: Tue, 01 Feb 2022 21:46:18 +0800 Message-ID: <202202012125.JGVcLupw-lkp@intel.com> In-Reply-To: <20220201034915.183117-2-dgilbert@interlog.com> List-Id: --===============4425893616031561411== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Douglas, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.17-rc2 next-20220131] [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] url: https://github.com/0day-ci/linux/commits/Douglas-Gilbert/scatterlis= t-add-new-capabilities/20220201-115047 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = 26291c54e111ff6ba87a164d85d4a4e134b7315c config: i386-randconfig-a003-20220131 (https://download.01.org/0day-ci/arch= ive/20220201/202202012125.JGVcLupw-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=3D1 build): # https://github.com/0day-ci/linux/commit/be1e80a043970c400c00709be= 739ab26f931331a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Douglas-Gilbert/scatterlist-add-ne= w-capabilities/20220201-115047 git checkout be1e80a043970c400c00709be739ab26f931331a # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): ld: lib/scatterlist.o: in function `sgl_alloc_order': >> lib/scatterlist.c:612: undefined reference to `__udivdi3' vim +612 lib/scatterlist.c 586 = 587 /** 588 * sgl_alloc_order - allocate a scatterlist with equally sized eleme= nts each 589 * of which has 2^@order continuous pages 590 * @length: Length in bytes of the scatterlist. Must be at least one 591 * @order: Second argument for alloc_pages(). Each sgl element size= will 592 * be (PAGE_SIZE*2^@order) bytes. @order must not exceed 16. 593 * @chainable: Whether or not to allocate an extra element in the sc= atterlist 594 * for scatterlist chaining purposes 595 * @gfp: Memory allocation flags 596 * @nent_p: [out] Number of entries in the scatterlist that have pag= es. 597 * Ignored if @nent_p is NULL. 598 * 599 * Returns: A pointer to an initialized scatterlist or %NULL upon fa= ilure. 600 */ 601 struct scatterlist *sgl_alloc_order(unsigned long long length, 602 unsigned int order, bool chainable, 603 gfp_t gfp, unsigned int *nent_p) 604 { 605 struct scatterlist *sgl, *sg; 606 struct page *page; 607 unsigned int nent, nalloc; 608 u32 elem_len; 609 = 610 if (length >> (PAGE_SHIFT + order) >=3D UINT_MAX) 611 return NULL; > 612 nent =3D DIV_ROUND_UP(length, PAGE_SIZE << order); 613 = 614 if (chainable) { 615 if (check_add_overflow(nent, 1U, &nalloc)) 616 return NULL; 617 } else { 618 nalloc =3D nent; 619 } 620 sgl =3D kmalloc_array(nalloc, sizeof(struct scatterlist), 621 gfp & ~GFP_DMA); 622 if (!sgl) 623 return NULL; 624 = 625 sg_init_table(sgl, nalloc); 626 sg =3D sgl; 627 while (length) { 628 elem_len =3D min_t(u64, length, PAGE_SIZE << order); 629 page =3D alloc_pages(gfp, order); 630 if (!page) { 631 sgl_free_order(sgl, order); 632 return NULL; 633 } 634 = 635 sg_set_page(sg, page, elem_len, 0); 636 length -=3D elem_len; 637 sg =3D sg_next(sg); 638 } 639 WARN_ONCE(length, "length =3D %lld\n", length); 640 if (nent_p) 641 *nent_p =3D nent; 642 return sgl; 643 } 644 EXPORT_SYMBOL(sgl_alloc_order); 645 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org --===============4425893616031561411==--