mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: kbuild-all@01.org, Richard Henderson <rth@twiddle.net>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	Elvira Khabirova <lineprinter@altlinux.org>,
	Eugene Syromyatnikov <esyr@redhat.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 03/22] alpha: define remaining syscall_get_* functions
Date: Mon, 7 Jan 2019 15:25:40 +0800	[thread overview]
Message-ID: <201901071513.DvXGPqpe%fengguang.wu@intel.com> (raw)
In-Reply-To: <20190107025257.GC1207@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 12923 bytes --]

Hi Dmitry,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.0-rc1 next-20190103]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dmitry-V-Levin/asm-generic-syscall-h-prepare-for-inclusion-by-other-files/20190107-115241
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=alpha 

All warnings (new ones prefixed by >>):

   In file included from arch/alpha/include/asm/syscall.h:6:0,
                    from include/linux/audit.h:214,
                    from net/bridge/netfilter/ebtables.c:29:
   include/asm-generic/syscall.h:61:1: warning: 'syscall_rollback' declared 'static' but never defined [-Wunused-function]
    syscall_rollback(struct task_struct *task, struct pt_regs *regs);
    ^~~~~~~~~~~~~~~~
   include/asm-generic/syscall.h:106:1: warning: 'syscall_set_return_value' declared 'static' but never defined [-Wunused-function]
    syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
    ^~~~~~~~~~~~~~~~~~~~~~~~
>> include/asm-generic/syscall.h:174:1: warning: '__syscall_set_arguments' used but never defined
    __syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
    ^~~~~~~~~~~~~~~~~~~~~~~

vim +/__syscall_set_arguments +174 include/asm-generic/syscall.h

828c365c Roland McGrath  2008-07-25   43  
828c365c Roland McGrath  2008-07-25   44  /**
828c365c Roland McGrath  2008-07-25   45   * syscall_rollback - roll back registers after an aborted system call
828c365c Roland McGrath  2008-07-25   46   * @task:	task of interest, must be in system call exit tracing
828c365c Roland McGrath  2008-07-25   47   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25   48   *
828c365c Roland McGrath  2008-07-25   49   * It's only valid to call this when @task is stopped for system
828c365c Roland McGrath  2008-07-25   50   * call exit tracing (due to TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT),
828c365c Roland McGrath  2008-07-25   51   * after tracehook_report_syscall_entry() returned nonzero to prevent
828c365c Roland McGrath  2008-07-25   52   * the system call from taking place.
828c365c Roland McGrath  2008-07-25   53   *
828c365c Roland McGrath  2008-07-25   54   * This rolls back the register state in @regs so it's as if the
828c365c Roland McGrath  2008-07-25   55   * system call instruction was a no-op.  The registers containing
828c365c Roland McGrath  2008-07-25   56   * the system call number and arguments are as they were before the
828c365c Roland McGrath  2008-07-25   57   * system call instruction.  This may not be the same as what the
828c365c Roland McGrath  2008-07-25   58   * register state looked like at system call entry tracing.
828c365c Roland McGrath  2008-07-25   59   */
ac0321df Dmitry V. Levin 2019-01-07   60  static void
ac0321df Dmitry V. Levin 2019-01-07  @61  syscall_rollback(struct task_struct *task, struct pt_regs *regs);
828c365c Roland McGrath  2008-07-25   62  
828c365c Roland McGrath  2008-07-25   63  /**
828c365c Roland McGrath  2008-07-25   64   * syscall_get_error - check result of traced system call
828c365c Roland McGrath  2008-07-25   65   * @task:	task of interest, must be blocked
828c365c Roland McGrath  2008-07-25   66   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25   67   *
828c365c Roland McGrath  2008-07-25   68   * Returns 0 if the system call succeeded, or -ERRORCODE if it failed.
828c365c Roland McGrath  2008-07-25   69   *
828c365c Roland McGrath  2008-07-25   70   * It's only valid to call this when @task is stopped for tracing on exit
828c365c Roland McGrath  2008-07-25   71   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
828c365c Roland McGrath  2008-07-25   72   */
ac0321df Dmitry V. Levin 2019-01-07   73  static long
ac0321df Dmitry V. Levin 2019-01-07   74  syscall_get_error(struct task_struct *task, struct pt_regs *regs);
828c365c Roland McGrath  2008-07-25   75  
828c365c Roland McGrath  2008-07-25   76  /**
828c365c Roland McGrath  2008-07-25   77   * syscall_get_return_value - get the return value of a traced system call
828c365c Roland McGrath  2008-07-25   78   * @task:	task of interest, must be blocked
828c365c Roland McGrath  2008-07-25   79   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25   80   *
828c365c Roland McGrath  2008-07-25   81   * Returns the return value of the successful system call.
828c365c Roland McGrath  2008-07-25   82   * This value is meaningless if syscall_get_error() returned nonzero.
828c365c Roland McGrath  2008-07-25   83   *
828c365c Roland McGrath  2008-07-25   84   * It's only valid to call this when @task is stopped for tracing on exit
828c365c Roland McGrath  2008-07-25   85   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
828c365c Roland McGrath  2008-07-25   86   */
ac0321df Dmitry V. Levin 2019-01-07   87  static long
ac0321df Dmitry V. Levin 2019-01-07   88  syscall_get_return_value(struct task_struct *task, struct pt_regs *regs);
828c365c Roland McGrath  2008-07-25   89  
828c365c Roland McGrath  2008-07-25   90  /**
828c365c Roland McGrath  2008-07-25   91   * syscall_set_return_value - change the return value of a traced system call
828c365c Roland McGrath  2008-07-25   92   * @task:	task of interest, must be blocked
828c365c Roland McGrath  2008-07-25   93   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25   94   * @error:	negative error code, or zero to indicate success
828c365c Roland McGrath  2008-07-25   95   * @val:	user return value if @error is zero
828c365c Roland McGrath  2008-07-25   96   *
828c365c Roland McGrath  2008-07-25   97   * This changes the results of the system call that user mode will see.
828c365c Roland McGrath  2008-07-25   98   * If @error is zero, the user sees a successful system call with a
828c365c Roland McGrath  2008-07-25   99   * return value of @val.  If @error is nonzero, it's a negated errno
828c365c Roland McGrath  2008-07-25  100   * code; the user sees a failed system call with this errno code.
828c365c Roland McGrath  2008-07-25  101   *
828c365c Roland McGrath  2008-07-25  102   * It's only valid to call this when @task is stopped for tracing on exit
828c365c Roland McGrath  2008-07-25  103   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
828c365c Roland McGrath  2008-07-25  104   */
ac0321df Dmitry V. Levin 2019-01-07  105  static void
ac0321df Dmitry V. Levin 2019-01-07  106  syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
828c365c Roland McGrath  2008-07-25  107  			 int error, long val);
828c365c Roland McGrath  2008-07-25  108  
828c365c Roland McGrath  2008-07-25  109  /**
828c365c Roland McGrath  2008-07-25  110   * syscall_get_arguments - extract system call parameter values
828c365c Roland McGrath  2008-07-25  111   * @task:	task of interest, must be blocked
828c365c Roland McGrath  2008-07-25  112   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25  113   * @i:		argument index [0,5]
828c365c Roland McGrath  2008-07-25  114   * @n:		number of arguments; n+i must be [1,6].
828c365c Roland McGrath  2008-07-25  115   * @args:	array filled with argument values
828c365c Roland McGrath  2008-07-25  116   *
828c365c Roland McGrath  2008-07-25  117   * Fetches @n arguments to the system call starting with the @i'th argument
828c365c Roland McGrath  2008-07-25  118   * (from 0 through 5).  Argument @i is stored in @args[0], and so on.
828c365c Roland McGrath  2008-07-25  119   * An arch inline version is probably optimal when @i and @n are constants.
828c365c Roland McGrath  2008-07-25  120   *
828c365c Roland McGrath  2008-07-25  121   * It's only valid to call this when @task is stopped for tracing on
828c365c Roland McGrath  2008-07-25  122   * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
828c365c Roland McGrath  2008-07-25  123   * It's invalid to call this with @i + @n > 6; we only support system calls
828c365c Roland McGrath  2008-07-25  124   * taking up to 6 arguments.
5dcf7654 Dmitry V. Levin 2019-01-07  125   *
5dcf7654 Dmitry V. Levin 2019-01-07  126   * This function is a wrapper around arch-specific __syscall_get_arguments.
828c365c Roland McGrath  2008-07-25  127   */
ac0321df Dmitry V. Levin 2019-01-07  128  static void
5dcf7654 Dmitry V. Levin 2019-01-07  129  __syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
828c365c Roland McGrath  2008-07-25  130  			unsigned int i, unsigned int n, unsigned long *args);
828c365c Roland McGrath  2008-07-25  131  
5dcf7654 Dmitry V. Levin 2019-01-07  132  static inline void
5dcf7654 Dmitry V. Levin 2019-01-07  133  syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
5dcf7654 Dmitry V. Levin 2019-01-07  134  		      unsigned int i, unsigned int n, unsigned long *args)
5dcf7654 Dmitry V. Levin 2019-01-07  135  {
5dcf7654 Dmitry V. Levin 2019-01-07  136  	/*
5dcf7654 Dmitry V. Levin 2019-01-07  137  	 * Ideally there should have been a BUILD_BUG_ON(i + n > 6)
5dcf7654 Dmitry V. Levin 2019-01-07  138  	 * instead of these checks because it is a "cannot happen"
5dcf7654 Dmitry V. Levin 2019-01-07  139  	 * kind of assertion.
5dcf7654 Dmitry V. Levin 2019-01-07  140  	 */
5dcf7654 Dmitry V. Levin 2019-01-07  141  	if (WARN_ON_ONCE(i > 6)) {
5dcf7654 Dmitry V. Levin 2019-01-07  142  		memset(args, 0, n * sizeof(args[0]));
5dcf7654 Dmitry V. Levin 2019-01-07  143  		return;
5dcf7654 Dmitry V. Levin 2019-01-07  144  	}
5dcf7654 Dmitry V. Levin 2019-01-07  145  	if (WARN_ON_ONCE(n > 6 - i)) {
5dcf7654 Dmitry V. Levin 2019-01-07  146  		unsigned int extra = n - (6 - i);
5dcf7654 Dmitry V. Levin 2019-01-07  147  
5dcf7654 Dmitry V. Levin 2019-01-07  148  		n = 6 - i;
5dcf7654 Dmitry V. Levin 2019-01-07  149  		memset(&args[n], 0, extra * sizeof(args[0]));
5dcf7654 Dmitry V. Levin 2019-01-07  150  	}
5dcf7654 Dmitry V. Levin 2019-01-07  151  	__syscall_get_arguments(task, regs, i, n, args);
5dcf7654 Dmitry V. Levin 2019-01-07  152  }
5dcf7654 Dmitry V. Levin 2019-01-07  153  
828c365c Roland McGrath  2008-07-25  154  /**
828c365c Roland McGrath  2008-07-25  155   * syscall_set_arguments - change system call parameter value
828c365c Roland McGrath  2008-07-25  156   * @task:	task of interest, must be in system call entry tracing
828c365c Roland McGrath  2008-07-25  157   * @regs:	task_pt_regs() of @task
828c365c Roland McGrath  2008-07-25  158   * @i:		argument index [0,5]
828c365c Roland McGrath  2008-07-25  159   * @n:		number of arguments; n+i must be [1,6].
828c365c Roland McGrath  2008-07-25  160   * @args:	array of argument values to store
828c365c Roland McGrath  2008-07-25  161   *
828c365c Roland McGrath  2008-07-25  162   * Changes @n arguments to the system call starting with the @i'th argument.
22f30168 Roland McGrath  2008-09-05  163   * Argument @i gets value @args[0], and so on.
828c365c Roland McGrath  2008-07-25  164   * An arch inline version is probably optimal when @i and @n are constants.
828c365c Roland McGrath  2008-07-25  165   *
828c365c Roland McGrath  2008-07-25  166   * It's only valid to call this when @task is stopped for tracing on
828c365c Roland McGrath  2008-07-25  167   * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
828c365c Roland McGrath  2008-07-25  168   * It's invalid to call this with @i + @n > 6; we only support system calls
828c365c Roland McGrath  2008-07-25  169   * taking up to 6 arguments.
5dcf7654 Dmitry V. Levin 2019-01-07  170   *
5dcf7654 Dmitry V. Levin 2019-01-07  171   * This function is a wrapper around arch-specific __syscall_set_arguments.
828c365c Roland McGrath  2008-07-25  172   */
ac0321df Dmitry V. Levin 2019-01-07  173  static void
5dcf7654 Dmitry V. Levin 2019-01-07 @174  __syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
828c365c Roland McGrath  2008-07-25  175  			unsigned int i, unsigned int n,
828c365c Roland McGrath  2008-07-25  176  			const unsigned long *args);
828c365c Roland McGrath  2008-07-25  177  

:::::: The code at line 174 was first introduced by commit
:::::: 5dcf7654462a65216387a92e06b3ae1c268bd581 asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers

:::::: TO: Dmitry V. Levin <ldv@altlinux.org>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 55458 bytes --]

  reply	other threads:[~2019-01-07  8:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190107025101.GA1182@altlinux.org>
2019-01-07  2:52 ` [PATCH v7 01/22] asm-generic/syscall.h: prepare for inclusion by other files Dmitry V. Levin
2019-01-07  2:52 ` [PATCH v7 02/22] asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers Dmitry V. Levin
2019-01-07  2:52 ` [PATCH v7 03/22] alpha: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  7:25   ` kbuild test robot [this message]
2019-01-07  2:53 ` [PATCH v7 04/22] Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 05/22] arc: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 06/22] c6x: " Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 07/22] h8300: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 08/22] Move EM_HEXAGON to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 09/22] hexagon: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 10/22] Move EM_NDS32 to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 11/22] nds32: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 12/22] nios2: " Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 13/22] m68k: add asm/syscall.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 14/22] mips: define syscall_get_error() Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 15/22] parisc: " Dmitry V. Levin
2019-02-28 19:38   ` Dmitry V. Levin
2019-02-28 21:39     ` Helge Deller
2019-01-07  2:54 ` [PATCH v7 16/22] powerpc: " Dmitry V. Levin
2019-02-28 19:39   ` Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 17/22] riscv: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 18/22] Move EM_UNICORE to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 19/22] unicore32: add asm/syscall.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 20/22] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 21/22] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2019-01-07  7:05   ` kbuild test robot
2019-01-07 14:58     ` Dmitry V. Levin
     [not found]   ` <201901071430.4jk67u0s%fengguang.wu@intel.com>
2019-01-07 12:54     ` [PATCH] nds32: fix asm/syscall.h Dmitry V. Levin
2019-02-28 21:58       ` Dmitry V. Levin
2019-01-07  2:55 ` [PATCH v7 22/22] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin

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=201901071513.DvXGPqpe%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=esyr@redhat.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=kbuild-all@01.org \
    --cc=ldv@altlinux.org \
    --cc=lineprinter@altlinux.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mattst88@gmail.com \
    --cc=oleg@redhat.com \
    --cc=rth@twiddle.net \
    /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

all inboxes | Powered by JetHome®