Thread (1 message) 1 message, 1 author, 2021-09-01

Re: [PATCH -next v2] riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT

From: kernel test robot <hidden>
Date: 2021-09-01 06:48:00
Also in: oe-kbuild-all

Hi Liu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20210831]

url:    https://github.com/0day-ci/linux/commits/Liu-Shixin/riscv-Enable-HAVE_ARCH_HUGE_VMAP-for-64BIT/20210831-202818
base:    52c7b727581fe725f8b8a283af21fe0651c73c48
config: i386-randconfig-a011-20210831 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4b1fde8a2b681dad2ce0c082a5d6422caa06b0bc)
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/0day-ci/linux/commit/56c97e9d9ededae88111ef9b72e88de4c0d85b29
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Liu-Shixin/riscv-Enable-HAVE_ARCH_HUGE_VMAP-for-64BIT/20210831-202818
        git checkout 56c97e9d9ededae88111ef9b72e88de4c0d85b29
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>

All errors (new ones prefixed by >>):
quoted
arch/x86/mm/pgtable.c:703:5: error: redefinition of 'pud_set_huge'
   int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
       ^
   include/linux/pgtable.h:1404:19: note: previous definition is here
   static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
                     ^
quoted
arch/x86/mm/pgtable.c:758:5: error: redefinition of 'pud_clear_huge'
   int pud_clear_huge(pud_t *pud)
       ^
   include/linux/pgtable.h:1408:19: note: previous definition is here
   static inline int pud_clear_huge(pud_t *pud)
                     ^
   2 errors generated.


vim +/pud_set_huge +703 arch/x86/mm/pgtable.c

b8504058a06bd1 Kirill A. Shutemov 2017-03-30  684  
3d3ca416d9b078 Toshi Kani         2015-05-26  685  /**
3d3ca416d9b078 Toshi Kani         2015-05-26  686   * pud_set_huge - setup kernel PUD mapping
3d3ca416d9b078 Toshi Kani         2015-05-26  687   *
b73522e0c1be58 Toshi Kani         2015-05-26  688   * MTRRs can override PAT memory types with 4KiB granularity. Therefore, this
b73522e0c1be58 Toshi Kani         2015-05-26  689   * function sets up a huge page only if any of the following conditions are met:
b73522e0c1be58 Toshi Kani         2015-05-26  690   *
b73522e0c1be58 Toshi Kani         2015-05-26  691   * - MTRRs are disabled, or
b73522e0c1be58 Toshi Kani         2015-05-26  692   *
b73522e0c1be58 Toshi Kani         2015-05-26  693   * - MTRRs are enabled and the range is completely covered by a single MTRR, or
b73522e0c1be58 Toshi Kani         2015-05-26  694   *
b73522e0c1be58 Toshi Kani         2015-05-26  695   * - MTRRs are enabled and the corresponding MTRR memory type is WB, which
b73522e0c1be58 Toshi Kani         2015-05-26  696   *   has no effect on the requested PAT memory type.
b73522e0c1be58 Toshi Kani         2015-05-26  697   *
b73522e0c1be58 Toshi Kani         2015-05-26  698   * Callers should try to decrease page size (1GB -> 2MB -> 4K) if the bigger
b73522e0c1be58 Toshi Kani         2015-05-26  699   * page mapping attempt fails.
3d3ca416d9b078 Toshi Kani         2015-05-26  700   *
3d3ca416d9b078 Toshi Kani         2015-05-26  701   * Returns 1 on success and 0 on failure.
3d3ca416d9b078 Toshi Kani         2015-05-26  702   */
6b6378355b9250 Toshi Kani         2015-04-14 @703  int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
6b6378355b9250 Toshi Kani         2015-04-14  704  {
b73522e0c1be58 Toshi Kani         2015-05-26  705  	u8 mtrr, uniform;
6b6378355b9250 Toshi Kani         2015-04-14  706  
b73522e0c1be58 Toshi Kani         2015-05-26  707  	mtrr = mtrr_type_lookup(addr, addr + PUD_SIZE, &uniform);
b73522e0c1be58 Toshi Kani         2015-05-26  708  	if ((mtrr != MTRR_TYPE_INVALID) && (!uniform) &&
b73522e0c1be58 Toshi Kani         2015-05-26  709  	    (mtrr != MTRR_TYPE_WRBACK))
6b6378355b9250 Toshi Kani         2015-04-14  710  		return 0;
6b6378355b9250 Toshi Kani         2015-04-14  711  
e3e288121408c3 Joerg Roedel       2018-04-11  712  	/* Bail out if we are we on a populated non-leaf entry: */
e3e288121408c3 Joerg Roedel       2018-04-11  713  	if (pud_present(*pud) && !pud_huge(*pud))
e3e288121408c3 Joerg Roedel       2018-04-11  714  		return 0;
e3e288121408c3 Joerg Roedel       2018-04-11  715  
6b6378355b9250 Toshi Kani         2015-04-14  716  	set_pte((pte_t *)pud, pfn_pte(
6b6378355b9250 Toshi Kani         2015-04-14  717  		(u64)addr >> PAGE_SHIFT,
d073569363d9f0 Christoph Hellwig  2020-04-08  718  		__pgprot(protval_4k_2_large(pgprot_val(prot)) | _PAGE_PSE)));
6b6378355b9250 Toshi Kani         2015-04-14  719  
6b6378355b9250 Toshi Kani         2015-04-14  720  	return 1;
6b6378355b9250 Toshi Kani         2015-04-14  721  }
6b6378355b9250 Toshi Kani         2015-04-14  722  
3d3ca416d9b078 Toshi Kani         2015-05-26  723  /**
3d3ca416d9b078 Toshi Kani         2015-05-26  724   * pmd_set_huge - setup kernel PMD mapping
3d3ca416d9b078 Toshi Kani         2015-05-26  725   *
b73522e0c1be58 Toshi Kani         2015-05-26  726   * See text over pud_set_huge() above.
3d3ca416d9b078 Toshi Kani         2015-05-26  727   *
3d3ca416d9b078 Toshi Kani         2015-05-26  728   * Returns 1 on success and 0 on failure.
3d3ca416d9b078 Toshi Kani         2015-05-26  729   */
6b6378355b9250 Toshi Kani         2015-04-14  730  int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
6b6378355b9250 Toshi Kani         2015-04-14  731  {
b73522e0c1be58 Toshi Kani         2015-05-26  732  	u8 mtrr, uniform;
6b6378355b9250 Toshi Kani         2015-04-14  733  
b73522e0c1be58 Toshi Kani         2015-05-26  734  	mtrr = mtrr_type_lookup(addr, addr + PMD_SIZE, &uniform);
b73522e0c1be58 Toshi Kani         2015-05-26  735  	if ((mtrr != MTRR_TYPE_INVALID) && (!uniform) &&
b73522e0c1be58 Toshi Kani         2015-05-26  736  	    (mtrr != MTRR_TYPE_WRBACK)) {
b73522e0c1be58 Toshi Kani         2015-05-26  737  		pr_warn_once("%s: Cannot satisfy [mem %#010llx-%#010llx] with a huge-page mapping due to MTRR override.\n",
b73522e0c1be58 Toshi Kani         2015-05-26  738  			     __func__, addr, addr + PMD_SIZE);
6b6378355b9250 Toshi Kani         2015-04-14  739  		return 0;
b73522e0c1be58 Toshi Kani         2015-05-26  740  	}
6b6378355b9250 Toshi Kani         2015-04-14  741  
e3e288121408c3 Joerg Roedel       2018-04-11  742  	/* Bail out if we are we on a populated non-leaf entry: */
e3e288121408c3 Joerg Roedel       2018-04-11  743  	if (pmd_present(*pmd) && !pmd_huge(*pmd))
e3e288121408c3 Joerg Roedel       2018-04-11  744  		return 0;
e3e288121408c3 Joerg Roedel       2018-04-11  745  
6b6378355b9250 Toshi Kani         2015-04-14  746  	set_pte((pte_t *)pmd, pfn_pte(
6b6378355b9250 Toshi Kani         2015-04-14  747  		(u64)addr >> PAGE_SHIFT,
d073569363d9f0 Christoph Hellwig  2020-04-08  748  		__pgprot(protval_4k_2_large(pgprot_val(prot)) | _PAGE_PSE)));
6b6378355b9250 Toshi Kani         2015-04-14  749  
6b6378355b9250 Toshi Kani         2015-04-14  750  	return 1;
6b6378355b9250 Toshi Kani         2015-04-14  751  }
6b6378355b9250 Toshi Kani         2015-04-14  752  
d8a719059b9dc9 Jonathan Marek     2021-07-21  753  /**
d8a719059b9dc9 Jonathan Marek     2021-07-21  754   * pud_clear_huge - clear kernel PUD mapping when it is set
d8a719059b9dc9 Jonathan Marek     2021-07-21  755   *
d8a719059b9dc9 Jonathan Marek     2021-07-21  756   * Returns 1 on success and 0 on failure (no PUD map is found).
d8a719059b9dc9 Jonathan Marek     2021-07-21  757   */
d8a719059b9dc9 Jonathan Marek     2021-07-21 @758  int pud_clear_huge(pud_t *pud)
d8a719059b9dc9 Jonathan Marek     2021-07-21  759  {
d8a719059b9dc9 Jonathan Marek     2021-07-21  760  	if (pud_large(*pud)) {
d8a719059b9dc9 Jonathan Marek     2021-07-21  761  		pud_clear(pud);
d8a719059b9dc9 Jonathan Marek     2021-07-21  762  		return 1;
d8a719059b9dc9 Jonathan Marek     2021-07-21  763  	}
d8a719059b9dc9 Jonathan Marek     2021-07-21  764  
d8a719059b9dc9 Jonathan Marek     2021-07-21  765  	return 0;
d8a719059b9dc9 Jonathan Marek     2021-07-21  766  }
d8a719059b9dc9 Jonathan Marek     2021-07-21  767  

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help