Linux-csky Archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Guo Ren <guoren@kernel.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Mike Rapoport <rppt@kernel.org>, Rich Felker <dalias@libc.org>,
	Russell King <linux@armlinux.org.uk>,
	Will Deacon <will@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Zi Yan <ziy@nvidia.com>,
	linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-m68k@lists.linux-m68k.org, linux-sh@vger.kernel.org,
	linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org,
	sparclinux@vger.kernel.org
Subject: Re: [PATCH 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER
Date: Fri, 24 Mar 2023 01:11:39 +0800	[thread overview]
Message-ID: <202303240155.01y6T6Fj-lkp@intel.com> (raw)
In-Reply-To: <20230323092156.2545741-3-rppt@kernel.org>

Hi Mike,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on 51551d71edbc998fd8c8afa7312db3d270f5998e]

url:    https://github.com/intel-lab-lkp/linux/commits/Mike-Rapoport/arm-reword-ARCH_FORCE_MAX_ORDER-prompt-and-help-text/20230323-172512
base:   51551d71edbc998fd8c8afa7312db3d270f5998e
patch link:    https://lore.kernel.org/r/20230323092156.2545741-3-rppt%40kernel.org
patch subject: [PATCH 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER
config: arm64-randconfig-r031-20230322 (https://download.01.org/0day-ci/archive/20230324/202303240155.01y6T6Fj-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/0522f943c071abf1610651ea40405b7489c50987
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Mike-Rapoport/arm-reword-ARCH_FORCE_MAX_ORDER-prompt-and-help-text/20230323-172512
        git checkout 0522f943c071abf1610651ea40405b7489c50987
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/iommu/ kernel/dma/ mm/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303240155.01y6T6Fj-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> mm/memory.c:5791:37: warning: shift count is negative [-Wshift-count-negative]
           if (unlikely(pages_per_huge_page > MAX_ORDER_NR_PAGES)) {
                                              ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                             ^
   include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
                           ______r = __builtin_expect(!!(x), expect);      \
                                                         ^
>> mm/memory.c:5791:37: warning: shift count is negative [-Wshift-count-negative]
           if (unlikely(pages_per_huge_page > MAX_ORDER_NR_PAGES)) {
                                              ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/compiler.h:48:68: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                                                        ^
   include/linux/compiler.h:35:19: note: expanded from macro '__branch_check__'
                                                expect, is_constant);      \
                                                        ^~~~~~~~~~~
   mm/memory.c:5843:37: warning: shift count is negative [-Wshift-count-negative]
           if (unlikely(pages_per_huge_page > MAX_ORDER_NR_PAGES)) {
                                              ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                             ^
   include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
                           ______r = __builtin_expect(!!(x), expect);      \
                                                         ^
   mm/memory.c:5843:37: warning: shift count is negative [-Wshift-count-negative]
           if (unlikely(pages_per_huge_page > MAX_ORDER_NR_PAGES)) {
                                              ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/compiler.h:48:68: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                                                        ^
   include/linux/compiler.h:35:19: note: expanded from macro '__branch_check__'
                                                expect, is_constant);      \
                                                        ^~~~~~~~~~~
   4 warnings generated.
--
>> drivers/iommu/dma-iommu.c:739:16: error: anonymous bit-field has negative width (-1)
           order_mask &= GENMASK(MAX_ORDER, 0);
                         ^
   include/linux/bits.h:37:3: note: expanded from macro 'GENMASK'
           (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
            ^
   include/linux/bits.h:23:3: note: expanded from macro 'GENMASK_INPUT_CHECK'
           (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
            ^
   include/linux/build_bug.h:16:53: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
                                                       ^
>> drivers/iommu/dma-iommu.c:739:16: warning: shift count >= width of type [-Wshift-count-overflow]
           order_mask &= GENMASK(MAX_ORDER, 0);
                         ^~~~~~~~~~~~~~~~~~~~~
   include/linux/bits.h:37:31: note: expanded from macro 'GENMASK'
           (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
                                        ^~~~~~~~~~~~~~~
   include/linux/bits.h:35:11: note: expanded from macro '__GENMASK'
            (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
                    ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.
--
>> kernel/dma/pool.c:197:39: warning: shift count is negative [-Wshift-count-negative]
                   pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
                                                       ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/minmax.h:126:59: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                                                   ^
   include/linux/minmax.h:37:12: note: expanded from macro '__careful_cmp'
                   __cmp(x, y, op), \
                            ^
   include/linux/minmax.h:28:34: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                                    ^
>> kernel/dma/pool.c:197:39: warning: shift count is negative [-Wshift-count-negative]
                   pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
                                                       ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/minmax.h:126:59: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                                                   ^
   include/linux/minmax.h:37:12: note: expanded from macro '__careful_cmp'
                   __cmp(x, y, op), \
                            ^
   include/linux/minmax.h:28:46: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                                                ^
>> kernel/dma/pool.c:197:39: warning: shift count is negative [-Wshift-count-negative]
                   pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
                                                       ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:33:31: note: expanded from macro 'MAX_ORDER_NR_PAGES'
   #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER)
                                 ^  ~~~~~~~~~
   include/linux/minmax.h:126:59: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                                                   ^
   include/linux/minmax.h:38:17: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                                 ^
   include/linux/minmax.h:32:25: note: expanded from macro '__cmp_once'
                   typeof(y) unique_y = (y);               \
                                         ^
   3 warnings generated.


vim +739 drivers/iommu/dma-iommu.c

0db2e5d18f76a6 Robin Murphy        2015-10-01  732  
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  733  static struct page **__iommu_dma_alloc_pages(struct device *dev,
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  734  		unsigned int count, unsigned long order_mask, gfp_t gfp)
0db2e5d18f76a6 Robin Murphy        2015-10-01  735  {
0db2e5d18f76a6 Robin Murphy        2015-10-01  736  	struct page **pages;
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  737  	unsigned int i = 0, nid = dev_to_node(dev);
3b6b7e19e31a81 Robin Murphy        2016-04-13  738  
98d56389a5e38b Kirill A. Shutemov  2023-03-15 @739  	order_mask &= GENMASK(MAX_ORDER, 0);
3b6b7e19e31a81 Robin Murphy        2016-04-13  740  	if (!order_mask)
3b6b7e19e31a81 Robin Murphy        2016-04-13  741  		return NULL;
0db2e5d18f76a6 Robin Murphy        2015-10-01  742  
ab6f4b001c8c72 Gustavo A. R. Silva 2021-09-28  743  	pages = kvcalloc(count, sizeof(*pages), GFP_KERNEL);
0db2e5d18f76a6 Robin Murphy        2015-10-01  744  	if (!pages)
0db2e5d18f76a6 Robin Murphy        2015-10-01  745  		return NULL;
0db2e5d18f76a6 Robin Murphy        2015-10-01  746  
0db2e5d18f76a6 Robin Murphy        2015-10-01  747  	/* IOMMU can map any pages, so himem can also be used here */
0db2e5d18f76a6 Robin Murphy        2015-10-01  748  	gfp |= __GFP_NOWARN | __GFP_HIGHMEM;
0db2e5d18f76a6 Robin Murphy        2015-10-01  749  
0db2e5d18f76a6 Robin Murphy        2015-10-01  750  	while (count) {
0db2e5d18f76a6 Robin Murphy        2015-10-01  751  		struct page *page = NULL;
3b6b7e19e31a81 Robin Murphy        2016-04-13  752  		unsigned int order_size;
0db2e5d18f76a6 Robin Murphy        2015-10-01  753  
0db2e5d18f76a6 Robin Murphy        2015-10-01  754  		/*
0db2e5d18f76a6 Robin Murphy        2015-10-01  755  		 * Higher-order allocations are a convenience rather
0db2e5d18f76a6 Robin Murphy        2015-10-01  756  		 * than a necessity, hence using __GFP_NORETRY until
3b6b7e19e31a81 Robin Murphy        2016-04-13  757  		 * falling back to minimum-order allocations.
0db2e5d18f76a6 Robin Murphy        2015-10-01  758  		 */
a706e6e10225fb Kirill A. Shutemov  2023-03-15  759  		for (order_mask &= GENMASK(__fls(count), 0);
3b6b7e19e31a81 Robin Murphy        2016-04-13  760  		     order_mask; order_mask &= ~order_size) {
3b6b7e19e31a81 Robin Murphy        2016-04-13  761  			unsigned int order = __fls(order_mask);
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  762  			gfp_t alloc_flags = gfp;
3b6b7e19e31a81 Robin Murphy        2016-04-13  763  
3b6b7e19e31a81 Robin Murphy        2016-04-13  764  			order_size = 1U << order;
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  765  			if (order_mask > order_size)
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  766  				alloc_flags |= __GFP_NORETRY;
c4b17afb0a4e8d Ganapatrao Kulkarni 2018-11-30  767  			page = alloc_pages_node(nid, alloc_flags, order);
0db2e5d18f76a6 Robin Murphy        2015-10-01  768  			if (!page)
0db2e5d18f76a6 Robin Murphy        2015-10-01  769  				continue;
4604393ca0c6e4 Robin Murphy        2020-09-03  770  			if (order)
0db2e5d18f76a6 Robin Murphy        2015-10-01  771  				split_page(page, order);
0db2e5d18f76a6 Robin Murphy        2015-10-01  772  			break;
0db2e5d18f76a6 Robin Murphy        2015-10-01  773  		}
0db2e5d18f76a6 Robin Murphy        2015-10-01  774  		if (!page) {
0db2e5d18f76a6 Robin Murphy        2015-10-01  775  			__iommu_dma_free_pages(pages, i);
0db2e5d18f76a6 Robin Murphy        2015-10-01  776  			return NULL;
0db2e5d18f76a6 Robin Murphy        2015-10-01  777  		}
3b6b7e19e31a81 Robin Murphy        2016-04-13  778  		count -= order_size;
3b6b7e19e31a81 Robin Murphy        2016-04-13  779  		while (order_size--)
0db2e5d18f76a6 Robin Murphy        2015-10-01  780  			pages[i++] = page++;
0db2e5d18f76a6 Robin Murphy        2015-10-01  781  	}
0db2e5d18f76a6 Robin Murphy        2015-10-01  782  	return pages;
0db2e5d18f76a6 Robin Murphy        2015-10-01  783  }
0db2e5d18f76a6 Robin Murphy        2015-10-01  784  

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

  parent reply	other threads:[~2023-03-23 17:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  9:21 [PATCH 00/14] arch,mm: cleanup Kconfig entries for ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 01/14] arm: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23  9:21 ` [PATCH 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23 10:15   ` Catalin Marinas
2023-03-23 10:37     ` Mike Rapoport
2023-03-23 11:57       ` Zi Yan
2023-03-23 13:46   ` kernel test robot
2023-03-23 17:11   ` kernel test robot [this message]
2023-03-23  9:21 ` [PATCH 03/14] arm64: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23 10:30   ` Catalin Marinas
2023-03-23  9:21 ` [PATCH 04/14] csky: drop ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 05/14] ia64: don't allow users to override ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 06/14] m68k: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23 16:24   ` Geert Uytterhoeven
2023-03-23  9:21 ` [PATCH 07/14] nios2: " Mike Rapoport
2023-03-23  9:21 ` [PATCH 08/14] nios2: drop ranges for definition of ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 09/14] powerpc: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23  9:21 ` [PATCH 10/14] powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 11/14] sh: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23  9:21 ` [PATCH 12/14] sh: drop ranges for definition of ARCH_FORCE_MAX_ORDER Mike Rapoport
2023-03-23  9:21 ` [PATCH 13/14] sparc: reword ARCH_FORCE_MAX_ORDER prompt and help text Mike Rapoport
2023-03-23  9:21 ` [PATCH 14/14] xtensa: " Mike Rapoport
2023-03-23  9:39   ` Max Filippov
2023-03-23 10:17 ` [PATCH 00/14] arch,mm: cleanup Kconfig entries for ARCH_FORCE_MAX_ORDER Kirill A. Shutemov

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=202303240155.01y6T6Fj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dalias@libc.org \
    --cc=dinguyen@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=guoren@kernel.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=mpe@ellerman.id.au \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rppt@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    --cc=ziy@nvidia.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).