Bug 254449 - mips_unaligned_load_store: unhandled opcode in address error: 0x38
Summary: mips_unaligned_load_store: unhandled opcode in address error: 0x38
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: mips Any
: --- Affects Only Me
Assignee: Bugmeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-21 02:38 UTC by Piotr Kubaj
Modified: 2023-10-22 15:02 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2021-03-21 02:38:21 UTC
I'm trying to boot my Edgerouter Lite via NFS.
I added BOOTP and BOOTP_NFSROOT to ERL kernel config, however booting results in:
octe0: link state changed to DOWN
octe1: link state changed to DOWN
octe2: link state changed to DOWN
Sending DHCP Discover packet from interface octe0 (04:18:d6:f1:52:bc)
mips_unaligned_load_store: unhandled opcode in address error: 0x38
cpu:0-Trap cause = 5 (address error (store) - kernel mode)
panic: trap
cpuid = 0
time = 1

This is on 13.0-RC3.
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2021-03-22 00:20:58 UTC
oh, this is panicing in the kernel? Dang. :-)

Yeah, we don't currently support kernel alignment fix-ups which means some places in our networking stack get unhappy with us. We need to fix that, both for MIPS and RISC-V.

Can you do some digging to see if it's trying to talk to the address 0x38 (which is likely a NULL pointer dereference?) Or, just send me a message/email telling me how you set it up?

I have an ERL here that I want to setup to fix FreeBSD issues on but I don't yet have instructions on how to make it work. :-)

Thanks!


-adrian
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2021-03-22 19:55:31 UTC
There's really nothing I can do, ddb doesn't seem to work on mips.

Here's how to recreate this issue:
git clone -b releng/13.0 https://git.FreeBSD.org/src.git
cd src
make buildworld -j 32 TARGET=mips TARGET_ARCH=mips64
echo include ERL > sys/mips/conf/MYERL
echo options BOOTP >> sys/mips/conf/MYERL
echo options BOOTP_NFSROOT >> sys/mips/conf/MYERL
make buildkernel -j 32 TARGET=mips TARGET_ARCH=mips64 KERNCONF=MYERL
make installworld TARGET=mips TARGET_ARCH=mips64 DESTDIR=/mnt
make installkernel TARGET=mips TARGET_ARCH=mips64 DESTDIR=/mnt KERNCONF=MYERL
make distribution TARGET=mips TARGET_ARCH=mips64 DESTDIR=/mnt

Then enable NFS server.
Boot ERL using the following command (assuming DHCP):
dhcp; tftpboot 0 boot/kernel/kernel; bootoctlinux
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2021-03-22 19:56:05 UTC
This seems to work with 12.2-RELEASE, so it must have been a regression since then.
Comment 4 Denis Ovsienko 2021-07-06 20:47:20 UTC
This bug reproduces for me with 13.0-RELEASE-p3 with a slight difference in details:

Starting dhclient.
DHCPDISCOVER on octe0 to 255.255.255.255 port 67 interval 4mips_unaligned_load_store: unhandled opcode in address error: 0x38
cpu:1-Trap cause = 5 (address error (store) - kernel mode)
panic: trap
cpuid = 1
time = 1625096139
Uptime: 27s
Automatic reboot in 15 seconds - press a key on the console to abort
--> Press a key on the console to reboot,
--> or switch off the system now.

The disk image was produced using the well-known "mkerlimage" script from [1] (you need the latest revision to handle 13.0 correctly). You can use my ERLite-3 device remotely to run test kernels and to extract debug information if it helps (I can assist with serial console, network and remote hands).

1: https://github.com/ndorf/misc/blob/master/FreeBSD/ERL/mkerlimage
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2023-10-22 15:02:00 UTC
^Triage: close as Overcome By Events.

I'm sorry this PR never got looked at.  In the meantime, FreeBSD has dropped MIPS support, so there is nothing to do here.