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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Oct 2021 04:17:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     Naoya Horiguchi <naoya.horiguchi@...ux.dev>, linux-mm@...ck.org
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        Alistair Popple <apopple@...dia.com>,
        Peter Xu <peterx@...hat.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Konstantin Khlebnikov <koct9i@...il.com>,
        Bin Wang <wangbin224@...wei.com>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] mm, pagemap: expose hwpoison entry

Hi Naoya,

I love your patch! Perhaps something to improve:

[auto build test WARNING on hnaz-mm/master]

url:    https://github.com/0day-ci/linux/commits/Naoya-Horiguchi/mm-pagemap-expose-hwpoison-entry/20211004-195200
base:   https://github.com/hnaz/linux-mm master
config: riscv-randconfig-r035-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dec2257f354d39dbd8232e6bd1a417d91c4f14a2)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/f1735ae85d981e413e70ff0041fcb7f775525699
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Naoya-Horiguchi/mm-pagemap-expose-hwpoison-entry/20211004-195200
        git checkout f1735ae85d981e413e70ff0041fcb7f775525699
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv 

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 >>):

>> fs/proc/task_mmu.c:1561:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                           else if (flags & PM_SWAP)
                           ^
   1 warning generated.


vim +1561 fs/proc/task_mmu.c

  1505	
  1506	#ifdef CONFIG_HUGETLB_PAGE
  1507	/* This function walks within one hugetlb entry in the single call */
  1508	static int pagemap_hugetlb_range(pte_t *ptep, unsigned long hmask,
  1509					 unsigned long addr, unsigned long end,
  1510					 struct mm_walk *walk)
  1511	{
  1512		struct pagemapread *pm = walk->private;
  1513		struct vm_area_struct *vma = walk->vma;
  1514		u64 flags = 0, frame = 0;
  1515		int err = 0;
  1516		pte_t pte;
  1517		struct page *page = NULL;
  1518	
  1519		if (vma->vm_flags & VM_SOFTDIRTY)
  1520			flags |= PM_SOFT_DIRTY;
  1521	
  1522		pte = huge_ptep_get(ptep);
  1523		if (pte_present(pte)) {
  1524			page = pte_page(pte);
  1525	
  1526			flags |= PM_PRESENT;
  1527			if (pm->show_pfn)
  1528				frame = pte_pfn(pte) +
  1529					((addr & ~hmask) >> PAGE_SHIFT);
  1530		} else if (is_swap_pte(pte)) {
  1531			swp_entry_t entry = pte_to_swp_entry(pte);
  1532			unsigned long offset;
  1533	
  1534			if (pm->show_pfn) {
  1535				offset = swp_offset(entry) +
  1536					((addr & ~hmask) >> PAGE_SHIFT);
  1537				frame = swp_type(entry) |
  1538					(offset << MAX_SWAPFILES_SHIFT);
  1539			}
  1540			flags |= PM_SWAP;
  1541			if (is_migration_entry(entry))
  1542				page = compound_head(pfn_swap_entry_to_page(entry));
  1543			if (is_hwpoison_entry(entry))
  1544				flags |= PM_HWPOISON;
  1545		}
  1546	
  1547		if (page && !PageAnon(page))
  1548			flags |= PM_FILE;
  1549		if (page && page_mapcount(page) == 1)
  1550			flags |= PM_MMAP_EXCLUSIVE;
  1551	
  1552		for (; addr != end; addr += PAGE_SIZE) {
  1553			pagemap_entry_t pme = make_pme(frame, flags);
  1554	
  1555			err = add_to_pagemap(addr, &pme, pm);
  1556			if (err)
  1557				return err;
  1558			if (pm->show_pfn)
  1559				if (flags & PM_PRESENT)
  1560					frame++;
> 1561				else if (flags & PM_SWAP)
  1562					frame += (1 << MAX_SWAPFILES_SHIFT);
  1563		}
  1564	
  1565		cond_resched();
  1566	
  1567		return err;
  1568	}
  1569	#else
  1570	#define pagemap_hugetlb_range	NULL
  1571	#endif /* HUGETLB_PAGE */
  1572	

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

Powered by blists - more mailing lists