<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/linux/module_symbol.h, branch v6.6-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>modpost, kallsyms: Treat add '$'-prefixed symbols as mapping symbols</title>
<updated>2023-07-24T19:09:47+00:00</updated>
<author>
<name>Palmer Dabbelt</name>
<email>palmer@rivosinc.com</email>
</author>
<published>2023-07-21T15:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff09f6fd297293175eaa0ed492495e36b3eb1a8e'/>
<id>ff09f6fd297293175eaa0ed492495e36b3eb1a8e</id>
<content type='text'>
Trying to restrict the '$'-prefix change to RISC-V caused some fallout,
so let's just treat all those symbols as special.

Fixes: c05780ef3c190 ("module: Ignore RISC-V mapping symbols too")
Link: https://lore.kernel.org/all/20230712015747.77263-1-wangkefeng.wang@huawei.com/
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Reviewed-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trying to restrict the '$'-prefix change to RISC-V caused some fallout,
so let's just treat all those symbols as special.

Fixes: c05780ef3c190 ("module: Ignore RISC-V mapping symbols too")
Link: https://lore.kernel.org/all/20230712015747.77263-1-wangkefeng.wang@huawei.com/
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Reviewed-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>module: Ignore RISC-V mapping symbols too</title>
<updated>2023-07-10T19:45:23+00:00</updated>
<author>
<name>Palmer Dabbelt</name>
<email>palmer@rivosinc.com</email>
</author>
<published>2023-07-07T16:00:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c05780ef3c190c2dafbf0be8e65d4f01103ad577'/>
<id>c05780ef3c190c2dafbf0be8e65d4f01103ad577</id>
<content type='text'>
RISC-V has an extended form of mapping symbols that we use to encode
the ISA when it changes in the middle of an ELF.  This trips up modpost
as a build failure, I haven't yet verified it yet but I believe the
kallsyms difference should result in stacks looking sane again.

Reported-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Closes: https://lore.kernel.org/all/9d9e2902-5489-4bf0-d9cb-556c8e5d71c2@infradead.org/
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt; # build-tested
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RISC-V has an extended form of mapping symbols that we use to encode
the ISA when it changes in the middle of an ELF.  This trips up modpost
as a build failure, I haven't yet verified it yet but I believe the
kallsyms difference should result in stacks looking sane again.

Reported-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Closes: https://lore.kernel.org/all/9d9e2902-5489-4bf0-d9cb-556c8e5d71c2@infradead.org/
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt; # build-tested
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>module: Ignore L0 and rename is_arm_mapping_symbol()</title>
<updated>2023-04-14T00:15:50+00:00</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2023-03-31T09:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0a3bf86092c38f7b72c56c6901c78dd302411307'/>
<id>0a3bf86092c38f7b72c56c6901c78dd302411307</id>
<content type='text'>
The L0 symbol is generated when build module on LoongArch, ignore it in
modpost and when looking at module symbols, otherwise we can not see the
expected call trace.

Now is_arm_mapping_symbol() is not only for ARM, in order to reflect the
reality, rename is_arm_mapping_symbol() to is_mapping_symbol().

This is related with commit c17a2538704f ("mksysmap: Fix the mismatch of
'L0' symbols in System.map").

(1) Simple test case

  [loongson@linux hello]$ cat hello.c
  #include &lt;linux/init.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/printk.h&gt;

  static void test_func(void)
  {
  	  pr_info("This is a test\n");
	  dump_stack();
  }

  static int __init hello_init(void)
  {
	  pr_warn("Hello, world\n");
	  test_func();

	  return 0;
  }

  static void __exit hello_exit(void)
  {
	  pr_warn("Goodbye\n");
  }

  module_init(hello_init);
  module_exit(hello_exit);
  MODULE_LICENSE("GPL");
  [loongson@linux hello]$ cat Makefile
  obj-m:=hello.o

  ccflags-y += -g -Og

  all:
	  make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
  clean:
	  make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean

(2) Test environment

system: LoongArch CLFS 5.5
https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/tag/5.0
It needs to update grub to avoid booting error "invalid magic number".

kernel: 6.3-rc1 with loongson3_defconfig + CONFIG_DYNAMIC_FTRACE=y

(3) Test result

Without this patch:

  [root@linux hello]# insmod hello.ko
  [root@linux hello]# dmesg
  ...
  Hello, world
  This is a test
  ...
  Call Trace:
  [&lt;9000000000223728&gt;] show_stack+0x68/0x18c
  [&lt;90000000013374cc&gt;] dump_stack_lvl+0x60/0x88
  [&lt;ffff800002050028&gt;] L0\x01+0x20/0x2c [hello]
  [&lt;ffff800002058028&gt;] L0\x01+0x20/0x30 [hello]
  [&lt;900000000022097c&gt;] do_one_initcall+0x88/0x288
  [&lt;90000000002df890&gt;] do_init_module+0x54/0x200
  [&lt;90000000002e1e18&gt;] __do_sys_finit_module+0xc4/0x114
  [&lt;90000000013382e8&gt;] do_syscall+0x7c/0x94
  [&lt;9000000000221e3c&gt;] handle_syscall+0xbc/0x158

With this patch:

  [root@linux hello]# insmod hello.ko
  [root@linux hello]# dmesg
  ...
  Hello, world
  This is a test
  ...
  Call Trace:
  [&lt;9000000000223728&gt;] show_stack+0x68/0x18c
  [&lt;90000000013374cc&gt;] dump_stack_lvl+0x60/0x88
  [&lt;ffff800002050028&gt;] test_func+0x28/0x34 [hello]
  [&lt;ffff800002058028&gt;] hello_init+0x28/0x38 [hello]
  [&lt;900000000022097c&gt;] do_one_initcall+0x88/0x288
  [&lt;90000000002df890&gt;] do_init_module+0x54/0x200
  [&lt;90000000002e1e18&gt;] __do_sys_finit_module+0xc4/0x114
  [&lt;90000000013382e8&gt;] do_syscall+0x7c/0x94
  [&lt;9000000000221e3c&gt;] handle_syscall+0xbc/0x158

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Tested-by: Youling Tang &lt;tangyouling@loongson.cn&gt; # for LoongArch
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The L0 symbol is generated when build module on LoongArch, ignore it in
modpost and when looking at module symbols, otherwise we can not see the
expected call trace.

Now is_arm_mapping_symbol() is not only for ARM, in order to reflect the
reality, rename is_arm_mapping_symbol() to is_mapping_symbol().

This is related with commit c17a2538704f ("mksysmap: Fix the mismatch of
'L0' symbols in System.map").

(1) Simple test case

  [loongson@linux hello]$ cat hello.c
  #include &lt;linux/init.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/printk.h&gt;

  static void test_func(void)
  {
  	  pr_info("This is a test\n");
	  dump_stack();
  }

  static int __init hello_init(void)
  {
	  pr_warn("Hello, world\n");
	  test_func();

	  return 0;
  }

  static void __exit hello_exit(void)
  {
	  pr_warn("Goodbye\n");
  }

  module_init(hello_init);
  module_exit(hello_exit);
  MODULE_LICENSE("GPL");
  [loongson@linux hello]$ cat Makefile
  obj-m:=hello.o

  ccflags-y += -g -Og

  all:
	  make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
  clean:
	  make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean

(2) Test environment

system: LoongArch CLFS 5.5
https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/tag/5.0
It needs to update grub to avoid booting error "invalid magic number".

kernel: 6.3-rc1 with loongson3_defconfig + CONFIG_DYNAMIC_FTRACE=y

(3) Test result

Without this patch:

  [root@linux hello]# insmod hello.ko
  [root@linux hello]# dmesg
  ...
  Hello, world
  This is a test
  ...
  Call Trace:
  [&lt;9000000000223728&gt;] show_stack+0x68/0x18c
  [&lt;90000000013374cc&gt;] dump_stack_lvl+0x60/0x88
  [&lt;ffff800002050028&gt;] L0\x01+0x20/0x2c [hello]
  [&lt;ffff800002058028&gt;] L0\x01+0x20/0x30 [hello]
  [&lt;900000000022097c&gt;] do_one_initcall+0x88/0x288
  [&lt;90000000002df890&gt;] do_init_module+0x54/0x200
  [&lt;90000000002e1e18&gt;] __do_sys_finit_module+0xc4/0x114
  [&lt;90000000013382e8&gt;] do_syscall+0x7c/0x94
  [&lt;9000000000221e3c&gt;] handle_syscall+0xbc/0x158

With this patch:

  [root@linux hello]# insmod hello.ko
  [root@linux hello]# dmesg
  ...
  Hello, world
  This is a test
  ...
  Call Trace:
  [&lt;9000000000223728&gt;] show_stack+0x68/0x18c
  [&lt;90000000013374cc&gt;] dump_stack_lvl+0x60/0x88
  [&lt;ffff800002050028&gt;] test_func+0x28/0x34 [hello]
  [&lt;ffff800002058028&gt;] hello_init+0x28/0x38 [hello]
  [&lt;900000000022097c&gt;] do_one_initcall+0x88/0x288
  [&lt;90000000002df890&gt;] do_init_module+0x54/0x200
  [&lt;90000000002e1e18&gt;] __do_sys_finit_module+0xc4/0x114
  [&lt;90000000013382e8&gt;] do_syscall+0x7c/0x94
  [&lt;9000000000221e3c&gt;] handle_syscall+0xbc/0x158

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Tested-by: Youling Tang &lt;tangyouling@loongson.cn&gt; # for LoongArch
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>module: Move is_arm_mapping_symbol() to module_symbol.h</title>
<updated>2023-04-14T00:15:49+00:00</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2023-03-31T09:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=987d2e0aaa55de40938435be760aa96428470fd6'/>
<id>987d2e0aaa55de40938435be760aa96428470fd6</id>
<content type='text'>
In order to avoid duplicated code, move is_arm_mapping_symbol() to
include/linux/module_symbol.h, then remove is_arm_mapping_symbol()
in the other places.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to avoid duplicated code, move is_arm_mapping_symbol() to
include/linux/module_symbol.h, then remove is_arm_mapping_symbol()
in the other places.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
