Opened 4 years ago
Closed 4 years ago
#16382 closed bug (fixed)
ASSERT FAILED: gFPUSaveLength <= sizeof(sInitialState.fpu_state)
Reported by: | HAL | Owned by: | korli |
---|---|---|---|
Priority: | high | Milestone: | R1/beta3 |
Component: | System/Kernel | Version: | R1/beta2 |
Keywords: | Cc: | HAL | |
Blocked By: | Blocking: | ||
Platform: | x86-64 |
Description (last modified by )
I tried to boot hrev54415-x86_64 from a USB flash drive but it went to KDL before any boot icons lit. I don't know where the boot problem may have started but the previous hrev54412 also had the same problem. I had wrote the haiku anyboot image with USB Image Writer in Linux. At the top of the KDL first line is: PANIC: ASSERT FAILED (../haiku-git/src/system/kernel/arch/x86/64/thread.cpp:147): gFPUSaveLength <= sizeof (sInitialState.fpu_state)
Attachments (6)
Change History (31)
by , 4 years ago
Attachment: | Haiku Boot KDL.jpg added |
---|
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Looks like the initial FPU state is too large. Can you boot an older version and get a syslog, so we can see your PCI details (or a lspci from Linux)?
comment:3 by , 4 years ago
Component: | - General → System/Kernel |
---|---|
Keywords: | kernel_debugger_loopPkcs removed |
comment:4 by , 4 years ago
Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
I wonder if there is a datasheet online somewhere that lists FPU state size...
comment:5 by , 4 years ago
Summary: | Booting to KDL before any ICONS Light → ASSERT FAILED: gFPUSaveLength <= sizeof(sInitialState.fpu_state) |
---|
comment:6 by , 4 years ago
Milestone: | Unscheduled → R1/beta3 |
---|
follow-up: 10 comment:7 by , 4 years ago
If I understand correctly, we get the size from the CPUID, this gives the max size that the CPU supports. But we can enable and disable specific register sets we have storage space for.
The list of things that can be saved is here: https://xem.github.io/minix86/manual/intel-x86-and-64-manual-vol1/o_7281d5ea06a5b67a-307.html
Could you show the output of cat /proc/cpuinfo on Linux to make sure which CPU you have and which instructions it supports?
Currently we have 1024 bytes of storage available, which would be enough for AVX2, but not for MPX (would need 1056 bytes) nor AVX512 (would need 2560 bytes). The state may be compressed by XSAVEC and XSAVEOPT if available, but there is no guarantee they can actually make things smaller.
I think we should bump the space to 2560 bytes already and start getting ready for AVX512? (this is in headers/private/kernel/arch/x86/arch_thread_types.h struct arch_thread)
I have put a change doing this at https://review.haiku-os.org/c/haiku/+/3031 . It would be great if you could test it and let us know if that fixes the problem for you.
comment:8 by , 4 years ago
I think we should bump the space to 2560 bytes already and start getting ready for AVX512?
Does it affect thread switching speed?
comment:9 by , 4 years ago
This specific instance is only for creating new threads if I read things correctly.
But yes, in general, saving and restoring more data in context switches affects the speed. It seems Linux only saves registers that have been used at least once by the thread to avoid that, according to https://events.static.linuxfound.org/sites/events/files/slides/LinuxCon_NA_2014.pdf
comment:10 by , 4 years ago
Replying to pulkomandy:
If I understand correctly, we get the size from the CPUID, this gives the max size that the CPU supports. But we can enable and disable specific register sets we have storage space for.
The list of things that can be saved is here: https://xem.github.io/minix86/manual/intel-x86-and-64-manual-vol1/o_7281d5ea06a5b67a-307.html
Could you show the output of cat /proc/cpuinfo on Linux to make sure which CPU you have and which instructions it supports?
Currently we have 1024 bytes of storage available, which would be enough for AVX2, but not for MPX (would need 1056 bytes) nor AVX512 (would need 2560 bytes). The state may be compressed by XSAVEC and XSAVEOPT if available, but there is no guarantee they can actually make things smaller.
I think we should bump the space to 2560 bytes already and start getting ready for AVX512? (this is in headers/private/kernel/arch/x86/arch_thread_types.h struct arch_thread)
I have put a change doing this at https://review.haiku-os.org/c/haiku/+/3031 . It would be great if you could test it and let us know if that fixes the problem for you.
How do I apply the patch? I have never done this before. If it is source code does it need compiled into source code with whole Haiku or can it be compiled on its own and as a file inserted where in Haiku? I cannot run any later version of Haiku so could it be compiled on Linux? I did compile Haiku a long time ago and probably forgotten. I think it was compilable in linux with crossbuild tools but don't remember what they were.
comment:11 by , 4 years ago
Well, let's make things simpler, I have merged the change so it will be available in the next update (hrev54430). When that is available you can try it and let us know if it works for you.
comment:12 by , 4 years ago
I tried booting hrev54447 on USB flash drive and still getting same KDL. I also tried going into safe mode but cannot. I seem to only be able to start booting from inside BIOS setup screen with boot override. Putting the boot order with USB drive first has never worked with this BIOS. So double clicking boot override with the USB flash drive and holding down shift key at same time, does not work to get to safe mode.
comment:13 by , 4 years ago
Hi,
In hrev54489 I changed the error message to indicate the needed size. Please tell us what it says then we can make the buffer large enough for it.
comment:14 by , 4 years ago
comment:15 by , 4 years ago
54503 was added to the download page tonight (the buildbot was off for a few days, but it's back).
by , 4 years ago
Attachment: | FPU Space Required.jpg added |
---|
comment:17 by , 4 years ago
Well, 15 Megabytes of context space seems a bit exagerated. So either your cpu has a bug and you need a microcooe update, or our code to get this information has a problem.
comment:18 by , 4 years ago
I was using the microcode shown in the picture. I have just tried removing it and reverting to the BIOS microcode but it made no difference. I still get the KDL with the same amount of context space. The BIOS is quite old compared to the microcode update I had loaded before.
comment:19 by , 4 years ago
Priority: | normal → high |
---|
Making this a high priority because it is a regression and makes the system unbootable currently.
comment:20 by , 4 years ago
Please attach a syslog from Linux (containing "x86/fpu: Enabled xstate features").
comment:21 by , 4 years ago
Sorry for late attach of Linux syslog. I separated the lines with a space where the x86/fpu enabled xstate features are shown, to make it easy to see.
comment:22 by , 4 years ago
Pushed a change for a default value: https://review.haiku-os.org/c/haiku/+/3372
comment:25 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Picture of boot KDL