Page MenuHomeFreeBSD

ARM64: Treat alignment faults as bus errors
ClosedPublic

Authored by jhibbits on Oct 23 2019, 7:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 28, 4:25 PM
Unknown Object (File)
Tue, Feb 24, 4:07 AM
Unknown Object (File)
Fri, Feb 6, 6:54 PM
Unknown Object (File)
Jan 31 2026, 7:04 PM
Unknown Object (File)
Jan 28 2026, 6:07 PM
Unknown Object (File)
Jan 27 2026, 1:28 PM
Unknown Object (File)
Dec 29 2025, 5:12 PM
Unknown Object (File)
Dec 11 2025, 9:05 PM

Details

Summary

ARM64 currently treats all data abort exceptions as page faults. This
can cause infinite loops on non-page fault faults, such as alignment faults.

Since kernel-side alignment faults should be avoided, this adds support directly
to the el0 fault handler, instead of the data_abort() handler.

Test Plan

Tested on rpi3, with a misaligned ldm test.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27176
Build 25445: arc lint + arc unit

Event Timeline

I've been thinking we should use a table of function pointers similar to how 32 bit arm does it. There are a few other cases that shouldn't be handled by data_abort.

sys/arm64/arm64/trap.c
418

I thing you want ISS_DATA_DFSC_MASK here.

jhibbits added inline comments.
sys/arm64/arm64/trap.c
418

You're right, that makes more sense.

jhibbits marked an inline comment as done.

Address @andrew's feedback. Use the right sub-mask to get the DFSC bits.

This revision is now accepted and ready to land.Oct 30 2019, 10:43 AM
This revision was automatically updated to reflect the committed changes.