On Tue, 11 Mar 2025, Carsten Grzemba via illumos-discuss wrote:

> Recently I see an crash dump with
>
> NOTICE: SAM-QFS: samfs1: Initiated mount filesystem
>
> panic[cpu3]/thread=fffffe0019e3dc20:
> BAD TRAP: type=7 (#nm Device not available) rp=fffffe0019e3d780 addr=0
>
...
> sam_map_block+0x6f:             pxor   %xmm0,%xmm0
>
> I build this kernel module with GCC14.
>
> I have no clear understanding what "Bad trap: type=7 (#nm Device not 
> available) " means. Looking on the assembler instruction "pxor   %xmm0,%xmm0" 
> seems that here special multimedia registers are used.

nm - No Math(s) Co-processor
(or at least that's what I've always read it as.)
This is a result of trying to use a floating-point or SIMD instruction (which
`pxor` is) when the CR0.TS bit is set. There's a good theory statement on
kernel FPU use in:

https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/intel/os/fpu.c#L124-L126

In general kernel code cannot use FPU/SIMD instructions unless they make
use of kernel_fpu_begin() and kernel_fpu_end() around them. In this case,
I suspect you need to tell the compiler to avoid such instructions.

Regards,

Andy


------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/Te2d5885af4d3b9f6-M1ef829f6547a474f98d1f851
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to