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)
Mon, Aug 17, 8:21 AM
Unknown Object (File)
Mon, Aug 10, 3:39 PM
Unknown Object (File)
Mon, Aug 10, 3:38 PM
Unknown Object (File)
Mon, Aug 10, 3:35 PM
Unknown Object (File)
Mon, Aug 10, 3:34 PM
Unknown Object (File)
Sun, Aug 2, 9:20 AM
Unknown Object (File)
Sun, Aug 2, 12:47 AM
Unknown Object (File)
Jul 8 2026, 8:28 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 27206
Build 25472: 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.