Re: [PATCH v11] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests

From: Guenter Roeck
Date: Sun Mar 03 2024 - 10:27:08 EST


On 3/3/24 02:20, Christophe Leroy wrote:


Le 01/03/2024 à 19:32, Guenter Roeck a écrit :
This leaves the mps2-an385:mps2_defconfig crash, which is avoided by
this patch.
My understanding, which may be wrong, is that arm images with thumb
instructions
do not support unaligned accesses (maybe I should say do not support
unaligned
accesses with the mps2-an385 qemu emulation; I did not test with real
hardware,
after all).

Given all that, the continued discussion around the subject, and the lack
of agreement if unaligned accesses should be tested or not, I don't really
see a path forward for this patch. The remaining known problem is arm with
thumb instructions. I don't think that is going to be fixed. I suspect that
no one but me even tries to run that code (or any arm:nommu images, for
that
matter). I'd suggest to drop this patch, and I'll stop testing IP checksum
generation for mps2-an385:mps2_defconfig.

I'm trying to run an ARM kernel built with GCC 13.2 and mps2_defconfig
on the mps2-an385 qemu emulation, and I get the following fatal error.

$ qemu-system-arm -M mps2-an385 -kernel vmlinux
qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)

R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=ffffffe0 R14=fffffff9 R15=00000000
XPSR=40000003 -Z-- A handler
FPSCR: 00000000
Abandon (core dumped)

Can you tell how to proceed ?


You can't run it directly. mps2-an385 is one of the platforms where
the qemu maintainers insisted that qemu shall not initialize the CPU.
You have to provide a shim such as
https://github.com/groeck/linux-build-test/blob/master/rootfs/arm/mps2-boot.axf
as bios. You also have to provide the dtb file.

On top of that, you would need a customized version of qemu which
actually reads the command line, the bios file, and the dtb. See
https://github.com/groeck/linux-build-test/tree/master/qemu
branch v8.2.1-local or v8.1.5-local.

It might be possible to find a bootloader which does all that and
prepares the emulation for running Linux, but I don't know if that
exists somewhere.

Guenter