Re: [PATCH 1/3] riscv: mm: Use hint address in mmap if available

From: kernel test robot
Date: Tue Jan 30 2024 - 17:12:54 EST


Hi Charlie,

kernel test robot noticed the following build errors:

[auto build test ERROR on 556e2d17cae620d549c5474b1ece053430cd50bc]

url: https://github.com/intel-lab-lkp/linux/commits/Charlie-Jenkins/riscv-mm-Use-hint-address-in-mmap-if-available/20240130-084208
base: 556e2d17cae620d549c5474b1ece053430cd50bc
patch link: https://lore.kernel.org/r/20240129-use_mmap_hint_address-v1-1-4c74da813ba1%40rivosinc.com
patch subject: [PATCH 1/3] riscv: mm: Use hint address in mmap if available
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20240131/202401310513.lub8Ilwm-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fdac7d0b6f74f919d319b31a0680c77f66732586)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240131/202401310513.lub8Ilwm-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401310513.lub8Ilwm-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> mm/mmap.c:1703:33: error: expected expression
1703 | const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags);
| ^
arch/riscv/include/asm/processor.h:28:2: note: expanded from macro 'arch_get_mmap_end'
28 | else \
| ^
mm/mmap.c:1751:33: error: expected expression
1751 | const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags);
| ^
arch/riscv/include/asm/processor.h:28:2: note: expanded from macro 'arch_get_mmap_end'
28 | else \
| ^
2 errors generated.


vim +1703 mm/mmap.c

f6795053dac8d4d Steve Capper 2018-12-06 1683
^1da177e4c3f415 Linus Torvalds 2005-04-16 1684 /* Get an address range which is currently unmapped.
^1da177e4c3f415 Linus Torvalds 2005-04-16 1685 * For shmat() with addr=0.
^1da177e4c3f415 Linus Torvalds 2005-04-16 1686 *
^1da177e4c3f415 Linus Torvalds 2005-04-16 1687 * Ugly calling convention alert:
^1da177e4c3f415 Linus Torvalds 2005-04-16 1688 * Return value with the low bits set means error value,
^1da177e4c3f415 Linus Torvalds 2005-04-16 1689 * ie
^1da177e4c3f415 Linus Torvalds 2005-04-16 1690 * if (ret & ~PAGE_MASK)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1691 * error = ret;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1692 *
^1da177e4c3f415 Linus Torvalds 2005-04-16 1693 * This function "knows" that -ENOMEM has the bits set.
^1da177e4c3f415 Linus Torvalds 2005-04-16 1694 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 1695 unsigned long
4b439e25e29ec33 Christophe Leroy 2022-04-09 1696 generic_get_unmapped_area(struct file *filp, unsigned long addr,
4b439e25e29ec33 Christophe Leroy 2022-04-09 1697 unsigned long len, unsigned long pgoff,
4b439e25e29ec33 Christophe Leroy 2022-04-09 1698 unsigned long flags)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1699 {
^1da177e4c3f415 Linus Torvalds 2005-04-16 1700 struct mm_struct *mm = current->mm;
1be7107fbe18eed Hugh Dickins 2017-06-19 1701 struct vm_area_struct *vma, *prev;
db4fbfb9523c935 Michel Lespinasse 2012-12-11 1702 struct vm_unmapped_area_info info;
2cb4de085f383cb Christophe Leroy 2022-04-09 @1703 const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1704
f6795053dac8d4d Steve Capper 2018-12-06 1705 if (len > mmap_end - mmap_min_addr)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1706 return -ENOMEM;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1707
06abdfb47ee745a Benjamin Herrenschmidt 2007-05-06 1708 if (flags & MAP_FIXED)
06abdfb47ee745a Benjamin Herrenschmidt 2007-05-06 1709 return addr;
06abdfb47ee745a Benjamin Herrenschmidt 2007-05-06 1710
^1da177e4c3f415 Linus Torvalds 2005-04-16 1711 if (addr) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 1712 addr = PAGE_ALIGN(addr);
1be7107fbe18eed Hugh Dickins 2017-06-19 1713 vma = find_vma_prev(mm, addr, &prev);
f6795053dac8d4d Steve Capper 2018-12-06 1714 if (mmap_end - len >= addr && addr >= mmap_min_addr &&
1be7107fbe18eed Hugh Dickins 2017-06-19 1715 (!vma || addr + len <= vm_start_gap(vma)) &&
1be7107fbe18eed Hugh Dickins 2017-06-19 1716 (!prev || addr >= vm_end_gap(prev)))
^1da177e4c3f415 Linus Torvalds 2005-04-16 1717 return addr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1718 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1719
db4fbfb9523c935 Michel Lespinasse 2012-12-11 1720 info.flags = 0;
db4fbfb9523c935 Michel Lespinasse 2012-12-11 1721 info.length = len;
4e99b02131b280b Heiko Carstens 2013-11-12 1722 info.low_limit = mm->mmap_base;
f6795053dac8d4d Steve Capper 2018-12-06 1723 info.high_limit = mmap_end;
db4fbfb9523c935 Michel Lespinasse 2012-12-11 1724 info.align_mask = 0;
09ef5283fd96ac4 Jaewon Kim 2020-04-10 1725 info.align_offset = 0;
db4fbfb9523c935 Michel Lespinasse 2012-12-11 1726 return vm_unmapped_area(&info);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1727 }
4b439e25e29ec33 Christophe Leroy 2022-04-09 1728

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