blob: 25ee92bdae06a96b5d03d906245cbaac7c929266 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
QEMU LoongArch regression after merging LASX changes
Description of problem:
After enabling LASX in qemu (@gaosong), booting Gentoo Linux with latest glibc master (w/ LSX & LASX optimized libc routines) will fail in systemd:
```
[ 10.350207] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000085
[ 10.350557] CPU: 5 PID: 1 Comm: systemd Not tainted 6.5.2-gentoo #2
[ 10.350655] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
[ 10.350961] Stack : 0072617764726148 0000000000000000 9000000000223440 90000001000e4000
[ 10.351181] 90000001000e7990 90000001000e7998 0000000000000000 90000001000e7ad8
[ 10.351294] 90000001000e7ad0 90000001000e7ad0 90000001000e7900 0000000000000001
[ 10.351406] 0000000000000001 90000001000e7998 ec94a2e1446052e6 9000000100438140
[ 10.351519] 0000000000000001 0000000000000003 0000000000000000 0000000000000030
[ 10.351630] 0000000000000000 00000000000559bf 00000000056e0000 0000000000000004
[ 10.351745] 0000000000000000 0000000000000000 900000000162b438 900000000177e000
[ 10.351856] 00000000400004d8 0000000000000001 0000000000000018 90000001000e7c84
[ 10.351968] 0000000000020000 0000000000000000 9000000000223458 00007ffff0341af0
[ 10.352081] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c
[ 10.352196] ...
[ 10.352277] Call Trace:
[ 10.352482] [<9000000000223458>] show_stack+0x5c/0x180
[ 10.353518] [<9000000001178d4c>] dump_stack_lvl+0x60/0x88
[ 10.353592] [<900000000115cd7c>] panic+0x13c/0x308
[ 10.353670] [<900000000024244c>] do_exit+0x860/0x868
[ 10.353735] [<900000000024261c>] do_group_exit+0x34/0x94
[ 10.353803] [<9000000000250514>] get_signal+0x75c/0x804
[ 10.353869] [<90000000002254c4>] arch_do_signal_or_restart+0x74/0xae0
[ 10.353944] [<90000000002c738c>] exit_to_user_mode_loop.isra.0+0x90/0x10c
[ 10.354041] [<9000000001179ff0>] irqentry_exit_to_user_mode+0x1c/0x28
[ 10.354119] [<90000000011792f8>] do_bp+0xcc/0x2ac
[ 10.354222] [<90000001005a1924>] 0x90000001005a1924
[ 10.354522] [<00007ffff0341af0>] 0x7ffff0341af0
```
Full log:
[stderr](/uploads/61b9870ae2441c9a25f44791c67889b8/stderr)
Instruction trace `-d in_asm,out_asm,op` (very large):
[log.tar.zstd](https://cloud.tsinghua.edu.cn/f/a83eac6d44694ede8cb1/?dl=1)
I also tried to boot LoongArchLinux whose glibc does not have LSX/LASX optimized C routines, and it can boot without problems. If I chroot from LoongArchLinux into Gentoo Linux, running `emerge` command will SIGSEGV.
If I disable LASX in CPUCFG2, the problem is gone:
```cpp
// data = FIELD_DP32(data, CPUCFG2, LASX, 1),
```
I guess the bug is related to LASX assemblies in [glibc](https://github.com/bminor/glibc/tree/master/sysdeps/loongarch/lp64/multiarch).
Steps to reproduce:
1. Launch qemu
2. Wait for systemd to be killed
3. Collect logs
Additional information:
|