lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202108290658.uxBZOo52-lkp@intel.com>
Date:   Sun, 29 Aug 2021 06:46:09 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [intel-tdx:guest 72/113] kernel/dma/direct.c:102:20: warning: shift
 count >= width of type

tree:   https://github.com/intel/tdx.git guest
head:   44e41606b85b08fad5378c876547f8557f835cf6
commit: 3ccbeb49c9e01c731e46e8238cd8851be8365c15 [72/113] x86/tdx: Add device filter support for x86 TDX guest platform
config: x86_64-randconfig-a001-20210829 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4e1a164d7bd53653f79decc121afe784d2fde0a7)
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
        # https://github.com/intel/tdx/commit/3ccbeb49c9e01c731e46e8238cd8851be8365c15
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx guest
        git checkout 3ccbeb49c9e01c731e46e8238cd8851be8365c15
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from kernel/dma/direct.c:7:
   In file included from include/linux/memblock.h:14:
   In file included from arch/x86/include/asm/dma.h:13:
   In file included from arch/x86/include/asm/io.h:43:
   In file included from include/linux/protected_guest.h:36:
   In file included from arch/x86/include/asm/protected_guest.h:16:
   arch/x86/include/asm/tdx.h:185:12: error: incomplete definition of type 'struct device'
           return dev->authorized;
                  ~~~^
   include/linux/bitmap.h:13:8: note: forward declaration of 'struct device'
   struct device;
          ^
>> kernel/dma/direct.c:102:20: warning: shift count >= width of type [-Wshift-count-overflow]
                       phys_limit < DMA_BIT_MASK(64) &&
                                    ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.


vim +102 kernel/dma/direct.c

95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09   77  
26749b3201ab05 kernel/dma/direct.c Christoph Hellwig      2020-06-15   78  static struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
3773dfe6ea4d22 kernel/dma/direct.c Christoph Hellwig      2020-08-17   79  		gfp_t gfp)
a8463d4b0e47d1 lib/dma-noop.c      Christian Borntraeger  2016-02-02   80  {
90ae409f9eb3bc kernel/dma/direct.c Christoph Hellwig      2019-08-20   81  	int node = dev_to_node(dev);
080321d3b3139b lib/dma-direct.c    Christoph Hellwig      2017-12-22   82  	struct page *page = NULL;
a7ba70f1787f97 kernel/dma/direct.c Nicolas Saenz Julienne 2019-11-21   83  	u64 phys_limit;
a8463d4b0e47d1 lib/dma-noop.c      Christian Borntraeger  2016-02-02   84  
633d5fce78a61e kernel/dma/direct.c David Rientjes         2020-06-11   85  	WARN_ON_ONCE(!PAGE_ALIGNED(size));
633d5fce78a61e kernel/dma/direct.c David Rientjes         2020-06-11   86  
c84dc6e68a1d24 kernel/dma/direct.c David Rientjes         2020-04-14   87  	gfp |= dma_direct_optimal_gfp_mask(dev, dev->coherent_dma_mask,
a7ba70f1787f97 kernel/dma/direct.c Nicolas Saenz Julienne 2019-11-21   88  					   &phys_limit);
633d5fce78a61e kernel/dma/direct.c David Rientjes         2020-06-11   89  	page = dma_alloc_contiguous(dev, size, gfp);
90ae409f9eb3bc kernel/dma/direct.c Christoph Hellwig      2019-08-20   90  	if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) {
633d5fce78a61e kernel/dma/direct.c David Rientjes         2020-06-11   91  		dma_free_contiguous(dev, page, size);
90ae409f9eb3bc kernel/dma/direct.c Christoph Hellwig      2019-08-20   92  		page = NULL;
90ae409f9eb3bc kernel/dma/direct.c Christoph Hellwig      2019-08-20   93  	}
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09   94  again:
90ae409f9eb3bc kernel/dma/direct.c Christoph Hellwig      2019-08-20   95  	if (!page)
633d5fce78a61e kernel/dma/direct.c David Rientjes         2020-06-11   96  		page = alloc_pages_node(node, gfp, get_order(size));
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09   97  	if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) {
b1d2dc009dece4 kernel/dma/direct.c Nicolin Chen           2019-05-23   98  		dma_free_contiguous(dev, page, size);
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09   99  		page = NULL;
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  100  
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  101  		if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
a7ba70f1787f97 kernel/dma/direct.c Nicolas Saenz Julienne 2019-11-21 @102  		    phys_limit < DMA_BIT_MASK(64) &&
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  103  		    !(gfp & (GFP_DMA32 | GFP_DMA))) {
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  104  			gfp |= GFP_DMA32;
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  105  			goto again;
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  106  		}
de7eab301de788 lib/dma-direct.c    Takashi Iwai           2018-04-16  107  
fbce251baa6e35 kernel/dma/direct.c Christoph Hellwig      2019-02-13  108  		if (IS_ENABLED(CONFIG_ZONE_DMA) && !(gfp & GFP_DMA)) {
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  109  			gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  110  			goto again;
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  111  		}
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  112  	}
95f183916d4b0b lib/dma-direct.c    Christoph Hellwig      2018-01-09  113  
b18814e767a445 kernel/dma/direct.c Christoph Hellwig      2018-11-04  114  	return page;
b18814e767a445 kernel/dma/direct.c Christoph Hellwig      2018-11-04  115  }
b18814e767a445 kernel/dma/direct.c Christoph Hellwig      2018-11-04  116  

:::::: The code at line 102 was first introduced by commit
:::::: a7ba70f1787f977f970cd116076c6fce4b9e01cc dma-mapping: treat dev->bus_dma_mask as a DMA limit

:::::: TO: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
:::::: CC: Christoph Hellwig <hch@....de>

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

Download attachment ".config.gz" of type "application/gzip" (37105 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ