[aa:mapcount_deshare 20/27] mm/gup.c:2756:3: error: implicit declaration of function 'mm_set_has_pinned_flag'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git mapcount_deshare
head: 3e2f198cce0c1792ad71d6d81974b091019b6483
commit: 8dec302e87453234fc7ac1cf4d09e4d577a06cf3 [20/27] mm: gup: pack has_pinned in MMF_HAS_PINNED
config: arm-randconfig-r014-20210511 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git/commit/?id=...
git remote add aa https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git
git fetch --no-tags aa mapcount_deshare
git checkout 8dec302e87453234fc7ac1cf4d09e4d577a06cf3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> mm/gup.c:2756:3: error: implicit declaration of function 'mm_set_has_pinned_flag' [-Werror,-Wimplicit-function-declaration]
mm_set_has_pinned_flag(¤t->mm->flags);
^
1 error generated.
vim +/mm_set_has_pinned_flag +2756 mm/gup.c
2740
2741 static int internal_get_user_pages_fast(unsigned long start,
2742 unsigned long nr_pages,
2743 unsigned int gup_flags,
2744 struct page **pages)
2745 {
2746 unsigned long len, end;
2747 unsigned long nr_pinned;
2748 int ret;
2749
2750 if (WARN_ON_ONCE(gup_flags & ~(FOLL_WRITE | FOLL_LONGTERM |
2751 FOLL_FORCE | FOLL_PIN | FOLL_GET |
2752 FOLL_FAST_ONLY)))
2753 return -EINVAL;
2754
2755 if (gup_flags & FOLL_PIN)
> 2756 mm_set_has_pinned_flag(¤t->mm->flags);
2757
2758 if (!(gup_flags & FOLL_FAST_ONLY))
2759 might_lock_read(¤t->mm->mmap_lock);
2760
2761 start = untagged_addr(start) & PAGE_MASK;
2762 len = nr_pages << PAGE_SHIFT;
2763 if (check_add_overflow(start, len, &end))
2764 return 0;
2765 if (unlikely(!access_ok((void __user *)start, len)))
2766 return -EFAULT;
2767
2768 nr_pinned = lockless_pages_from_mm(start, end, gup_flags, pages);
2769 if (nr_pinned == nr_pages || gup_flags & FOLL_FAST_ONLY)
2770 return nr_pinned;
2771
2772 /* Slow path: try to get the remaining pages with get_user_pages */
2773 start += nr_pinned << PAGE_SHIFT;
2774 pages += nr_pinned;
2775 ret = __gup_longterm_unlocked(start, nr_pages - nr_pinned, gup_flags,
2776 pages);
2777 if (ret < 0) {
2778 /*
2779 * The caller has to unpin the pages we already pinned so
2780 * returning -errno is not an option
2781 */
2782 if (nr_pinned)
2783 return nr_pinned;
2784 return ret;
2785 }
2786 return ret + nr_pinned;
2787 }
2788
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 1 week
Re: [RFC net-next] openvswitch: Introduce per-cpu upcall dispatch
by Dan Carpenter
Hi Mark,
url: https://github.com/0day-ci/linux/commits/Mark-Gray/openvswitch-Introduce-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 4a52dd8fefb45626dace70a63c0738dbd83b7edb
config: i386-randconfig-m021-20210430 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/openvswitch/datapath.c:1612 ovs_dp_set_upcall_portids() warn: variable dereferenced before check 'dp' (see line 1608)
net/openvswitch/datapath.c:1613 ovs_dp_set_upcall_portids() warn: possible memory leak of 'dp_portids'
vim +/dp +1612 net/openvswitch/datapath.c
96349cd061e4c2 Mark Gray 2021-04-30 1600 static int ovs_dp_set_upcall_portids(struct datapath *dp,
96349cd061e4c2 Mark Gray 2021-04-30 1601 const struct nlattr *ids)
96349cd061e4c2 Mark Gray 2021-04-30 1602 {
96349cd061e4c2 Mark Gray 2021-04-30 1603 struct dp_portids *old, *dp_portids;
96349cd061e4c2 Mark Gray 2021-04-30 1604
96349cd061e4c2 Mark Gray 2021-04-30 1605 if (!nla_len(ids) || nla_len(ids) % sizeof(u32))
96349cd061e4c2 Mark Gray 2021-04-30 1606 return -EINVAL;
96349cd061e4c2 Mark Gray 2021-04-30 1607
96349cd061e4c2 Mark Gray 2021-04-30 @1608 old = ovsl_dereference(dp->upcall_portids);
96349cd061e4c2 Mark Gray 2021-04-30 1609
96349cd061e4c2 Mark Gray 2021-04-30 1610 dp_portids = kmalloc(sizeof(*dp_portids) + nla_len(ids),
96349cd061e4c2 Mark Gray 2021-04-30 1611 GFP_KERNEL);
96349cd061e4c2 Mark Gray 2021-04-30 @1612 if (!dp)
^^
This should have been "if (!dp_portids)"
96349cd061e4c2 Mark Gray 2021-04-30 @1613 return -ENOMEM;
96349cd061e4c2 Mark Gray 2021-04-30 1614
96349cd061e4c2 Mark Gray 2021-04-30 1615 dp_portids->n_ids = nla_len(ids) / sizeof(u32);
96349cd061e4c2 Mark Gray 2021-04-30 1616 nla_memcpy(dp_portids->ids, ids, nla_len(ids));
96349cd061e4c2 Mark Gray 2021-04-30 1617
96349cd061e4c2 Mark Gray 2021-04-30 1618 rcu_assign_pointer(dp->upcall_portids, dp_portids);
96349cd061e4c2 Mark Gray 2021-04-30 1619
96349cd061e4c2 Mark Gray 2021-04-30 1620 if (old)
96349cd061e4c2 Mark Gray 2021-04-30 1621 kfree_rcu(old, rcu);
96349cd061e4c2 Mark Gray 2021-04-30 1622 return 0;
96349cd061e4c2 Mark Gray 2021-04-30 1623 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
12 months
arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d93a0d43e3d0ba9e19387be4dae4a8d5b175a8d7
commit: 97e4910232fa1f81e806aa60c25a0450276d99a2 linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP*
date: 3 weeks ago
config: powerpc64-randconfig-r006-20210403 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 0fe8af94688aa03c01913c2001d6a1a911f42ce6)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 97e4910232fa1f81e806aa60c25a0450276d99a2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest' [-Werror,-Wframe-larger-than=]
long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
^
1 error generated.
vim +/kvmhv_enter_nested_guest +264 arch/powerpc/kvm/book3s_hv_nested.c
afe75049303f75 Ravi Bangoria 2020-12-16 263
360cae313702cd Paul Mackerras 2018-10-08 @264 long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
360cae313702cd Paul Mackerras 2018-10-08 265 {
360cae313702cd Paul Mackerras 2018-10-08 266 long int err, r;
360cae313702cd Paul Mackerras 2018-10-08 267 struct kvm_nested_guest *l2;
360cae313702cd Paul Mackerras 2018-10-08 268 struct pt_regs l2_regs, saved_l1_regs;
afe75049303f75 Ravi Bangoria 2020-12-16 269 struct hv_guest_state l2_hv = {0}, saved_l1_hv;
360cae313702cd Paul Mackerras 2018-10-08 270 struct kvmppc_vcore *vc = vcpu->arch.vcore;
360cae313702cd Paul Mackerras 2018-10-08 271 u64 hv_ptr, regs_ptr;
360cae313702cd Paul Mackerras 2018-10-08 272 u64 hdec_exp;
360cae313702cd Paul Mackerras 2018-10-08 273 s64 delta_purr, delta_spurr, delta_ic, delta_vtb;
360cae313702cd Paul Mackerras 2018-10-08 274 u64 mask;
360cae313702cd Paul Mackerras 2018-10-08 275 unsigned long lpcr;
360cae313702cd Paul Mackerras 2018-10-08 276
360cae313702cd Paul Mackerras 2018-10-08 277 if (vcpu->kvm->arch.l1_ptcr == 0)
360cae313702cd Paul Mackerras 2018-10-08 278 return H_NOT_AVAILABLE;
360cae313702cd Paul Mackerras 2018-10-08 279
360cae313702cd Paul Mackerras 2018-10-08 280 /* copy parameters in */
360cae313702cd Paul Mackerras 2018-10-08 281 hv_ptr = kvmppc_get_gpr(vcpu, 4);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 282 regs_ptr = kvmppc_get_gpr(vcpu, 5);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 283 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
afe75049303f75 Ravi Bangoria 2020-12-16 284 err = kvmhv_read_guest_state_and_regs(vcpu, &l2_hv, &l2_regs,
afe75049303f75 Ravi Bangoria 2020-12-16 285 hv_ptr, regs_ptr);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 286 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
360cae313702cd Paul Mackerras 2018-10-08 287 if (err)
360cae313702cd Paul Mackerras 2018-10-08 288 return H_PARAMETER;
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 289
10b5022db7861a Suraj Jitindar Singh 2018-10-08 290 if (kvmppc_need_byteswap(vcpu))
10b5022db7861a Suraj Jitindar Singh 2018-10-08 291 byteswap_hv_regs(&l2_hv);
afe75049303f75 Ravi Bangoria 2020-12-16 292 if (l2_hv.version > HV_GUEST_STATE_VERSION)
360cae313702cd Paul Mackerras 2018-10-08 293 return H_P2;
360cae313702cd Paul Mackerras 2018-10-08 294
10b5022db7861a Suraj Jitindar Singh 2018-10-08 295 if (kvmppc_need_byteswap(vcpu))
10b5022db7861a Suraj Jitindar Singh 2018-10-08 296 byteswap_pt_regs(&l2_regs);
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08 297 if (l2_hv.vcpu_token >= NR_CPUS)
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08 298 return H_PARAMETER;
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08 299
360cae313702cd Paul Mackerras 2018-10-08 300 /* translate lpid */
360cae313702cd Paul Mackerras 2018-10-08 301 l2 = kvmhv_get_nested(vcpu->kvm, l2_hv.lpid, true);
360cae313702cd Paul Mackerras 2018-10-08 302 if (!l2)
360cae313702cd Paul Mackerras 2018-10-08 303 return H_PARAMETER;
360cae313702cd Paul Mackerras 2018-10-08 304 if (!l2->l1_gr_to_hr) {
360cae313702cd Paul Mackerras 2018-10-08 305 mutex_lock(&l2->tlb_lock);
360cae313702cd Paul Mackerras 2018-10-08 306 kvmhv_update_ptbl_cache(l2);
360cae313702cd Paul Mackerras 2018-10-08 307 mutex_unlock(&l2->tlb_lock);
360cae313702cd Paul Mackerras 2018-10-08 308 }
360cae313702cd Paul Mackerras 2018-10-08 309
360cae313702cd Paul Mackerras 2018-10-08 310 /* save l1 values of things */
360cae313702cd Paul Mackerras 2018-10-08 311 vcpu->arch.regs.msr = vcpu->arch.shregs.msr;
360cae313702cd Paul Mackerras 2018-10-08 312 saved_l1_regs = vcpu->arch.regs;
360cae313702cd Paul Mackerras 2018-10-08 313 kvmhv_save_hv_regs(vcpu, &saved_l1_hv);
360cae313702cd Paul Mackerras 2018-10-08 314
360cae313702cd Paul Mackerras 2018-10-08 315 /* convert TB values/offsets to host (L0) values */
360cae313702cd Paul Mackerras 2018-10-08 316 hdec_exp = l2_hv.hdec_expiry - vc->tb_offset;
360cae313702cd Paul Mackerras 2018-10-08 317 vc->tb_offset += l2_hv.tb_offset;
360cae313702cd Paul Mackerras 2018-10-08 318
360cae313702cd Paul Mackerras 2018-10-08 319 /* set L1 state to L2 state */
360cae313702cd Paul Mackerras 2018-10-08 320 vcpu->arch.nested = l2;
360cae313702cd Paul Mackerras 2018-10-08 321 vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
360cae313702cd Paul Mackerras 2018-10-08 322 vcpu->arch.regs = l2_regs;
360cae313702cd Paul Mackerras 2018-10-08 323 vcpu->arch.shregs.msr = vcpu->arch.regs.msr;
360cae313702cd Paul Mackerras 2018-10-08 324 mask = LPCR_DPFD | LPCR_ILE | LPCR_TC | LPCR_AIL | LPCR_LD |
360cae313702cd Paul Mackerras 2018-10-08 325 LPCR_LPES | LPCR_MER;
360cae313702cd Paul Mackerras 2018-10-08 326 lpcr = (vc->lpcr & ~mask) | (l2_hv.lpcr & mask);
73937deb4b2d7f Suraj Jitindar Singh 2018-10-08 327 sanitise_hv_regs(vcpu, &l2_hv);
360cae313702cd Paul Mackerras 2018-10-08 328 restore_hv_regs(vcpu, &l2_hv);
360cae313702cd Paul Mackerras 2018-10-08 329
360cae313702cd Paul Mackerras 2018-10-08 330 vcpu->arch.ret = RESUME_GUEST;
360cae313702cd Paul Mackerras 2018-10-08 331 vcpu->arch.trap = 0;
360cae313702cd Paul Mackerras 2018-10-08 332 do {
360cae313702cd Paul Mackerras 2018-10-08 333 if (mftb() >= hdec_exp) {
360cae313702cd Paul Mackerras 2018-10-08 334 vcpu->arch.trap = BOOK3S_INTERRUPT_HV_DECREMENTER;
360cae313702cd Paul Mackerras 2018-10-08 335 r = RESUME_HOST;
360cae313702cd Paul Mackerras 2018-10-08 336 break;
360cae313702cd Paul Mackerras 2018-10-08 337 }
8c99d34578628b Tianjia Zhang 2020-04-27 338 r = kvmhv_run_single_vcpu(vcpu, hdec_exp, lpcr);
360cae313702cd Paul Mackerras 2018-10-08 339 } while (is_kvmppc_resume_guest(r));
360cae313702cd Paul Mackerras 2018-10-08 340
360cae313702cd Paul Mackerras 2018-10-08 341 /* save L2 state for return */
360cae313702cd Paul Mackerras 2018-10-08 342 l2_regs = vcpu->arch.regs;
360cae313702cd Paul Mackerras 2018-10-08 343 l2_regs.msr = vcpu->arch.shregs.msr;
360cae313702cd Paul Mackerras 2018-10-08 344 delta_purr = vcpu->arch.purr - l2_hv.purr;
360cae313702cd Paul Mackerras 2018-10-08 345 delta_spurr = vcpu->arch.spurr - l2_hv.spurr;
360cae313702cd Paul Mackerras 2018-10-08 346 delta_ic = vcpu->arch.ic - l2_hv.ic;
360cae313702cd Paul Mackerras 2018-10-08 347 delta_vtb = vc->vtb - l2_hv.vtb;
360cae313702cd Paul Mackerras 2018-10-08 348 save_hv_return_state(vcpu, vcpu->arch.trap, &l2_hv);
360cae313702cd Paul Mackerras 2018-10-08 349
360cae313702cd Paul Mackerras 2018-10-08 350 /* restore L1 state */
360cae313702cd Paul Mackerras 2018-10-08 351 vcpu->arch.nested = NULL;
360cae313702cd Paul Mackerras 2018-10-08 352 vcpu->arch.regs = saved_l1_regs;
360cae313702cd Paul Mackerras 2018-10-08 353 vcpu->arch.shregs.msr = saved_l1_regs.msr & ~MSR_TS_MASK;
360cae313702cd Paul Mackerras 2018-10-08 354 /* set L1 MSR TS field according to L2 transaction state */
360cae313702cd Paul Mackerras 2018-10-08 355 if (l2_regs.msr & MSR_TS_MASK)
360cae313702cd Paul Mackerras 2018-10-08 356 vcpu->arch.shregs.msr |= MSR_TS_S;
360cae313702cd Paul Mackerras 2018-10-08 357 vc->tb_offset = saved_l1_hv.tb_offset;
360cae313702cd Paul Mackerras 2018-10-08 358 restore_hv_regs(vcpu, &saved_l1_hv);
360cae313702cd Paul Mackerras 2018-10-08 359 vcpu->arch.purr += delta_purr;
360cae313702cd Paul Mackerras 2018-10-08 360 vcpu->arch.spurr += delta_spurr;
360cae313702cd Paul Mackerras 2018-10-08 361 vcpu->arch.ic += delta_ic;
360cae313702cd Paul Mackerras 2018-10-08 362 vc->vtb += delta_vtb;
360cae313702cd Paul Mackerras 2018-10-08 363
360cae313702cd Paul Mackerras 2018-10-08 364 kvmhv_put_nested(l2);
360cae313702cd Paul Mackerras 2018-10-08 365
360cae313702cd Paul Mackerras 2018-10-08 366 /* copy l2_hv_state and regs back to guest */
10b5022db7861a Suraj Jitindar Singh 2018-10-08 367 if (kvmppc_need_byteswap(vcpu)) {
10b5022db7861a Suraj Jitindar Singh 2018-10-08 368 byteswap_hv_regs(&l2_hv);
10b5022db7861a Suraj Jitindar Singh 2018-10-08 369 byteswap_pt_regs(&l2_regs);
10b5022db7861a Suraj Jitindar Singh 2018-10-08 370 }
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 371 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
afe75049303f75 Ravi Bangoria 2020-12-16 372 err = kvmhv_write_guest_state_and_regs(vcpu, &l2_hv, &l2_regs,
afe75049303f75 Ravi Bangoria 2020-12-16 373 hv_ptr, regs_ptr);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09 374 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
360cae313702cd Paul Mackerras 2018-10-08 375 if (err)
360cae313702cd Paul Mackerras 2018-10-08 376 return H_AUTHORITY;
360cae313702cd Paul Mackerras 2018-10-08 377
360cae313702cd Paul Mackerras 2018-10-08 378 if (r == -EINTR)
360cae313702cd Paul Mackerras 2018-10-08 379 return H_INTERRUPT;
360cae313702cd Paul Mackerras 2018-10-08 380
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14 381 if (vcpu->mmio_needed) {
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14 382 kvmhv_nested_mmio_needed(vcpu, regs_ptr);
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14 383 return H_TOO_HARD;
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14 384 }
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14 385
360cae313702cd Paul Mackerras 2018-10-08 386 return vcpu->arch.trap;
360cae313702cd Paul Mackerras 2018-10-08 387 }
360cae313702cd Paul Mackerras 2018-10-08 388
:::::: The code at line 264 was first introduced by commit
:::::: 360cae313702cdd0b90f82c261a8302fecef030a KVM: PPC: Book3S HV: Nested guest entry via hypercall
:::::: TO: Paul Mackerras <paulus(a)ozlabs.org>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[linux-next:master 5116/5396] mm/memory.c:710:25: sparse: sparse: cast to non-scalar
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: f6b46ef27317b3441138b902689bd89e4f82c6f4
commit: ce50e82c1d69532fc05721ed7951480c8525e7fd [5116/5396] mm: device exclusive memory access
config: alpha-randconfig-s032-20210526 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout ce50e82c1d69532fc05721ed7951480c8525e7fd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:710:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:710:25: sparse: sparse: cast from non-scalar
mm/memory.c:1024:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
mm/memory.c:1721:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
mm/memory.c:1770:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
mm/memory.c:2272:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
mm/memory.c:2528:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
mm/memory.c:2816:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
mm/memory.c:3162:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
mm/memory.c:3225:19: sparse: sparse: context imbalance in 'do_wp_page' - different lock contexts for basic block
mm/memory.c: note: in included file (through include/linux/mm.h, arch/alpha/include/asm/io.h, include/linux/io.h, include/linux/irq.h, ...):
include/linux/pgtable.h:257:16: sparse: sparse: cast to non-scalar
include/linux/pgtable.h:257:16: sparse: sparse: cast from non-scalar
mm/memory.c:4823:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
mm/memory.c:4944:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock
vim +710 mm/memory.c
702
703 static void restore_exclusive_pte(struct vm_area_struct *vma,
704 struct page *page, unsigned long address,
705 pte_t *ptep)
706 {
707 pte_t pte;
708 swp_entry_t entry;
709
> 710 pte = pte_mkold(mk_pte(page, READ_ONCE(vma->vm_page_prot)));
711 if (pte_swp_soft_dirty(*ptep))
712 pte = pte_mksoft_dirty(pte);
713
714 entry = pte_to_swp_entry(*ptep);
715 if (pte_swp_uffd_wp(*ptep))
716 pte = pte_mkuffd_wp(pte);
717 else if (is_writable_device_exclusive_entry(entry))
718 pte = maybe_mkwrite(pte_mkdirty(pte), vma);
719
720 set_pte_at(vma->vm_mm, address, ptep, pte);
721
722 /*
723 * No need to take a page reference as one was already
724 * created when the swap entry was made.
725 */
726 if (PageAnon(page))
727 page_add_anon_rmap(page, vma, address, false);
728 else
729 /*
730 * Currently device exclusive access only supports anonymous
731 * memory so the entry shouldn't point to a filebacked page.
732 */
733 WARN_ON_ONCE(!PageAnon(page));
734
735 if (vma->vm_flags & VM_LOCKED)
736 mlock_vma_page(page);
737
738 /*
739 * No need to invalidate - it was non-present before. However
740 * secondary CPUs may have mappings that need invalidating.
741 */
742 update_mmu_cache(vma, address, ptep);
743 }
744
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH v1 2/3] scsi: ufs: Optimize host lock on transfer requests send/compl paths
by kernel test robot
Hi Can,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on next-20210524]
[cannot apply to scsi/for-next v5.13-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Can-Guo/Optimize-host-lock-on-TR...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: arm64-randconfig-r011-20210524 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 93d1e5822ed64abd777eb94ea9899e96c4c39fbe)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/efe94162bf7973be4ed6496871b9bc9ea...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Can-Guo/Optimize-host-lock-on-TR-send-compl-paths-and-utilize-UTRLCNR/20210524-163847
git checkout efe94162bf7973be4ed6496871b9bc9ea54e2819
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/scsi/ufs/ufshcd.c:2959:6: warning: variable 'lrbp' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:2981:32: note: uninitialized use occurs here
(struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
^~~~
drivers/scsi/ufs/ufshcd.c:2959:2: note: remove the 'if' if its condition is always false
if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:2939:25: note: initialize the variable 'lrbp' to silence this warning
struct ufshcd_lrb *lrbp;
^
= NULL
1 warning generated.
vim +2959 drivers/scsi/ufs/ufshcd.c
2924
2925 /**
2926 * ufshcd_exec_dev_cmd - API for sending device management requests
2927 * @hba: UFS hba
2928 * @cmd_type: specifies the type (NOP, Query...)
2929 * @timeout: time in seconds
2930 *
2931 * NOTE: Since there is only one available tag for device management commands,
2932 * it is expected you hold the hba->dev_cmd.lock mutex.
2933 */
2934 static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
2935 enum dev_cmd_type cmd_type, int timeout)
2936 {
2937 struct request_queue *q = hba->cmd_queue;
2938 struct request *req;
2939 struct ufshcd_lrb *lrbp;
2940 int err;
2941 int tag;
2942 struct completion wait;
2943
2944 down_read(&hba->clk_scaling_lock);
2945
2946 /*
2947 * Get free slot, sleep if slots are unavailable.
2948 * Even though we use wait_event() which sleeps indefinitely,
2949 * the maximum wait time is bounded by SCSI request timeout.
2950 */
2951 req = blk_get_request(q, REQ_OP_DRV_OUT, 0);
2952 if (IS_ERR(req)) {
2953 err = PTR_ERR(req);
2954 goto out_unlock;
2955 }
2956 tag = req->tag;
2957 WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag));
2958
> 2959 if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
2960 err = -EBUSY;
2961 goto out;
2962 }
2963
2964 init_completion(&wait);
2965 lrbp = &hba->lrb[tag];
2966 WARN_ON(lrbp->cmd);
2967 err = ufshcd_compose_dev_cmd(hba, lrbp, cmd_type, tag);
2968 if (unlikely(err))
2969 goto out_put_tag;
2970
2971 hba->dev_cmd.complete = &wait;
2972
2973 ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
2974 /* Make sure descriptors are ready before ringing the doorbell */
2975 wmb();
2976
2977 ufshcd_send_command(hba, tag);
2978 err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout);
2979 out:
2980 ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
2981 (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
2982
2983 out_put_tag:
2984 blk_put_request(req);
2985 out_unlock:
2986 up_read(&hba->clk_scaling_lock);
2987 return err;
2988 }
2989
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[mtd:nand/next 6/7] drivers/mtd/nand/raw/qcom_nandc.c:765:7: error: 'nandc' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
head: 612a421079a7fa3042fd713eb62b455aac1a0e88
commit: 4ea7f88f173804f344988f580fb41ba96f7666da [6/7] mtd: rawnand: qcom: avoid writing to obsolete register
config: arc-randconfig-p001-20210510 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
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://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?id=...
git remote add mtd https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
git fetch --no-tags mtd nand/next
git checkout 4ea7f88f173804f344988f580fb41ba96f7666da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/mtd/nand/raw/qcom_nandc.c: In function 'update_rw_regs':
>> drivers/mtd/nand/raw/qcom_nandc.c:765:7: error: 'nandc' undeclared (first use in this function)
765 | if (!nandc->props->qpic_v2)
| ^~~~~
drivers/mtd/nand/raw/qcom_nandc.c:765:7: note: each undeclared identifier is reported only once for each function it appears in
vim +/nandc +765 drivers/mtd/nand/raw/qcom_nandc.c
724
725 /*
726 * update_rw_regs: set up read/write register values, these will be
727 * written to the NAND controller registers via DMA
728 *
729 * @num_cw: number of steps for the read/write operation
730 * @read: read or write operation
731 * @cw : which code word
732 */
733 static void update_rw_regs(struct qcom_nand_host *host, int num_cw, bool read, int cw)
734 {
735 struct nand_chip *chip = &host->chip;
736 u32 cmd, cfg0, cfg1, ecc_bch_cfg;
737
738 if (read) {
739 if (host->use_ecc)
740 cmd = OP_PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE;
741 else
742 cmd = OP_PAGE_READ | PAGE_ACC | LAST_PAGE;
743 } else {
744 cmd = OP_PROGRAM_PAGE | PAGE_ACC | LAST_PAGE;
745 }
746
747 if (host->use_ecc) {
748 cfg0 = (host->cfg0 & ~(7U << CW_PER_PAGE)) |
749 (num_cw - 1) << CW_PER_PAGE;
750
751 cfg1 = host->cfg1;
752 ecc_bch_cfg = host->ecc_bch_cfg;
753 } else {
754 cfg0 = (host->cfg0_raw & ~(7U << CW_PER_PAGE)) |
755 (num_cw - 1) << CW_PER_PAGE;
756
757 cfg1 = host->cfg1_raw;
758 ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
759 }
760
761 nandc_set_reg(chip, NAND_FLASH_CMD, cmd);
762 nandc_set_reg(chip, NAND_DEV0_CFG0, cfg0);
763 nandc_set_reg(chip, NAND_DEV0_CFG1, cfg1);
764 nandc_set_reg(chip, NAND_DEV0_ECC_CFG, ecc_bch_cfg);
> 765 if (!nandc->props->qpic_v2)
766 nandc_set_reg(chip, NAND_EBI2_ECC_BUF_CFG, host->ecc_buf_cfg);
767 nandc_set_reg(chip, NAND_FLASH_STATUS, host->clrflashstatus);
768 nandc_set_reg(chip, NAND_READ_STATUS, host->clrreadstatus);
769 nandc_set_reg(chip, NAND_EXEC_CMD, 1);
770
771 if (read)
772 nandc_set_read_loc(chip, cw, 0, 0, host->use_ecc ?
773 host->cw_data : host->cw_size, 1);
774 }
775
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year