Re: [linux-next:master 10260/11993] kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/1/22 05:05, kernel test robot wrote:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   274d7803837da78dfc911bcda0d593412676fc20
commit: c0a581d7126c0bbc96163276f585fd7b4e4d8d0e [10260/11993] tracing: Disable interrupt or preemption before acquiring arch_spinlock_t
config: loongarch-randconfig-s031-20220925
compiler: loongarch64-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c0a581d7126c0bbc96163276f585fd7b4e4d8d0e
         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 c0a581d7126c0bbc96163276f585fd7b4e4d8d0e
         # save the config file
         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash kernel/trace/ mm/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>

sparse warnings: (new ones prefixed by >>)
    kernel/trace/trace.c:406:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct trace_export **list @@     got struct trace_export [noderef] __rcu ** @@
    kernel/trace/trace.c:406:28: sparse:     expected struct trace_export **list
    kernel/trace/trace.c:406:28: sparse:     got struct trace_export [noderef] __rcu **
    kernel/trace/trace.c:420:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct trace_export **list @@     got struct trace_export [noderef] __rcu ** @@
    kernel/trace/trace.c:420:33: sparse:     expected struct trace_export **list
    kernel/trace/trace.c:420:33: sparse:     got struct trace_export [noderef] __rcu **
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got unsigned int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got unsigned int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got unsigned int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got unsigned int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got int [noderef] __percpu *
kernel/trace/trace.c:2430:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
    kernel/trace/trace.c:2430:9: sparse:     expected void *ptr
    kernel/trace/trace.c:2430:9: sparse:     got int [noderef] __percpu *
    kernel/trace/trace.c:2879:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct event_filter *filter @@     got struct event_filter [noderef] __rcu *filter @@
    kernel/trace/trace.c:2879:38: sparse:     expected struct event_filter *filter
    kernel/trace/trace.c:2879:38: sparse:     got struct event_filter [noderef] __rcu *filter
    kernel/trace/trace.c:7354:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got struct ring_buffer_event *[noderef] __percpu * @@
    kernel/trace/trace.c:7354:20: sparse:     expected void *ptr
    kernel/trace/trace.c:7354:20: sparse:     got struct ring_buffer_event *[noderef] __percpu *
    kernel/trace/trace.c:7354:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got struct ring_buffer_event *[noderef] __percpu * @@
    kernel/trace/trace.c:7354:20: sparse:     expected void *ptr
    kernel/trace/trace.c:7354:20: sparse:     got struct ring_buffer_event *[noderef] __percpu *
    kernel/trace/trace.c:7354:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got struct ring_buffer_event *[noderef] __percpu * @@
    kernel/trace/trace.c:7354:20: sparse:     expected void *ptr
    kernel/trace/trace.c:7354:20: sparse:     got struct ring_buffer_event *[noderef] __percpu *
    kernel/trace/trace.c:7354:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got struct ring_buffer_event *[noderef] __percpu * @@
    kernel/trace/trace.c:7354:20: sparse:     expected void *ptr
    kernel/trace/trace.c:7354:20: sparse:     got struct ring_buffer_event *[noderef] __percpu *
    kernel/trace/trace.c:360:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
    kernel/trace/trace.c:360:9: sparse:    struct trace_export [noderef] __rcu *
    kernel/trace/trace.c:360:9: sparse:    struct trace_export *
    kernel/trace/trace.c:375:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
    kernel/trace/trace.c:375:9: sparse:    struct trace_export [noderef] __rcu *
    kernel/trace/trace.c:375:9: sparse:    struct trace_export *

vim +2430 kernel/trace/trace.c

   2410	
   2411	static int trace_save_cmdline(struct task_struct *tsk)
   2412	{
   2413		unsigned tpid, idx;
   2414	
   2415		/* treat recording of idle task as a success */
   2416		if (!tsk->pid)
   2417			return 1;
   2418	
   2419		tpid = tsk->pid & (PID_MAX_DEFAULT - 1);
   2420	
   2421		/*
   2422		 * It's not the end of the world if we don't get
   2423		 * the lock, but we also don't want to spin
   2424		 * nor do we want to disable interrupts,
   2425		 * so if we miss here, then better luck next time.
   2426		 *
   2427		 * This is called within the scheduler and wake up, so interrupts
   2428		 * had better been disabled and run queue lock been held.
   2429		 */
2430		lockdep_assert_preemption_disabled();

This assertion has been present in other parts of the kernel for a long time. The given config file is for loongarch64-linux-gcc. Does that happen in other more tested arches like x86 or arm64? If not, it is a probably a bug in the arch specific code in how it defines different address spaces as I saw other similar different address spaces warnings.

-Longman





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux