From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: kernel test robot <lkp@intel.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly
Date: Mon, 19 Oct 2020 20:23:21 +0200 [thread overview]
Message-ID: <2253e9bc-8fe1-e823-2cc4-45ba9fe66d1f@csgroup.eu> (raw)
In-Reply-To: <202010192300.35IC9AK7-lkp@intel.com>
Le 19/10/2020 à 17:35, kernel test robot a écrit :
> Hi Christophe,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on linus/master next-20201016]
> [cannot apply to kvm-ppc/kvm-ppc-next mpe/next v5.9]
> [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/0day-ci/linux/commits/Christophe-Leroy/powerpc-uaccess-Don-t-use-m-constraint-with-GCC-4-9/20201019-201504
> base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc64-randconfig-r012-20201019 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 094e9f4779eb9b5c6a49014f2f80b8cbb833572f)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install powerpc64 cross compiling tool for clang build
> # apt-get install binutils-powerpc64-linux-gnu
> # https://github.com/0day-ci/linux/commit/d57fd8d270993414b8c0414d7be4b03cc3de1856
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Christophe-Leroy/powerpc-uaccess-Don-t-use-m-constraint-with-GCC-4-9/20201019-201504
> git checkout d57fd8d270993414b8c0414d7be4b03cc3de1856
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> In file included from arch/powerpc/kernel/asm-offsets.c:14:
> In file included from include/linux/compat.h:14:
> In file included from include/linux/sem.h:5:
> In file included from include/uapi/linux/sem.h:5:
> In file included from include/linux/ipc.h:5:
> In file included from include/linux/spinlock.h:51:
> In file included from include/linux/preempt.h:78:
> In file included from ./arch/powerpc/include/generated/asm/preempt.h:1:
> In file included from include/asm-generic/preempt.h:5:
> In file included from include/linux/thread_info.h:21:
> In file included from arch/powerpc/include/asm/current.h:13:
> In file included from arch/powerpc/include/asm/paca.h:31:
> In file included from arch/powerpc/include/asm/atomic.h:13:
> In file included from arch/powerpc/include/asm/ppc_asm.h:9:
> In file included from arch/powerpc/include/asm/processor.h:40:
>>> arch/powerpc/include/asm/ptrace.h:288:20: error: use of undeclared identifier 'THREAD_SIZE'
> return ((addr & ~(THREAD_SIZE - 1)) ==
> ^
> arch/powerpc/include/asm/ptrace.h:289:35: error: use of undeclared identifier 'THREAD_SIZE'
> (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
Most likely a circular inclusion problem.
I'll have to put it in a header that doesn't include pile of other stuff. The least bad candidate
seems to be asm-const.h
Christophe
> ^
> In file included from arch/powerpc/kernel/asm-offsets.c:21:
> include/linux/mman.h:137:9: warning: division by zero is undefined [-Wdivision-by-zero]
> _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/mman.h:115:21: note: expanded from macro '_calc_vm_trans'
> : ((x) & (bit1)) / ((bit1) / (bit2))))
> ^ ~~~~~~~~~~~~~~~~~
> include/linux/mman.h:138:9: warning: division by zero is undefined [-Wdivision-by-zero]
> _calc_vm_trans(flags, MAP_SYNC, VM_SYNC );
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/mman.h:115:21: note: expanded from macro '_calc_vm_trans'
> : ((x) & (bit1)) / ((bit1) / (bit2))))
> ^ ~~~~~~~~~~~~~~~~~
> 2 warnings and 2 errors generated.
> make[2]: *** [scripts/Makefile.build:117: arch/powerpc/kernel/asm-offsets.s] Error 1
> make[2]: Target '__build' not remade because of errors.
> make[1]: *** [Makefile:1202: prepare0] Error 2
> make[1]: Target 'prepare' not remade because of errors.
> make: *** [Makefile:185: __sub-make] Error 2
> make: Target 'prepare' not remade because of errors.
>
> vim +/THREAD_SIZE +288 arch/powerpc/include/asm/ptrace.h
>
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 275
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 276 /**
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 277 * regs_within_kernel_stack() - check the address in the stack
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 278 * @regs: pt_regs which contains kernel stack pointer.
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 279 * @addr: address which is checked.
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 280 *
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 281 * regs_within_kernel_stack() checks @addr is within the kernel stack page(s).
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 282 * If @addr is within the kernel stack, it returns true. If not, returns false.
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 283 */
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 284
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 285 static inline bool regs_within_kernel_stack(struct pt_regs *regs,
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 286 unsigned long addr)
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 287 {
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 @288 return ((addr & ~(THREAD_SIZE - 1)) ==
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 289 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 290 }
> 359e4284a3f37ab Mahesh Salgaonkar 2010-04-07 291
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
next prev parent reply other threads:[~2020-10-19 18:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 12:12 [PATCH 1/3] powerpc/uaccess: Don't use "m<>" constraint with GCC 4.9 Christophe Leroy
2020-10-19 12:12 ` [PATCH 2/3] powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at Christophe Leroy
2020-10-19 20:14 ` Segher Boessenkool
2020-10-19 12:12 ` [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly Christophe Leroy
2020-10-19 15:35 ` kernel test robot
2020-10-19 18:23 ` Christophe Leroy [this message]
2020-10-19 20:24 ` Segher Boessenkool
2020-10-20 7:44 ` Christophe Leroy
2020-10-20 11:51 ` Segher Boessenkool
2020-10-19 20:10 ` [PATCH 1/3] powerpc/uaccess: Don't use "m<>" constraint with GCC 4.9 Segher Boessenkool
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=2253e9bc-8fe1-e823-2cc4-45ba9fe66d1f@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=benh@kernel.crashing.org \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
--cc=mpe@ellerman.id.au \
--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).