llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: kernel test robot <lkp@intel.com>, Nam Cao <namcao@linutronix.de>,
	 Palmer Dabbelt <palmer@dabbelt.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	 linux-kernel@vger.kernel.org,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: Re: kernel/trace/rv/monitors/sleep/sleep.c:130:7: error: use of undeclared identifier '__NR_clock_nanosleep'
Date: Mon, 18 Aug 2025 09:42:20 +0200	[thread overview]
Message-ID: <9ee2ad87e78a87d0d4ff0aee6fc7cf01c21f7cf7.camel@redhat.com> (raw)
In-Reply-To: <202508160204.SsFyNfo6-lkp@intel.com>

On Sat, 2025-08-16 at 02:37 +0800, kernel test robot wrote:
> tree:  
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ma
> ster
> head:   ee94b00c1a648530333d9734200be7a45e6e00cd
> commit: f74f8bb246cf22f27752977da62079cb615f55b2 rv: Add rtapp_sleep
> monitor
> date:   5 weeks ago
> config: riscv-randconfig-001-20250816
> (https://download.01.org/0day-ci/archive/20250816/202508160204.SsFyNf
> o6-lkp@intel.com/config)
> compiler: clang version 22.0.0git
> (https://github.com/llvm/llvm-project 93d24b6b7b148c47a2fa228a4ef3152
> 4fa1d9f3f)
> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20250816/202508160204.SsFyNf
> o6-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new
> version of
> the same patch/commit), kindly add following tags
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202508160204.SsFyNfo6-lkp@intel.com/
> 

Palmer, this issue is what you fix in
https://lore.kernel.org/lkml/20250804194518.97620-2-palmer@dabbelt.com/
, right?

> All errors (new ones prefixed by >>):
> 
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:804:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      804 |         insb(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:104:53: note: expanded from macro
> 'insb'
>      104 | #define insb(addr, buffer, count) __insb(PCI_IOBASE +
> (addr), buffer, count)
>          |                                          ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:812:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      812 |         insw(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:105:53: note: expanded from macro
> 'insw'
>      105 | #define insw(addr, buffer, count) __insw(PCI_IOBASE +
> (addr), buffer, count)
>          |                                          ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:820:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      820 |         insl(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:106:53: note: expanded from macro
> 'insl'
>      106 | #define insl(addr, buffer, count) __insl(PCI_IOBASE +
> (addr), buffer, count)
>          |                                          ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:829:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      829 |         outsb(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:118:55: note: expanded from macro
> 'outsb'
>      118 | #define outsb(addr, buffer, count) __outsb(PCI_IOBASE +
> (addr), buffer, count)
>          |                                            ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:838:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      838 |         outsw(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:119:55: note: expanded from macro
> 'outsw'
>      119 | #define outsw(addr, buffer, count) __outsw(PCI_IOBASE +
> (addr), buffer, count)
>          |                                            ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:847:2: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>      847 |         outsl(addr, buffer, count);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/io.h:120:55: note: expanded from macro
> 'outsl'
>      120 | #define outsl(addr, buffer, count) __outsl(PCI_IOBASE +
> (addr), buffer, count)
>          |                                            ~~~~~~~~~~ ^
>    In file included from kernel/trace/rv/monitors/sleep/sleep.c:2:
>    In file included from include/linux/ftrace.h:10:
>    In file included from include/linux/trace_recursion.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from
> ./arch/riscv/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/riscv/include/asm/io.h:136:
>    include/asm-generic/io.h:1175:55: warning: performing pointer
> arithmetic on a null pointer has undefined behavior [-Wnull-pointer-
> arithmetic]
>     1175 |         return (port > MMIO_UPPER_LIMIT) ? NULL :
> PCI_IOBASE + port;
>          |                                                  
> ~~~~~~~~~~ ^
> > > kernel/trace/rv/monitors/sleep/sleep.c:130:7: error: use of
> > > undeclared identifier '__NR_clock_nanosleep'
>      130 |         case __NR_clock_nanosleep:
>          |              ^~~~~~~~~~~~~~~~~~~~
> > > kernel/trace/rv/monitors/sleep/sleep.c:141:7: error: use of
> > > undeclared identifier '__NR_futex'
>      141 |         case __NR_futex:
>          |              ^~~~~~~~~~
>    7 warnings and 2 errors generated.
> 
> 
> vim +/__NR_clock_nanosleep +130
> kernel/trace/rv/monitors/sleep/sleep.c
> 
>    120	
>    121	static void handle_sys_enter(void *data, struct pt_regs
> *regs, long id)
>    122	{
>    123		struct ltl_monitor *mon;
>    124		unsigned long args[6];
>    125		int op, cmd;
>    126	
>    127		mon = ltl_get_monitor(current);
>    128	
>    129		switch (id) {
>  > 130		case __NR_clock_nanosleep:
>    131	#ifdef __NR_clock_nanosleep_time64
>    132		case __NR_clock_nanosleep_time64:
>    133	#endif
>    134			syscall_get_arguments(current, regs, args);
>    135			ltl_atom_set(mon,
> LTL_NANOSLEEP_CLOCK_MONOTONIC, args[0] == CLOCK_MONOTONIC);
>    136			ltl_atom_set(mon, LTL_NANOSLEEP_CLOCK_TAI,
> args[0] == CLOCK_TAI);
>    137			ltl_atom_set(mon,
> LTL_NANOSLEEP_TIMER_ABSTIME, args[1] == TIMER_ABSTIME);
>    138			ltl_atom_update(current,
> LTL_CLOCK_NANOSLEEP, true);
>    139			break;
>    140	
>  > 141		case __NR_futex:
>    142	#ifdef __NR_futex_time64
>    143		case __NR_futex_time64:
>    144	#endif
>    145			syscall_get_arguments(current, regs, args);
>    146			op = args[1];
>    147			cmd = op & FUTEX_CMD_MASK;
>    148	
>    149			switch (cmd) {
>    150			case FUTEX_LOCK_PI:
>    151			case FUTEX_LOCK_PI2:
>    152				ltl_atom_update(current,
> LTL_FUTEX_LOCK_PI, true);
>    153				break;
>    154			case FUTEX_WAIT:
>    155			case FUTEX_WAIT_BITSET:
>    156			case FUTEX_WAIT_REQUEUE_PI:
>    157				ltl_atom_update(current,
> LTL_FUTEX_WAIT, true);
>    158				break;
>    159			}
>    160			break;
>    161		}
>    162	}
>    163	


  reply	other threads:[~2025-08-18  7:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 18:37 kernel/trace/rv/monitors/sleep/sleep.c:130:7: error: use of undeclared identifier '__NR_clock_nanosleep' kernel test robot
2025-08-18  7:42 ` Gabriele Monaco [this message]
2025-08-18 17:54   ` Palmer Dabbelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ee2ad87e78a87d0d4ff0aee6fc7cf01c21f7cf7.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=namcao@linutronix.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).