Linux-csky Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH] csky: Fixup calltrace panic
@ 2020-05-17 17:52 Guenter Roeck
  2020-05-20  7:50 ` Guo Ren
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2020-05-17 17:52 UTC (permalink / raw)
  To: Guo Ren; +Cc: linux-csky, linux-kernel

Hi,

On Wed, May 13, 2020 at 03:15:25PM +0800, Guo Ren wrote:
> The implementation of show_stack will panic with wrong fp:
> 
> addr    = *fp++;
> 
> because the fp isn't checked properly.
> 
> The current implementations of show_stack, wchan and stack_trace
> haven't been designed properly, so just deprecate them.
> 
> This patch is a reference to riscv's way, all codes are modified from
> arm's. The patch is passed with:
> 
>  - cat /proc/<pid>/stack
>  - cat /proc/<pid>/wchan
>  - echo c > /proc/sysrq-trigger
> 
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>

This patch results in:

gcc version: csky-linux-gcc (GCC) 9.3.0

Building csky:defconfig ... failed
--------------
Error log:
csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [prepare0] Error 2
make: *** [sub-make] Error 2

when trying to build csky images with upstream gcc 9.3.0.

What version of gcc is needed to build csky images ? Also, would it be
possible to support the upstream version of gcc ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] csky: Fixup calltrace panic
  2020-05-17 17:52 [PATCH] csky: Fixup calltrace panic Guenter Roeck
@ 2020-05-20  7:50 ` Guo Ren
  2020-05-21 14:46   ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Guo Ren @ 2020-05-20  7:50 UTC (permalink / raw)
  To: Guenter Roeck, 瞿仙淼, 尚云海
  Cc: Guo Ren, linux-csky, Linux Kernel Mailing List

Hi Guenter,

> 在 2020年5月18日,上午1:52,Guenter Roeck <linux@roeck-us.net> 写道:
> 
> Hi,
> 
> On Wed, May 13, 2020 at 03:15:25PM +0800, Guo Ren wrote:
>> The implementation of show_stack will panic with wrong fp:
>> 
>> addr    = *fp++;
>> 
>> because the fp isn't checked properly.
>> 
>> The current implementations of show_stack, wchan and stack_trace
>> haven't been designed properly, so just deprecate them.
>> 
>> This patch is a reference to riscv's way, all codes are modified from
>> arm's. The patch is passed with:
>> 
>> - cat /proc/<pid>/stack
>> - cat /proc/<pid>/wchan
>> - echo c > /proc/sysrq-trigger
>> 
>> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> 
> This patch results in:
> 
> gcc version: csky-linux-gcc (GCC) 9.3.0
> 
> Building csky:defconfig ... failed
> --------------
> Error log:
> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
> make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
> make[2]: *** Waiting for unfinished jobs....
> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
> make[2]: *** [scripts/mod/empty.o] Error 1
> make[1]: *** [prepare0] Error 2
> make: *** [sub-make] Error 2
> 
> when trying to build csky images with upstream gcc 9.3.0.
> 
> What version of gcc is needed to build csky images ? Also, would it be
> possible to support the upstream version of gcc ?
> 

We tested it with https://github.com/c-sky/gcc (gcc-6.3)

You can fast test with:


 wget -nc https://gitlab.com/c-sky/buildroot/-/jobs/557072746/artifacts/raw/output/images/toolchain_thead_860_compat_next_glibc_br_defconfig_8f1b5cd7d85509fbafea935ec65c48add73bba07.tar.xz

 mkdir -p host
 tar -Jxf toolchain_thead_860_compat_next_glibc_br_defconfig_8f1b5cd7d85509fbafea935ec65c48add73bba07.tar.xz -C host

 cd linux-xxx

 LD_LIBRARY_PATH=../host/lib make ARCH=csky CROSS_COMPILE=../host/bin/csky-linux- Image


We will upstream -mbacktrace to gcc.org

> Thanks,
> Guenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] csky: Fixup calltrace panic
  2020-05-20  7:50 ` Guo Ren
@ 2020-05-21 14:46   ` Guenter Roeck
  2020-05-22 15:28     ` Guo Ren
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2020-05-21 14:46 UTC (permalink / raw)
  To: Guo Ren, 瞿仙淼, 尚云海
  Cc: Guo Ren, linux-csky, Linux Kernel Mailing List

On 5/20/20 12:50 AM, Guo Ren wrote:
> Hi Guenter,
> 
>> 在 2020年5月18日,上午1:52,Guenter Roeck <linux@roeck-us.net> 写道:
>>
>> Hi,
>>
>> On Wed, May 13, 2020 at 03:15:25PM +0800, Guo Ren wrote:
>>> The implementation of show_stack will panic with wrong fp:
>>>
>>> addr    = *fp++;
>>>
>>> because the fp isn't checked properly.
>>>
>>> The current implementations of show_stack, wchan and stack_trace
>>> haven't been designed properly, so just deprecate them.
>>>
>>> This patch is a reference to riscv's way, all codes are modified from
>>> arm's. The patch is passed with:
>>>
>>> - cat /proc/<pid>/stack
>>> - cat /proc/<pid>/wchan
>>> - echo c > /proc/sysrq-trigger
>>>
>>> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
>>
>> This patch results in:
>>
>> gcc version: csky-linux-gcc (GCC) 9.3.0
>>
>> Building csky:defconfig ... failed
>> --------------
>> Error log:
>> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
>> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
>> make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
>> make[2]: *** Waiting for unfinished jobs....
>> csky-linux-gcc: error: unrecognized command line option '-mbacktrace'; did you mean '-fbacktrace'?
>> make[2]: *** [scripts/mod/empty.o] Error 1
>> make[1]: *** [prepare0] Error 2
>> make: *** [sub-make] Error 2
>>
>> when trying to build csky images with upstream gcc 9.3.0.
>>
>> What version of gcc is needed to build csky images ? Also, would it be
>> possible to support the upstream version of gcc ?
>>
> 
> We tested it with https://github.com/c-sky/gcc (gcc-6.3)
> 

That won't work for me. You really might want to consider
supporting upstream gcc. I'll try disabling CONFIG_STACKTRACE
for csky build tests. If that doesn't work, I may have to
disable affected csky build tests for the time being.

Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] csky: Fixup calltrace panic
  2020-05-21 14:46   ` Guenter Roeck
@ 2020-05-22 15:28     ` Guo Ren
  2020-05-22 21:28       ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Guo Ren @ 2020-05-22 15:28 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Guo Ren, 瞿仙淼, 尚云海,
	Guo Ren, linux-csky, Linux Kernel Mailing List

Hi,

On Thu, May 21, 2020 at 10:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > We tested it with https://github.com/c-sky/gcc (gcc-6.3)
> >
>
> That won't work for me. You really might want to consider
> supporting upstream gcc. I'll try disabling CONFIG_STACKTRACE
> for csky build tests. If that doesn't work, I may have to
> disable affected csky build tests for the time being.
>
> Guenter

Not only CONFIG_STACKTRACE,
Disable FRAME_POINTER (Kernel hacking -> Compile the kernel with frame pointers)

because in Makefile:
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -mbacktrace
endif

We'll upstream -mbacktrace to gcc 9 soon, sorry for the confusion. Thx
for your work on maintaining.

-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] csky: Fixup calltrace panic
  2020-05-22 15:28     ` Guo Ren
@ 2020-05-22 21:28       ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2020-05-22 21:28 UTC (permalink / raw)
  To: Guo Ren
  Cc: Guo Ren, 瞿仙淼, 尚云海,
	Guo Ren, linux-csky, Linux Kernel Mailing List

On 5/22/20 8:28 AM, Guo Ren wrote:
> Hi,
> 
> On Thu, May 21, 2020 at 10:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>> We tested it with https://github.com/c-sky/gcc (gcc-6.3)
>>>
>>
>> That won't work for me. You really might want to consider
>> supporting upstream gcc. I'll try disabling CONFIG_STACKTRACE
>> for csky build tests. If that doesn't work, I may have to
>> disable affected csky build tests for the time being.
>>
>> Guenter
> 
> Not only CONFIG_STACKTRACE,
> Disable FRAME_POINTER (Kernel hacking -> Compile the kernel with frame pointers)
> 

You are correct. This is what my test builder now does:

Build reference: v5.7-rc6-37-g115a54162a6c
gcc version: csky-linux-gcc (GCC) 9.3.0

Configuration file workarounds:
    "s/CONFIG_FRAME_POINTER=y/# CONFIG_FRAME_POINTER is not set/"

Building csky:defconfig ... passed
Building csky:allnoconfig ... passed
Building csky:tinyconfig ... passed

Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 17:52 [PATCH] csky: Fixup calltrace panic Guenter Roeck
2020-05-20  7:50 ` Guo Ren
2020-05-21 14:46   ` Guenter Roeck
2020-05-22 15:28     ` Guo Ren
2020-05-22 21:28       ` Guenter Roeck

Linux-csky Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-csky/0 linux-csky/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-csky linux-csky/ https://lore.kernel.org/linux-csky \
		linux-csky@vger.kernel.org
	public-inbox-index linux-csky

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-csky


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git