Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kernel panic on FX8300 with CONFIG_MNATIVE_AMD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
druggo
Guru
Guru


Joined: 24 Sep 2003
Posts: 318
Location: Hangzhou, China

PostPosted: Sun Sep 22, 2024 8:03 am    Post subject: kernel panic on FX8300 with CONFIG_MNATIVE_AMD Reply with quote

I used CONFIG_MNATIVE_AMD many years for Phenom 9950,
recently I upgrade CPU to FX8300, and recompile the kernel, but it will got a panic:
Code:

md/raid1: md10: active with 2 out of 2 mirrors
md10: detected capacity change from 0 to 204672
md/raid10: md23: active with 2 out of 2 devices
md23: detected capacity change from 0 to 3906557952
EXT4-fs (md11): orphan cleanup on readonly fs
EXT4-fs (md11): mounted filesystem dad3b33e-bc54-4b3c-b09f-f1ad559a18ef ro with ordered data mode. Quota mode: disabled.
systemd[1]: systemd 256.5 running in system mode (+PAM -AUDIT -SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL -ACL +BLKID +CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 +LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP -SYSVINIT +LIBARCHIVE)
systemd[1]: Detected architecture x86-64.
systemd[1]: Condition check resulted in /sys/devices/virtual/block/md23 being skipped.
systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
systemd[1]: Condition check resulted in /dev/disk/by-id/md-uuid-050cdb5f:6fcbd47f:bd2f6da9:756d8a37 being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-id/md-uuid-36196c19:f8ccc074:ed4f236f:3bc67691 being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-uuid/4b4f1332-ce3b-4c32-9a71-99915792fd3d being skipped.
systemd[1]: Condition check resulted in /dev/md23 being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-id/md-uuid-4ce4a376:29ffcc3d:b5290f86:42d97c71 being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-label/BOOT being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-id/md-name-ypg:23 being skipped.
systemd[1]: Condition check resulted in /dev/md14 being skipped.
systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
systemd[1]: Condition check resulted in /dev/disk/by-uuid/83f5dda4-f74a-4748-b706-cdd529dbf4dd being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-id/md-name-ypg:14 being skipped.
systemd[1]: Condition check resulted in /sys/devices/virtual/block/md10 being skipped.
systemd[1]: Condition check resulted in /dev/disk/by-uuid/65029642-af86-4b8a-a7b6-ff409bd37a4f being skipped.
systemd[1]: Condition check resulted in /sys/devices/virtual/block/md14 being skipped.
systemd[1]: Queued start job for default target Graphical Interface.
jump_label: Fatal kernel bug, unexpected op at __alloc_pages_slowpath.constprop.0+0x5e/0xab0 [(____ptrval____)] (e9 59 07 00 00 != 0f 1f 44 00 00)) size:5 type:1
------------[ cut here ]------------
kernel BUG at arch/x86/kernel/jump_label.c:73!
invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
CPU: 0 PID: 1 Comm: systemd Not tainted 6.6.50-gentoo #4
Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./970A-DS3P, BIOS FD 02/26/2016
RIP: 0010:__jump_label_patch+0x10a/0x110
Code: eb a0 0f 0b 0f 0b 48 c7 c3 48 78 54 8e 41 56 45 89 e1 49 89 d8 4c 89 e9 4c 89 ea 4c 89 ee 48 c7 c7 28 53 df 8d e8 26 10 0b 00 <0f> 0b 90 0f 1f 00 0f 1f 44 00 00 e9 f6 32 97 00 66 0f 1f 44 00 00
RSP: 0018:ffffb66b4001fcc8 EFLAGS: 00010246
RAX: 00000000000000a1 RBX: ffffffff8dc020ca RCX: 0000000000000000
RDX: 0000000000000000 RSI: 00000000fffff7ff RDI: 00000000ffffffff
RBP: ffffb66b4001fcf8 R08: 0000000000000000 R09: 0000000000000003
R10: ffffb66b4001fb80 R11: ffffffff8e071c28 R12: 0000000000000005
R13: ffffffff8d2757ee R14: 0000000000000001 R15: ffffa3ae8033b800
FS:  00007f9493c12c80(0000) GS:ffffa3b1aec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9493a4f2a0 CR3: 0000000101ed0000 CR4: 00000000000406f0
Call Trace:
 <TASK>
 ? die+0x32/0x80
 ? do_trap+0xd2/0x100
 ? __jump_label_patch+0x10a/0x110
 ? do_error_trap+0x65/0x80
 ? __jump_label_patch+0x10a/0x110
 ? exc_invalid_op+0x49/0x60
 ? __jump_label_patch+0x10a/0x110
 ? asm_exc_invalid_op+0x16/0x20
 ? __alloc_pages_slowpath.constprop.0+0x5e/0xab0
 ? __jump_label_patch+0x10a/0x110
 ? __jump_label_patch+0x10a/0x110
 arch_jump_label_transform_queue+0x33/0x70
 __jump_label_update+0x70/0x120
 static_key_slow_inc_cpuslocked+0x49/0x90
 cpuset_css_online+0x65/0x1c0
 online_css+0x1c/0x50
 ? cgroup_apply_control_enable+0x219/0x2e0
 ? cgroup_subtree_control_write+0x354/0x3e0
 ? kernfs_fop_write_iter+0x135/0x1c0
 ? vfs_write+0x205/0x400
 ? ksys_write+0x63/0xe0
 ? do_syscall_64+0x35/0x80
 ? entry_SYSCALL_64_after_hwframe+0x4b/0xb5
 </TASK>
Modules linked in: nfnetlink
---[ end trace 0000000000000000 ]---
RIP: 0010:__jump_label_patch+0x10a/0x110
Code: eb a0 0f 0b 0f 0b 48 c7 c3 48 78 54 8e 41 56 45 89 e1 49 89 d8 4c 89 e9 4c 89 ea 4c 89 ee 48 c7 c7 28 53 df 8d e8 26 10 0b 00 <0f> 0b 90 0f 1f 00 0f 1f 44 00 00 e9 f6 32 97 00 66 0f 1f 44 00 00
RSP: 0018:ffffb66b4001fcc8 EFLAGS: 00010246
RAX: 00000000000000a1 RBX: ffffffff8dc020ca RCX: 0000000000000000
RDX: 0000000000000000 RSI: 00000000fffff7ff RDI: 00000000ffffffff
RBP: ffffb66b4001fcf8 R08: 0000000000000000 R09: 0000000000000003
R10: ffffb66b4001fb80 R11: ffffffff8e071c28 R12: 0000000000000005
R13: ffffffff8d2757ee R14: 0000000000000001 R15: ffffa3ae8033b800
FS:  00007f9493c12c80(0000) GS:ffffa3b1aec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9493a4f2a0 CR3: 0000000101ed0000 CR4: 00000000000406f0
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Kernel Offset: 0xc000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
Rebooting in 15 seconds..


after switch to CONFIG_MPILEDRIVER, the kernel boot smoothly.
shoudn't these two options be the same?
_________________
HighWayToHell(blog)
https://blog.druggo.org/
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1962

PostPosted: Sun Sep 22, 2024 8:33 am    Post subject: Reply with quote

Apparently it broke before in https://github.com/graysky2/kernel_compiler_patch/issues/80. As noted in that bug, objtool relies on being able to understand specific instruction sequences so it can patch them.

You can run the following command to see what the difference is on your machine between -march=native and -march=piledriver:
arch=piledriver; for t in param target optimize optimizer; do cmd="gcc -Q --help=$t"; diff -U0 <(LANG=C $cmd -march=$arch) <(LANG=C $cmd -march=native); done

Can you share its output? Thanks.
Back to top
View user's profile Send private message
druggo
Guru
Guru


Joined: 24 Sep 2003
Posts: 318
Location: Hangzhou, China

PostPosted: Sun Sep 22, 2024 9:18 am    Post subject: Reply with quote

sam_ wrote:
Apparently it broke before in https://github.com/graysky2/kernel_compiler_patch/issues/80. As noted in that bug, objtool relies on being able to understand specific instruction sequences so it can patch them.

You can run the following command to see what the difference is on your machine between -march=native and -march=piledriver:
arch=piledriver; for t in param target optimize optimizer; do cmd="gcc -Q --help=$t"; diff -U0 <(LANG=C $cmd -march=$arch) <(LANG=C $cmd -march=native); done

Can you share its output? Thanks.


Thank you for point out that issue,
now I found the difference is CONFIG_MPILEDRIVER have a additional flags "-mno-tbm", though I don't know how it works:
Code:
cflags-$(CONFIG_MPILEDRIVER)   += -march=bdver2 -mno-tbm


running the diff command got error:
Code:
cc1: error: bad value 'piledriver' for '-march=' switch


the march should be bdver2, and run again, output nothing:
Code:
$ arch=bdver2; for t in param target optimize optimizer; do cmd="gcc -Q --help=$t"; diff -U0 <(LANG=C $cmd -march=$arch) <(LANG=C $cmd -march=native); 
$

_________________
HighWayToHell(blog)
https://blog.druggo.org/
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1962

PostPosted: Sun Sep 22, 2024 9:22 am    Post subject: Reply with quote

Looks like it should really unconditionally add -mno-tbm to be safe, not just for the specific arch...

Can you report a bug to the kernel_compiler_patch repo please and link it here?
Back to top
View user's profile Send private message
druggo
Guru
Guru


Joined: 24 Sep 2003
Posts: 318
Location: Hangzhou, China

PostPosted: Sun Sep 22, 2024 10:38 am    Post subject: Reply with quote

sam_ wrote:
Looks like it should really unconditionally add -mno-tbm to be safe, not just for the specific arch...

Can you report a bug to the kernel_compiler_patch repo please and link it here?


OK, https://github.com/graysky2/kernel_compiler_patch/issues/104
_________________
HighWayToHell(blog)
https://blog.druggo.org/
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1962

PostPosted: Sun Sep 22, 2024 10:51 am    Post subject: Reply with quote

Thank you! I left a comment for upstream.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum