kernel/livepatch/../sched/sched.h:1619:25: sparse: sparse: incompatible types in comparison expression (different address spaces):

From: kernel test robot
Date: Fri Jan 15 2021 - 02:47:23 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 146620506274bd24d52fb1c589110a30eed8240b
commit: 4104a562e0ca62e971089db9d3c47794a0d7d4eb sched/core: Annotate curr pointer in rq with __rcu
date: 11 months ago
config: x86_64-randconfig-s032-20210115 (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/torvalds/linux.git/commit/?id=4104a562e0ca62e971089db9d3c47794a0d7d4eb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4104a562e0ca62e971089db9d3c47794a0d7d4eb
# 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@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
kernel/livepatch/transition.c: note: in included file:
>> kernel/livepatch/../sched/sched.h:1619:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/livepatch/../sched/sched.h:1619:25: sparse: struct task_struct [noderef] <asn:4> *
>> kernel/livepatch/../sched/sched.h:1619:25: sparse: struct task_struct *

vim +1619 kernel/livepatch/../sched/sched.h

029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 1616
029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 1617 static inline int task_current(struct rq *rq, struct task_struct *p)
029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 1618 {
029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 @1619 return rq->curr == p;
029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 1620 }
029632fbb7b7c9d8 kernel/sched.h Peter Zijlstra 2011-10-25 1621

:::::: The code at line 1619 was first introduced by commit
:::::: 029632fbb7b7c9d85063cc9eb470de6c54873df3 sched: Make separate sched*.c translation units

:::::: TO: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip