All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/mm/fault.c:644 __do_page_fault() warn: inconsistent returns 'mm->mmap_lock'.
@ 2020-07-20  7:32 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-20  7:32 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5463 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Michel Lespinasse <walken@google.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Vlastimil Babka <vbabka@suse.cz>
CC: Davidlohr Bueso <dbueso@suse.de>
CC: Daniel Jordan <daniel.m.jordan@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5714ee50bb4375bd586858ad800b1d9772847452
commit: da1c55f1b272f4bd54671d459b39ea7b54944ef9 mmap locking API: rename mmap_sem to mmap_lock
date:   6 weeks ago
:::::: branch date: 7 hours ago
:::::: commit date: 6 weeks ago
config: powerpc-randconfig-m031-20200719 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
arch/powerpc/mm/fault.c:644 __do_page_fault() warn: inconsistent returns 'mm->mmap_lock'.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da1c55f1b272f4bd54671d459b39ea7b54944ef9
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout da1c55f1b272f4bd54671d459b39ea7b54944ef9
vim +644 arch/powerpc/mm/fault.c

fe4a6856cb4f43 Aneesh Kumar K.V       2020-05-05  601  
bd0d63f8095ae6 Benjamin Herrenschmidt 2017-07-19  602  	if (unlikely(access_error(is_write, is_exec, vma)))
ecb101aed86156 John Sperbeck          2017-12-31  603  		return bad_access(regs, address);
14cf11af6cf608 Paul Mackerras         2005-09-26  604  
14cf11af6cf608 Paul Mackerras         2005-09-26  605  	/*
14cf11af6cf608 Paul Mackerras         2005-09-26  606  	 * If for any reason at all we couldn't handle the fault,
14cf11af6cf608 Paul Mackerras         2005-09-26  607  	 * make sure we exit gracefully rather than endlessly redo
14cf11af6cf608 Paul Mackerras         2005-09-26  608  	 * the fault.
14cf11af6cf608 Paul Mackerras         2005-09-26  609  	 */
dcddffd41d3f1d Kirill A. Shutemov     2016-07-26  610  	fault = handle_mm_fault(vma, address, flags);
e6c2a4797e101a Ram Pai                2018-01-18  611  
f43bb27ebf27ee Benjamin Herrenschmidt 2017-07-19  612  	major |= fault & VM_FAULT_MAJOR;
14c02e419a395c Laurent Dufour         2017-02-14  613  
c9a0dad1620141 Peter Xu               2020-04-01  614  	if (fault_signal_pending(fault, regs))
c9a0dad1620141 Peter Xu               2020-04-01  615  		return user_mode(regs) ? 0 : SIGBUS;
c9a0dad1620141 Peter Xu               2020-04-01  616  
14c02e419a395c Laurent Dufour         2017-02-14  617  	/*
14c02e419a395c Laurent Dufour         2017-02-14  618  	 * Handle the retry right now, the mmap_sem has been released in that
14c02e419a395c Laurent Dufour         2017-02-14  619  	 * case.
14c02e419a395c Laurent Dufour         2017-02-14  620  	 */
14c02e419a395c Laurent Dufour         2017-02-14  621  	if (unlikely(fault & VM_FAULT_RETRY)) {
14c02e419a395c Laurent Dufour         2017-02-14  622  		if (flags & FAULT_FLAG_ALLOW_RETRY) {
14c02e419a395c Laurent Dufour         2017-02-14  623  			flags |= FAULT_FLAG_TRIED;
14c02e419a395c Laurent Dufour         2017-02-14  624  			goto retry;
14c02e419a395c Laurent Dufour         2017-02-14  625  		}
14cf11af6cf608 Paul Mackerras         2005-09-26  626  	}
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  627  
d8ed45c5dcd455 Michel Lespinasse      2020-06-08  628  	mmap_read_unlock(current->mm);
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  629  
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  630  	if (unlikely(fault & VM_FAULT_ERROR))
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  631  		return mm_fault_error(regs, address, fault);
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  632  
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  633  	/*
14c02e419a395c Laurent Dufour         2017-02-14  634  	 * Major/minor page fault accounting.
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  635  	 */
f43bb27ebf27ee Benjamin Herrenschmidt 2017-07-19  636  	if (major) {
83c54070ee1a2d Nick Piggin            2007-07-19  637  		current->maj_flt++;
04aafdc6018fee Benjamin Herrenschmidt 2017-07-19  638  		perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
3da026480a7536 Benjamin Herrenschmidt 2017-07-19  639  		cmo_account_page_fault();
ac17dc8e58f306 Peter Zijlstra         2009-03-13  640  	} else {
83c54070ee1a2d Nick Piggin            2007-07-19  641  		current->min_flt++;
04aafdc6018fee Benjamin Herrenschmidt 2017-07-19  642  		perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
ac17dc8e58f306 Peter Zijlstra         2009-03-13  643  	}
65d47fd4a37cbd Benjamin Herrenschmidt 2017-07-19 @644  	return 0;
14cf11af6cf608 Paul Mackerras         2005-09-26  645  }
7afad422ac6106 Benjamin Herrenschmidt 2017-07-19  646  NOKPROBE_SYMBOL(__do_page_fault);
7afad422ac6106 Benjamin Herrenschmidt 2017-07-19  647  

:::::: The code at line 644 was first introduced by commit
:::::: 65d47fd4a37cbd60d0737cdae09edf1d208364d7 powerpc/mm: Simplify returns from __do_page_fault

:::::: TO: Benjamin Herrenschmidt <benh@kernel.crashing.org>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35848 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* arch/powerpc/mm/fault.c:644 __do_page_fault() warn: inconsistent returns 'mm->mmap_lock'.
@ 2020-12-08  3:08 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-12-08  3:08 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5176 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Michel Lespinasse <walken@google.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Vlastimil Babka <vbabka@suse.cz>
CC: Davidlohr Bueso <dbueso@suse.de>
CC: Daniel Jordan <daniel.m.jordan@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cd796ed3345030aa1bb332fe5c793b3dddaf56e7
commit: da1c55f1b272f4bd54671d459b39ea7b54944ef9 mmap locking API: rename mmap_sem to mmap_lock
date:   6 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 6 months ago
config: powerpc64-randconfig-m031-20201208 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
arch/powerpc/mm/fault.c:644 __do_page_fault() warn: inconsistent returns 'mm->mmap_lock'.

vim +644 arch/powerpc/mm/fault.c

fe4a6856cb4f43 Aneesh Kumar K.V       2020-05-05  601  
bd0d63f8095ae6 Benjamin Herrenschmidt 2017-07-19  602  	if (unlikely(access_error(is_write, is_exec, vma)))
ecb101aed86156 John Sperbeck          2017-12-31  603  		return bad_access(regs, address);
14cf11af6cf608 Paul Mackerras         2005-09-26  604  
14cf11af6cf608 Paul Mackerras         2005-09-26  605  	/*
14cf11af6cf608 Paul Mackerras         2005-09-26  606  	 * If for any reason at all we couldn't handle the fault,
14cf11af6cf608 Paul Mackerras         2005-09-26  607  	 * make sure we exit gracefully rather than endlessly redo
14cf11af6cf608 Paul Mackerras         2005-09-26  608  	 * the fault.
14cf11af6cf608 Paul Mackerras         2005-09-26  609  	 */
dcddffd41d3f1d Kirill A. Shutemov     2016-07-26  610  	fault = handle_mm_fault(vma, address, flags);
e6c2a4797e101a Ram Pai                2018-01-18  611  
f43bb27ebf27ee Benjamin Herrenschmidt 2017-07-19  612  	major |= fault & VM_FAULT_MAJOR;
14c02e419a395c Laurent Dufour         2017-02-14  613  
c9a0dad1620141 Peter Xu               2020-04-01  614  	if (fault_signal_pending(fault, regs))
c9a0dad1620141 Peter Xu               2020-04-01  615  		return user_mode(regs) ? 0 : SIGBUS;
c9a0dad1620141 Peter Xu               2020-04-01  616  
14c02e419a395c Laurent Dufour         2017-02-14  617  	/*
14c02e419a395c Laurent Dufour         2017-02-14  618  	 * Handle the retry right now, the mmap_sem has been released in that
14c02e419a395c Laurent Dufour         2017-02-14  619  	 * case.
14c02e419a395c Laurent Dufour         2017-02-14  620  	 */
14c02e419a395c Laurent Dufour         2017-02-14  621  	if (unlikely(fault & VM_FAULT_RETRY)) {
14c02e419a395c Laurent Dufour         2017-02-14  622  		if (flags & FAULT_FLAG_ALLOW_RETRY) {
14c02e419a395c Laurent Dufour         2017-02-14  623  			flags |= FAULT_FLAG_TRIED;
14c02e419a395c Laurent Dufour         2017-02-14  624  			goto retry;
14c02e419a395c Laurent Dufour         2017-02-14  625  		}
14cf11af6cf608 Paul Mackerras         2005-09-26  626  	}
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  627  
d8ed45c5dcd455 Michel Lespinasse      2020-06-08  628  	mmap_read_unlock(current->mm);
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  629  
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  630  	if (unlikely(fault & VM_FAULT_ERROR))
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  631  		return mm_fault_error(regs, address, fault);
b5c8f0fd595d25 Benjamin Herrenschmidt 2017-07-19  632  
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  633  	/*
14c02e419a395c Laurent Dufour         2017-02-14  634  	 * Major/minor page fault accounting.
9be72573a80648 Benjamin Herrenschmidt 2012-03-01  635  	 */
f43bb27ebf27ee Benjamin Herrenschmidt 2017-07-19  636  	if (major) {
83c54070ee1a2d Nick Piggin            2007-07-19  637  		current->maj_flt++;
04aafdc6018fee Benjamin Herrenschmidt 2017-07-19  638  		perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
3da026480a7536 Benjamin Herrenschmidt 2017-07-19  639  		cmo_account_page_fault();
ac17dc8e58f306 Peter Zijlstra         2009-03-13  640  	} else {
83c54070ee1a2d Nick Piggin            2007-07-19  641  		current->min_flt++;
04aafdc6018fee Benjamin Herrenschmidt 2017-07-19  642  		perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
ac17dc8e58f306 Peter Zijlstra         2009-03-13  643  	}
65d47fd4a37cbd Benjamin Herrenschmidt 2017-07-19 @644  	return 0;
14cf11af6cf608 Paul Mackerras         2005-09-26  645  }
7afad422ac6106 Benjamin Herrenschmidt 2017-07-19  646  NOKPROBE_SYMBOL(__do_page_fault);
7afad422ac6106 Benjamin Herrenschmidt 2017-07-19  647  

:::::: The code at line 644 was first introduced by commit
:::::: 65d47fd4a37cbd60d0737cdae09edf1d208364d7 powerpc/mm: Simplify returns from __do_page_fault

:::::: TO: Benjamin Herrenschmidt <benh@kernel.crashing.org>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25046 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-08  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  7:32 arch/powerpc/mm/fault.c:644 __do_page_fault() warn: inconsistent returns 'mm->mmap_lock' kernel test robot
2020-12-08  3:08 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.