Closed samcday closed 1 month ago
Interesting! The mixture of float and non float in the kernel has always been an issue one way or another, but seems that the compiler is getting more aggressive about using vector bits to speed up non float code and as far as I know there's no switch to turn that off aside from just telling the compiler there's no vector unit.
Will have to think about what to do there, but I think partially the answer is probably to start compiling more parts of the kernel, like whatever module this particular code is in, without floating point in the MODULE_OPTIONS options. It's also possible the older ARM32 stuff does't have the float/nofloat stuff wired up properly. It's been a solid 15 years since i've seen a cortex-a8 in the wild.
I found it quite surprising that such a simple piece of code (a_ptr = b_ptr = 0
) was lowered to a SIMD instruction.
but I think partially the answer is probably to start compiling more parts of the kernel, like whatever module this particular code is in, without floating point in the MODULE_OPTIONS options
Seems reasonable. What emboldened me to open this issue was seeing your comment elsewhere noting that FPU/NEON isn't expected to work in the bowels of kernel mode.
It's been a solid 15 years since i've seen a cortex-a8 in the wild.
Heh, indeed. Actually the msm8916 SoCs are cortex-a53, but I haven't managed to get LK arm64 to boot properly yet, so I'm still using arm32 and targeting cortex-a8 the same way lk2nd is.
I think I have it fixed with this CL above. Basically needed to add support for arm32 arch to support the float/nofloat ARCH_COMPILEFLAGS. I had done it for the 64bit arches, but hadn't gone back and added it to arm32.
Okay, needed a second commit to fix it a bit better for older compilers. Give it a whirl!
Confirmed, works a treat. Thanks a bunch!
I'm running LK on an msm8916 device in arm32 mode, targeting the cortex-a8 CPU.
When testing a simple
sleepm 1
, I get the following fault:Dumping that PC reveals:
If I change arm/toolchain.mk to
-mfpu=vfpv3
for cortex-a8 the issue goes away.My GCC version: