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: <202002230528.rnjZ0iOm%lkp@intel.com>
Date:   Sun, 23 Feb 2020 05:47:03 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Christoph Hellwig <hch@....de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Anup Patel <anup@...infault.org>
Subject: drivers/gpu/drm/drm_pci.c:82:19: note: in expansion of macro
 'virt_to_page'

Hi Christoph,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   54dedb5b571d2fb0d65c3957ecfa9b32ce28d7f0
commit: 6bd33e1ece528f67646db33bf97406b747dafda0 riscv: add nommu support
date:   3 months ago
config: riscv-randconfig-a001-20200223 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 6bd33e1ece528f67646db33bf97406b747dafda0
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from include/linux/dma-mapping.h:7,
                    from drivers/gpu/drm/drm_pci.c:25:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/memory_model.h:54:29: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                ^
   include/asm-generic/memory_model.h:82:21: note: in expansion of macro '__pfn_to_page'
    #define pfn_to_page __pfn_to_page
                        ^~~~~~~~~~~~~
   arch/riscv/include/asm/page.h:112:30: note: in expansion of macro 'pfn_to_page'
    #define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
                                 ^~~~~~~~~~~
   include/linux/scatterlist.h:145:18: note: in expansion of macro 'virt_to_page'
     sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
                     ^~~~~~~~~~~~
   In file included from arch/riscv/include/asm/page.h:12:0,
                    from arch/riscv/include/asm/thread_info.h:11,
                    from include/linux/thread_info.h:38,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/riscv/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/radix-tree.h:14,
                    from include/linux/idr.h:15,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from include/linux/dma-mapping.h:7,
                    from drivers/gpu/drm/drm_pci.c:25:
   include/linux/scatterlist.h: In function 'sg_phys':
   include/asm-generic/memory_model.h:55:54: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
                                                         ^
   include/linux/pfn.h:21:36: note: in definition of macro 'PFN_PHYS'
    #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
                                       ^
   arch/riscv/include/asm/page.h:115:29: note: in expansion of macro 'pfn_to_phys'
    #define page_to_phys(page) (pfn_to_phys(page_to_pfn(page)))
                                ^~~~~~~~~~~
   include/asm-generic/memory_model.h:81:21: note: in expansion of macro '__page_to_pfn'
    #define page_to_pfn __page_to_pfn
                        ^~~~~~~~~~~~~
   arch/riscv/include/asm/page.h:115:41: note: in expansion of macro 'page_to_pfn'
    #define page_to_phys(page) (pfn_to_phys(page_to_pfn(page)))
                                            ^~~~~~~~~~~
   include/linux/scatterlist.h:224:9: note: in expansion of macro 'page_to_phys'
     return page_to_phys(sg_page(sg)) + sg->offset;
            ^~~~~~~~~~~~
   In file included from arch/riscv/include/asm/page.h:131:0,
                    from arch/riscv/include/asm/thread_info.h:11,
                    from include/linux/thread_info.h:38,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/riscv/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/radix-tree.h:14,
                    from include/linux/idr.h:15,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from include/linux/dma-mapping.h:7,
                    from drivers/gpu/drm/drm_pci.c:25:
   include/linux/scatterlist.h: In function 'sg_page_iter_page':
   include/asm-generic/memory_model.h:54:29: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                ^
   include/asm-generic/memory_model.h:82:21: note: in expansion of macro '__pfn_to_page'
    #define pfn_to_page __pfn_to_page
                        ^~~~~~~~~~~~~
   include/linux/mm.h:213:26: note: in expansion of macro 'pfn_to_page'
    #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
                             ^~~~~~~~~~~
   include/linux/scatterlist.h:384:9: note: in expansion of macro 'nth_page'
     return nth_page(sg_page(piter->sg), piter->sg_pgoffset);
            ^~~~~~~~
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/asm-generic/memory_model.h:54:29: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                ^
   include/asm-generic/memory_model.h:82:21: note: in expansion of macro '__pfn_to_page'
    #define pfn_to_page __pfn_to_page
                        ^~~~~~~~~~~~~
   arch/riscv/include/asm/page.h:112:30: note: in expansion of macro 'pfn_to_page'
    #define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
                                 ^~~~~~~~~~~
   include/linux/dma-mapping.h:587:33: note: in expansion of macro 'virt_to_page'
     return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr),
                                    ^~~~~~~~~~~~
   drivers/gpu/drm/drm_pci.c: In function 'drm_pci_alloc':
   include/asm-generic/memory_model.h:54:29: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                ^
   include/asm-generic/memory_model.h:82:21: note: in expansion of macro '__pfn_to_page'
    #define pfn_to_page __pfn_to_page
                        ^~~~~~~~~~~~~
   arch/riscv/include/asm/page.h:112:30: note: in expansion of macro 'pfn_to_page'
    #define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
                                 ^~~~~~~~~~~
>> drivers/gpu/drm/drm_pci.c:82:19: note: in expansion of macro 'virt_to_page'
      SetPageReserved(virt_to_page((void *)addr));
                      ^~~~~~~~~~~~
   drivers/gpu/drm/drm_pci.c: In function '__drm_legacy_pci_free':
   include/asm-generic/memory_model.h:54:29: error: 'vmemmap' undeclared (first use in this function); did you mean 'vm_mmap'?
    #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                ^
   include/asm-generic/memory_model.h:82:21: note: in expansion of macro '__pfn_to_page'
    #define pfn_to_page __pfn_to_page
                        ^~~~~~~~~~~~~
   arch/riscv/include/asm/page.h:112:30: note: in expansion of macro 'pfn_to_page'
    #define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
                                 ^~~~~~~~~~~
   drivers/gpu/drm/drm_pci.c:105:22: note: in expansion of macro 'virt_to_page'
       ClearPageReserved(virt_to_page((void *)addr));
                         ^~~~~~~~~~~~

vim +/virt_to_page +82 drivers/gpu/drm/drm_pci.c

^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  38  
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  39  /**
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  40   * drm_pci_alloc - Allocate a PCI consistent memory block, for DMA.
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  41   * @dev: DRM device
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  42   * @size: size of block to allocate
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  43   * @align: alignment of block
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  44   *
23ef59ef6dcc9b6 drivers/gpu/drm/drm_pci.c  Daniel Vetter    2017-03-08  45   * FIXME: This is a needless abstraction of the Linux dma-api and should be
23ef59ef6dcc9b6 drivers/gpu/drm/drm_pci.c  Daniel Vetter    2017-03-08  46   * removed.
23ef59ef6dcc9b6 drivers/gpu/drm/drm_pci.c  Daniel Vetter    2017-03-08  47   *
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  48   * Return: A handle to the allocated memory block on success or NULL on
c6a1af8a1621913 drivers/gpu/drm/drm_pci.c  Thierry Reding   2014-05-19  49   * failure.
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  50   */
e6be8d9d17bd440 drivers/gpu/drm/drm_pci.c  Zhenyu Wang      2010-01-05  51  drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  52  {
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  53  	drm_dma_handle_t *dmah;
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  54  	unsigned long addr;
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  55  	size_t sz;
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  56  
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  57  	/* pci_alloc_consistent only guarantees alignment to the smallest
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  58  	 * PAGE_SIZE order which is greater than or equal to the requested size.
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  59  	 * Return NULL here for now to make sure nobody tries for larger alignment
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  60  	 */
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  61  	if (align > size)
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  62  		return NULL;
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  63  
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  64  	dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL);
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  65  	if (!dmah)
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  66  		return NULL;
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  67  
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  68  	dmah->size = size;
750afb08ca71310 drivers/gpu/drm/drm_pci.c  Luis Chamberlain 2019-01-04  69  	dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size,
750afb08ca71310 drivers/gpu/drm/drm_pci.c  Luis Chamberlain 2019-01-04  70  					 &dmah->busaddr,
068f304781804e2 drivers/gpu/drm/drm_pci.c  Souptick Joarder 2018-10-23  71  					 GFP_KERNEL | __GFP_COMP);
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  72  
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  73  	if (dmah->vaddr == NULL) {
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  74  		kfree(dmah);
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  75  		return NULL;
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  76  	}
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  77  
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  78  	/* XXX - Is virt_to_page() legal for consistent mem? */
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  79  	/* Reserve */
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  80  	for (addr = (unsigned long)dmah->vaddr, sz = size;
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  81  	     sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
e1e78533f2ddeab drivers/gpu/drm/drm_pci.c  Ben Hutchings    2013-10-27 @82  		SetPageReserved(virt_to_page((void *)addr));
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  83  	}
ddf19b973be5a96 drivers/char/drm/drm_pci.c Dave Airlie      2006-03-19  84  
9c8da5ebbf6f872 drivers/char/drm/drm_pci.c Dave Airlie      2005-07-10  85  	return dmah;
^1da177e4c3f415 drivers/char/drm/drm_pci.c Linus Torvalds   2005-04-16  86  }
b5e89ed53ed8d24 drivers/char/drm/drm_pci.c Dave Airlie      2005-09-25  87  

:::::: The code at line 82 was first introduced by commit
:::::: e1e78533f2ddeabef5dc6545739211795ac4b822 drm: Pass pointers to virt_to_page()

:::::: TO: Ben Hutchings <ben@...adent.org.uk>
:::::: CC: Dave Airlie <airlied@...hat.com>

---
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" (26558 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ