From: kernel test robot <lkp@intel.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
naveen.n.rao@linux.vnet.ibm.com
Cc: kbuild-all@lists.01.org,
Christophe Leroy <christophe.leroy@csgroup.eu>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 21/25] powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target()
Date: Sat, 7 May 2022 19:29:04 +0800 [thread overview]
Message-ID: <202205071900.opHsWE8v-lkp@intel.com> (raw)
In-Reply-To: <921e8d60c847d42f7309feae1936fa0117b7f0d1.1651905939.git.christophe.leroy@csgroup.eu>
Hi Christophe,
I love your patch! Perhaps something to improve:
[auto build test WARNING on powerpc/next]
[also build test WARNING on powerpc/topic/ppc-kvm v5.18-rc5 next-20220506]
[cannot apply to rostedt-trace/for-next]
[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/intel-lab-lkp/linux/commits/Christophe-Leroy/powerpc-ftrace-optimisation-and-cleanup-and-more-v2/20220507-145034
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-s031-20220506 (https://download.01.org/0day-ci/archive/20220507/202205071900.opHsWE8v-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.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.4-dirty
# https://github.com/intel-lab-lkp/linux/commit/1c6a385ed330a6ed959cad02f89306fb84e4334c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Christophe-Leroy/powerpc-ftrace-optimisation-and-cleanup-and-more-v2/20220507-145034
git checkout 1c6a385ed330a6ed959cad02f89306fb84e4334c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/kernel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/kernel/module_32.c:298:43: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected struct ppc_inst_t [usertype] *inst @@ got unsigned int * @@
arch/powerpc/kernel/module_32.c:298:43: sparse: expected struct ppc_inst_t [usertype] *inst
arch/powerpc/kernel/module_32.c:298:43: sparse: got unsigned int *
arch/powerpc/kernel/module_32.c:300:49: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected struct ppc_inst_t [usertype] *inst @@ got unsigned int * @@
arch/powerpc/kernel/module_32.c:300:49: sparse: expected struct ppc_inst_t [usertype] *inst
arch/powerpc/kernel/module_32.c:300:49: sparse: got unsigned int *
arch/powerpc/kernel/module_32.c:302:49: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected struct ppc_inst_t [usertype] *inst @@ got unsigned int * @@
arch/powerpc/kernel/module_32.c:302:49: sparse: expected struct ppc_inst_t [usertype] *inst
arch/powerpc/kernel/module_32.c:302:49: sparse: got unsigned int *
arch/powerpc/kernel/module_32.c:304:49: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected struct ppc_inst_t [usertype] *inst @@ got unsigned int * @@
arch/powerpc/kernel/module_32.c:304:49: sparse: expected struct ppc_inst_t [usertype] *inst
arch/powerpc/kernel/module_32.c:304:49: sparse: got unsigned int *
vim +298 arch/powerpc/kernel/module_32.c
290
291 #ifdef CONFIG_DYNAMIC_FTRACE
292 notrace int module_trampoline_target(struct module *mod, unsigned long addr,
293 unsigned long *target)
294 {
295 unsigned int jmp[4];
296
297 /* Find where the trampoline jumps to */
> 298 if (copy_inst_from_kernel_nofault(jmp, (void *)addr))
299 return -EFAULT;
300 if (__copy_inst_from_kernel_nofault(jmp + 1, (void *)addr + 4))
301 return -EFAULT;
302 if (__copy_inst_from_kernel_nofault(jmp + 2, (void *)addr + 8))
303 return -EFAULT;
304 if (__copy_inst_from_kernel_nofault(jmp + 3, (void *)addr + 12))
305 return -EFAULT;
306
307 /* verify that this is what we expect it to be */
308 if ((jmp[0] & 0xffff0000) != PPC_RAW_LIS(_R12, 0) ||
309 (jmp[1] & 0xffff0000) != PPC_RAW_ADDI(_R12, _R12, 0) ||
310 jmp[2] != PPC_RAW_MTCTR(_R12) ||
311 jmp[3] != PPC_RAW_BCTR())
312 return -EINVAL;
313
314 addr = (jmp[1] & 0xffff) | ((jmp[0] & 0xffff) << 16);
315 if (addr & 0x8000)
316 addr -= 0x10000;
317
318 *target = addr;
319
320 return 0;
321 }
322
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-05-07 11:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 6:46 [PATCH v2 00/25] powerpc: ftrace optimisation and cleanup and more [v2] Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 01/25] powerpc/ftrace: Refactor prepare_ftrace_return() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 02/25] powerpc/ftrace: Remove redundant create_branch() calls Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 03/25] powerpc/code-patching: Inline is_offset_in_{cond}_branch_range() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 04/25] powerpc/ftrace: Use is_offset_in_branch_range() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 05/25] powerpc/code-patching: Inline create_branch() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 06/25] powerpc/ftrace: Inline ftrace_modify_code() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 07/25] powerpc/ftrace: Use patch_instruction() return directly Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 08/25] powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2 Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 09/25] powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2} Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 10/25] powerpc: Finalise cleanup around ABI use Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 11/25] powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64 Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 12/25] powerpc/ftrace: Don't include ftrace.o for CONFIG_FTRACE_SYSCALLS Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 13/25] powerpc/ftrace: Use CONFIG_FUNCTION_TRACER instead of CONFIG_DYNAMIC_FTRACE Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 14/25] powerpc/ftrace: Remove ftrace_plt_tramps[] Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 15/25] powerpc/ftrace: Use BRANCH_SET_LINK instead of value 1 Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 16/25] powerpc/ftrace: Use PPC_RAW_xxx() macros instead of opencoding Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 17/25] powerpc/ftrace: Use size macro " Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 18/25] powerpc/ftrace: Simplify expected_nop_sequence() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 19/25] powerpc/ftrace: Minimise number of #ifdefs Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 20/25] powerpc/inst: Add __copy_inst_from_kernel_nofault() Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 21/25] powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target() Christophe Leroy
2022-05-07 11:29 ` kernel test robot [this message]
2022-05-07 6:46 ` [PATCH v2 22/25] powerpc/inst: Remove PPC_INST_BRANCH Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 23/25] powerpc/modules: Use PPC_LI macros instead of opencoding Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 24/25] powerpc/inst: Remove PPC_INST_BL Christophe Leroy
2022-05-07 6:46 ` [PATCH v2 25/25] powerpc/opcodes: Remove unused PPC_INST_XXX macros Christophe Leroy
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=202205071900.opHsWE8v-lkp@intel.com \
--to=lkp@intel.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@csgroup.eu \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=paulus@samba.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).