View previous topic :: View next topic |
Author |
Message |
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 2:56 am Post subject: kernel panic on boot, invalid opcode: 0000 on i486 |
|
|
recently I've been working on installing Gentoo on an i486 based PC. using an IDE to USB adapter on a 2nd, faster computer I partitioned the disk, extracted the appropriate stage3 tarball, chrooted in and did the necessary bootstrapping to create a working Gentoo Linux installation.
once I put the hard disk into the 486 system is when things go awry. GRUB starts up and loads the kernel, it decompresses, relocates, then as far as the VGA console can see, it hangs forever on "Booting the kernel".
by putting earlyprintk=ttyS0,115200 in the boot command line and using a 2nd device to monitor the serial port, I can see the early logging and I discover it kernel panics very early in the boot process.
here is the output of some kernel configurations I tried
latest stable (6.1.28-gentoo) with close to default configuration
Code: | early console in extract_kernel
input_data: 0x01765094
input_len: 0x0051b1da
output: 0x01000000
output_len: 0x00b970c8
kernel_total_size: 0x00c9a000
needed_size: 0x00c9a000
Physical KASLR using i8254...
Decompressing Linux... Parsing ELF... Performing relocations... done.
Booting the kernel.
[ 0.000000] Linux version 6.1.28-gentoo (root@nobara) (gcc (Gentoo 12.2.1_p20230428-r1 p2) 12.2.1 20230428, GNU ld (Gentoo 2.39 p6) 2.39.0) #4 PREEMPT_DYNAMIC Sat Jun 3 19:29:14 EDT 2023
[ 0.000000] x86/fpu: x87 FPU will use FSAVE
[ 0.000000] signal: max sigframe size: 928
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000040ffbff] usable
[ 0.000000] printk: console [earlyser0] enabled
[ 0.000000] Notice: NX (Execute Disable) protection missing in CPU!
[ 0.000000] DMI not present or invalid.
[ 0.000000] last_pfn = 0x40ff max_arch_pfn = 0x100000
[ 0.000000] Disabled
[ 0.000000] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[ 0.000000] x86/PAT: Configuration [0-7]: WB WT UC- UC WB WT UC- UC
[ 0.000000] 0MB HIGHMEM available.
[ 0.000000] 64MB LOWMEM available.
[ 0.000000] mapped low ram: 0 - 040ff000
[ 0.000000] low ram: 0 - 040ff000
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.000000] Normal [mem 0x0000000001000000-0x00000000040fefff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009ffff]
[ 0.000000] node 0: [mem 0x0000000000100000-0x00000000040fefff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x00000000040fefff]
[ 0.000000] On node 0, zone DMA: 1 pages in unavailable ranges
[ 0.000000] On node 0, zone DMA: 96 pages in unavailable ranges
[ 0.000000] [mem 0x040ffc00-0xffffffff] available for PCI devices
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16412
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-6.1.28-gentoo root=PARTUUID=1b42b416-03 ro earlyprintk=ttyS0,115200,keep
[ 0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/vmlinuz-6.1.28-gentoo", will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[ 0.000000] Initializing HighMem for node 0 (00000000:00000000)
[ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[ 0.000000] Memory: 53048K/66168K available (6065K kernel code, 1897K rwdata, 2792K rodata, 392K init, 504K bss, 13120K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] trace event string verifier disabled
[ 0.000000] Dynamic Preempt: voluntary
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.000000] invalid opcode: 0000 [#1] PREEMPT
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 6.1.28-gentoo #4
[ 0.000000] EIP: start_kernel+0x3a6/0x4af
[ 0.000000] Code: 00 e8 1c c7 00 00 e8 a9 ec 00 00 e8 93 47 00 00 e8 8f e3 01 00 31 d2 8d 45 ec 89 55 ec 89 55 f0 ba 08 00 00 00 e8 0a 38 87 ff <0f> 31 03 45 ec 31 c9 8b 15 d8 1b 0c c3 89 45 ec 89 4d f0 89 82 44
[ 0.000000] EAX: 00000000 EBX: 00000023 ECX: 00000000 EDX: 00000040
[ 0.000000] ESI: c40761c0 EDI: c40761e2 EBP: c30a9fa4 ESP: c30a9f84
[ 0.000000] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210082
[ 0.000000] CR0: 80050033 CR2: ffdec000 CR3: 032f8000 CR4: 00000010
[ 0.000000] Call Trace:
[ 0.000000] i386_start_kernel+0x42/0x44
[ 0.000000] startup_32_smp+0x15c/0x160
[ 0.000000] Modules linked in:
[ 0.000000] ---[ end trace 0000000000000000 ]---
[ 0.000000] EIP: start_kernel+0x3a6/0x4af
[ 0.000000] Code: 00 e8 1c c7 00 00 e8 a9 ec 00 00 e8 93 47 00 00 e8 8f e3 01 00 31 d2 8d 45 ec 89 55 ec 89 55 f0 ba 08 00 00 00 e8 0a 38 87 ff <0f> 31 03 45 ec 31 c9 8b 15 d8 1b 0c c3 89 45 ec 89 4d f0 89 82 44
[ 0.000000] EAX: 00000000 EBX: 00000023 ECX: 00000000 EDX: 00000040
[ 0.000000] ESI: c40761c0 EDI: c40761e2 EBP: c30a9fa4 ESP: c30a9f84
[ 0.000000] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210082
[ 0.000000] CR0: 80050033 CR2: ffdec000 CR3: 032f8000 CR4: 00000010
[ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---
|
kernel 5.15.110-gentoo-r1 with a lot of the more modern features (acpi, apic, SMP) disabled
Code: | early console in extract_kernel
input_data: 0x0177e094
input_len: 0x00505755
output: 0x01000000
output_len: 0x00b9a0d4
kernel_total_size: 0x00c9d000
needed_size: 0x00c9d000
Physical KASLR using i8254...
Decompressing Linux... Parsing ELF... Performing relocations... done.
Booting the kernel.
[ 0.000000] Linux version 5.15.110-gentoo-r1 (root@nobara) (gcc (Gentoo 12.2.1_p20230428-r1 p2) 12.2.1 20230428, GNU ld (Gentoo 2.39 p6) 2.39.0) #1 Sat Jun 3 20:25:17 EDT 2023
[ 0.000000] x86/fpu: x87 FPU will use FSAVE
[ 0.000000] signal: max sigframe size: 928
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000040ffbff] usable
[ 0.000000] printk: bootconsole [earlyser0] enabled
[ 0.000000] Notice: NX (Execute Disable) protection missing in CPU!
[ 0.000000] DMI not present or invalid.
[ 0.000000] last_pfn = 0x40ff max_arch_pfn = 0x100000
[ 0.000000] Disabled
[ 0.000000] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[ 0.000000] x86/PAT: Configuration [0-7]: WB WT UC- UC WB WT UC- UC
[ 0.000000] 0MB HIGHMEM available.
[ 0.000000] 64MB LOWMEM available.
[ 0.000000] mapped low ram: 0 - 040ff000
[ 0.000000] low ram: 0 - 040ff000
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.000000] Normal [mem 0x0000000001000000-0x00000000040fefff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009ffff]
[ 0.000000] node 0: [mem 0x0000000000100000-0x00000000040fefff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x00000000040fefff]
[ 0.000000] On node 0, zone DMA: 1 pages in unavailable ranges
[ 0.000000] On node 0, zone DMA: 96 pages in unavailable ranges
[ 0.000000] [mem 0x040ffc00-0xffffffff] available for PCI devices
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16412
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-5.15.110-gentoo-r1 root=PARTUUID=1b42b416-03 ro earlyprintk=ttyS0,115200
[ 0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/vmlinuz-5.15.110-gentoo-r1", will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[ 0.000000] Initializing HighMem for node 0 (00000000:00000000)
[ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[ 0.000000] Memory: 53044K/66168K available (5787K kernel code, 1846K rwdata, 3140K rodata, 416K init, 476K bss, 13124K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] trace event string verifier disabled
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] invalid opcode: 0000 [#1]
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.110-gentoo-r1 #1
[ 0.000000] EIP: start_kernel+0x397/0x4a0
[ 0.000000] Code: d1 00 00 e8 93 eb 00 00 e8 91 4a 00 00 8b 45 e8 e8 50 de 01 00 31 d2 89 55 ec 89 55 f0 ba 08 00 00 00 8d 45 ec e8 7c c7 84 ff <0f> 31 03 45 ec 89 45 ec 31 c9 89 4d f0 8b 15 38 ea ad c2 89 82 e0
[ 0.000000] EAX: 00000000 EBX: 00000028 ECX: 00000000 EDX: 00000040
[ 0.000000] ESI: c40763d0 EDI: c40763f7 EBP: c2ab9fa4 ESP: c2ab9f84
[ 0.000000] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210082
[ 0.000000] CR0: 80050033 CR2: ffdeb000 CR3: 02d02000 CR4: 00000010
[ 0.000000] Call Trace:
[ 0.000000] i386_start_kernel+0x42/0x44
[ 0.000000] startup_32_smp+0x15c/0x160
[ 0.000000] Modules linked in:
[ 0.000000] ---[ end trace 2e2fbd2ae972d3d4 ]---
[ 0.000000] EIP: start_kernel+0x397/0x4a0
[ 0.000000] Code: d1 00 00 e8 93 eb 00 00 e8 91 4a 00 00 8b 45 e8 e8 50 de 01 00 31 d2 89 55 ec 89 55 f0 ba 08 00 00 00 8d 45 ec e8 7c c7 84 ff <0f> 31 03 45 ec 89 45 ec 31 c9 89 4d f0 8b 15 38 ea ad c2 89 82 e0
[ 0.000000] EAX: 00000000 EBX: 00000028 ECX: 00000000 EDX: 00000040
[ 0.000000] ESI: c40763d0 EDI: c40763f7 EBP: c2ab9fa4 ESP: c2ab9f84
[ 0.000000] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210082
[ 0.000000] CR0: 80050033 CR2: ffdeb000 CR3: 02d02000 CR4: 00000010
[ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---
|
one thing consistent between all the panics I witnessed are these lines:
Code: | [ 0.000000] invalid opcode: 0000 [#1]....
...
[ 0.000000] Call Trace:
[ 0.000000] i386_start_kernel......
|
I have made sure that the cpu target is set correctly (486DX) and that the appropriate modules needed for the hardware are enabled and built in
Despite my best efforts, I cannot seem to find the cause of this issue. any help would be greatly appreciated
for what its worth, here is the specs of the system the kernel is failing to boot on:
CPU: intel i486 DX4-100
CHIPSET: OPTi 82C895
MEMORY: 128 MB RAM, 256KB L2 cache
GPU: WD Paradise based ISA VGA card
HDD: 80 gigabyte IDE LBA hard disk
P.S. if there is a better way to embed huge chunks of text into a post please let me know |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Sun Jun 04, 2023 3:04 am Post subject: |
|
|
0f 31 is rdtsc, which is new in the Pentium series of processors. You cannot use it on an i486. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 3:15 am Post subject: |
|
|
its kind of funny that that is what the issue is, because I used objdump to scan for CMOV instructions in the uncompressed kernel binary. It never occurred to me to look for the other pentium specific opcodes, haha
I wonder what could be causing it to compile with pentium instructions... I have the Processor Type setting set to 486DX and "generic x86 support" turned off (ive tried with it on too with the same result though). is this a bug im going to have to file somewhere? |
|
Back to top |
|
|
jpsollie Guru
Joined: 17 Aug 2013 Posts: 323
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sun Jun 04, 2023 8:16 am Post subject: |
|
|
yegor762,
Try the stable 4.14.x kernel. That's still in the tree and will predate dropping i486 support.
If the 486 knob is still in the kernel when support has been removed, that's a bug.
Its also possible that some of the build hosts settings have leaked through. That's a bug somewhere.
Have you been installing in a chroot or a VM of some sort?
-- edit --
Code: |
┌────────────────────── Processor family ───────────────────────┐
│ Use the arrow keys to navigate this window or press the │
│ hotkey of the item you wish to select followed by the <SPACE │
│ BAR>. Press <?> for additional information about this │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ ( ) 486SX │ │
│ │ ( ) 486DX │ │
│ │ ( ) 586/K5/5x86/6x86/6x86MX │ │
│ │ ( ) Pentium-Classic │ │
│ │ ( ) Pentium-MMX │ │
│ │ (X) Pentium-Pro |
I thought that 486SX support was dropped with the kernel FP Emulation. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 2:58 pm Post subject: |
|
|
I thought that was for the 6.2 version kernel, I could be wrong
Quote: | Have you been installing in a chroot or a VM of some sort? |
I have been doing the installation inside a chroot on a modern Fedora based PC, then moving the disk over to the i486 PC
Quote: | Try the stable 4.14.x kernel. That's still in the tree and will predate dropping i486 support. |
after setting all the knobs and dials, kernel 4.14.315-gentoo successfully boots on the i486! |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Sun Jun 04, 2023 3:47 pm Post subject: |
|
|
yegor762 wrote: | I thought that was for the 6.2 version kernel, I could be wrong | It was discussed to be done in 6.2, but I see the 486SX and 486DX options in arch/x86/Kconfig.cpu for v6.1, v6.2, v6.3, and v6.4-rc3. I have not tried to determine whether that is because the change was never made or because the Kconfig option was not cleaned out when the change was made. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sun Jun 04, 2023 3:54 pm Post subject: |
|
|
yegor762,
Work you way up from 4.14.x you have about 6 months.
See the forecast EOL Dates. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 4:07 pm Post subject: |
|
|
I will report back with the details soon. Time to go on a kernel configuring marathon. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 4:54 pm Post subject: |
|
|
Sad to say that my marathon was cut quite short. moving to the next stable kernel version 4.19.282-r1, I am once again greeted with the invalid opcode kernel panic. its the same 0f 31 rdtsc opcode. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Sun Jun 04, 2023 5:20 pm Post subject: |
|
|
I think your next step then needs to be finding where in the kernel source this opcode is generated. You have an approximate location from the panic message. If you know where it is generated, you can try to determine whether the use is a bug.
Given the age of 4.19, the fact that it is also affected suggests that no one has tested modern kernels on i486 in a long time. You may face other problems once you solve this one. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sun Jun 04, 2023 5:28 pm Post subject: |
|
|
yegor762,
Bisecting the kernel is a way to lean that theory and practice differ considerably.
Even if you find the offending commit, if its just one, fixing it is likely to be much harder. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Jun 04, 2023 5:34 pm Post subject: |
|
|
I wouldn't even know where to start for that, so this is most likely the end for this experiment.
I appreciate everyone's help, and I suppose its time to upgrade to a Pentium...
edit: this was in response to Hu's message. i suppose i could do some bisecting but ive wasted enough time as is and I dont feel like continuing anymore. i may pick it back up later if im feeling up to it |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Sun Jun 04, 2023 6:45 pm Post subject: |
|
|
Considering the size of the range to bisect, and that you have at least some proficiency with objdump, I think the more expedient course would be to build a bad kernel (preferably the newest stable release) with debug symbols (so you can get line number information), then use objdump to locate the use(s) of rdtsc, then work backward to find what C code or inline assembly files are responsible for that opcode's presence. From there, try to understand why your Kconfig choices did not cause those uses to be excluded from the kernel.
You could pastebin a "bad" kernel configuration (again, preferably for a recent stable release, so 6.x something) and hope that someone else takes an interest in hunting it down. I might be able to trace where the bad use comes in, but I would leave it to you to report to upstream, since I have no hardware with which to test it, and I am doubtful how well the report might be received, considering that Phoronix article linked above. |
|
Back to top |
|
|
jpsollie Guru
Joined: 17 Aug 2013 Posts: 323
|
Posted: Mon Jun 05, 2023 7:27 am Post subject: |
|
|
Not sure whether it will help you,
but is it possible it's an ACPI issue?
idle task ... boot CPU ... and i486 doesn't support ACPI, as far as I remember.
Could this be your issue? _________________ The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img] |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Fri Jun 09, 2023 2:25 am Post subject: |
|
|
sorry for late reply
i had ACPI and APIC and all that stuff totally disabled in the majority of my builds. |
|
Back to top |
|
|
jwh1981 n00b
Joined: 16 Mar 2024 Posts: 1
|
Posted: Sat Mar 16, 2024 3:33 am Post subject: |
|
|
I know this is about a year old but I ran into this as well. I booted with noapic and acpi=off. That fixed the issue for me. I am not using Gentoo for this but its most likely the same issue. |
|
Back to top |
|
|
yegor762 n00b
Joined: 13 Dec 2021 Posts: 11
|
Posted: Sun Mar 31, 2024 2:25 am Post subject: |
|
|
Which kernel version are you using? I'm interested in putting that 486 machine back to the kernel booting mines if you have a potential fix.
As I recall I don't believe I ever actually set boot parameters in the bootloader to disable that stuff, just turned it off in the build menu for the kernel. Quite possible that small thing could have been what held me back. |
|
Back to top |
|
|
|
|
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
|
|