* [dhowells-fs:fscache-netfs-lib 1/26] lib/iov_iter.c:771:8: sparse: sparse: context imbalance in '_copy_mc_to_iter' - different lock contexts for basic block
@ 2021-01-18 21:24 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-01-18 21:24 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 7305 bytes --]
CC: kbuild-all(a)lists.01.org
TO: David Howells <dhowells@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-netfs-lib
head: 72ff7b8b0c53f453dcc5ec36195fda98dfbf605c
commit: 63173dca934066c5f100288b417834b84429045d [1/26] iov_iter: Add ITER_XARRAY
:::::: branch date: 4 hours ago
:::::: commit date: 4 days ago
config: x86_64-randconfig-s022-20210118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=63173dca934066c5f100288b417834b84429045d
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs fscache-netfs-lib
git checkout 63173dca934066c5f100288b417834b84429045d
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> lib/iov_iter.c:771:8: sparse: sparse: context imbalance in '_copy_mc_to_iter' - different lock contexts for basic block
vim +/_copy_mc_to_iter +771 lib/iov_iter.c
ca146f6f091e47b3 Dan Williams 2018-07-08 747
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 748 /**
ec6347bb43395cb9 Dan Williams 2020-10-05 749 * _copy_mc_to_iter - copy to iter with source memory error exception handling
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 750 * @addr: source kernel address
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 751 * @bytes: total transfer length
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 752 * @iter: destination iterator
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 753 *
ec6347bb43395cb9 Dan Williams 2020-10-05 754 * The pmem driver deploys this for the dax operation
ec6347bb43395cb9 Dan Williams 2020-10-05 755 * (dax_copy_to_iter()) for dax reads (bypass page-cache and the
ec6347bb43395cb9 Dan Williams 2020-10-05 756 * block-layer). Upon #MC read(2) aborts and returns EIO or the bytes
ec6347bb43395cb9 Dan Williams 2020-10-05 757 * successfully copied.
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 758 *
ec6347bb43395cb9 Dan Williams 2020-10-05 759 * The main differences between this and typical _copy_to_iter().
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 760 *
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 761 * * Typical tail/residue handling after a fault retries the copy
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 762 * byte-by-byte until the fault happens again. Re-triggering machine
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 763 * checks is potentially fatal so the implementation uses source
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 764 * alignment and poison alignment assumptions to avoid re-triggering
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 765 * hardware exceptions.
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 766 *
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 767 * * ITER_KVEC, ITER_PIPE, and ITER_BVEC can return short copies.
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 768 * Compare to copy_to_iter() where only ITER_IOVEC attempts might return
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 769 * a short copy.
bf3eeb9b5f2a1a05 Dan Williams 2018-07-08 770 */
ec6347bb43395cb9 Dan Williams 2020-10-05 @771 size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i)
8780356ef630aa57 Dan Williams 2018-05-03 772 {
8780356ef630aa57 Dan Williams 2018-05-03 773 const char *from = addr;
8780356ef630aa57 Dan Williams 2018-05-03 774 unsigned long rem, curr_addr, s_addr = (unsigned long) addr;
8780356ef630aa57 Dan Williams 2018-05-03 775
00e23707442a75b4 David Howells 2018-10-22 776 if (unlikely(iov_iter_is_pipe(i)))
ec6347bb43395cb9 Dan Williams 2020-10-05 777 return copy_mc_pipe_to_iter(addr, bytes, i);
8780356ef630aa57 Dan Williams 2018-05-03 778 if (iter_is_iovec(i))
8780356ef630aa57 Dan Williams 2018-05-03 779 might_fault();
8780356ef630aa57 Dan Williams 2018-05-03 780 iterate_and_advance(i, bytes, v,
ec6347bb43395cb9 Dan Williams 2020-10-05 781 copyout_mc(v.iov_base, (from += v.iov_len) - v.iov_len,
ec6347bb43395cb9 Dan Williams 2020-10-05 782 v.iov_len),
8780356ef630aa57 Dan Williams 2018-05-03 783 ({
ec6347bb43395cb9 Dan Williams 2020-10-05 784 rem = copy_mc_to_page(v.bv_page, v.bv_offset,
8780356ef630aa57 Dan Williams 2018-05-03 785 (from += v.bv_len) - v.bv_len, v.bv_len);
8780356ef630aa57 Dan Williams 2018-05-03 786 if (rem) {
8780356ef630aa57 Dan Williams 2018-05-03 787 curr_addr = (unsigned long) from;
8780356ef630aa57 Dan Williams 2018-05-03 788 bytes = curr_addr - s_addr - rem;
8780356ef630aa57 Dan Williams 2018-05-03 789 return bytes;
8780356ef630aa57 Dan Williams 2018-05-03 790 }
8780356ef630aa57 Dan Williams 2018-05-03 791 }),
8780356ef630aa57 Dan Williams 2018-05-03 792 ({
ec6347bb43395cb9 Dan Williams 2020-10-05 793 rem = copy_mc_to_kernel(v.iov_base, (from += v.iov_len)
ec6347bb43395cb9 Dan Williams 2020-10-05 794 - v.iov_len, v.iov_len);
8780356ef630aa57 Dan Williams 2018-05-03 795 if (rem) {
8780356ef630aa57 Dan Williams 2018-05-03 796 curr_addr = (unsigned long) from;
8780356ef630aa57 Dan Williams 2018-05-03 797 bytes = curr_addr - s_addr - rem;
8780356ef630aa57 Dan Williams 2018-05-03 798 return bytes;
8780356ef630aa57 Dan Williams 2018-05-03 799 }
63173dca934066c5 David Howells 2020-02-10 800 }),
63173dca934066c5 David Howells 2020-02-10 801 ({
63173dca934066c5 David Howells 2020-02-10 802 rem = copy_mc_to_page(v.bv_page, v.bv_offset,
63173dca934066c5 David Howells 2020-02-10 803 (from += v.bv_len) - v.bv_len, v.bv_len);
63173dca934066c5 David Howells 2020-02-10 804 if (rem) {
63173dca934066c5 David Howells 2020-02-10 805 curr_addr = (unsigned long) from;
63173dca934066c5 David Howells 2020-02-10 806 bytes = curr_addr - s_addr - rem;
63173dca934066c5 David Howells 2020-02-10 807 return bytes;
63173dca934066c5 David Howells 2020-02-10 808 }
8780356ef630aa57 Dan Williams 2018-05-03 809 })
8780356ef630aa57 Dan Williams 2018-05-03 810 )
8780356ef630aa57 Dan Williams 2018-05-03 811
8780356ef630aa57 Dan Williams 2018-05-03 812 return bytes;
8780356ef630aa57 Dan Williams 2018-05-03 813 }
ec6347bb43395cb9 Dan Williams 2020-10-05 814 EXPORT_SYMBOL_GPL(_copy_mc_to_iter);
ec6347bb43395cb9 Dan Williams 2020-10-05 815 #endif /* CONFIG_ARCH_HAS_COPY_MC */
8780356ef630aa57 Dan Williams 2018-05-03 816
:::::: The code at line 771 was first introduced by commit
:::::: ec6347bb43395cb92126788a1a5b25302543f815 x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()
:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Borislav Petkov <bp@suse.de>
---
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: 28325 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-18 21:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 21:24 [dhowells-fs:fscache-netfs-lib 1/26] lib/iov_iter.c:771:8: sparse: sparse: context imbalance in '_copy_mc_to_iter' - different lock contexts for basic block 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.