Page MenuHomeFreeBSD

ARM64: Treat alignment faults as bus errors
ClosedPublic

Authored by jhibbits on Oct 23 2019, 7:10 PM.
Tags
None
Referenced Files
F110303547: D22133.id63602.diff
Sun, Feb 16, 12:35 PM
Unknown Object (File)
Tue, Jan 28, 9:45 PM
Unknown Object (File)
Tue, Jan 28, 5:10 PM
Unknown Object (File)
Sat, Jan 25, 1:37 PM
Unknown Object (File)
Dec 12 2024, 6:34 AM
Unknown Object (File)
Dec 4 2024, 6:13 PM
Unknown Object (File)
Nov 19 2024, 12:16 AM
Unknown Object (File)
Nov 18 2024, 10: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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #63602)

I thing you want ISS_DATA_DFSC_MASK here.

jhibbits added inline comments.
sys/arm64/arm64/trap.c
418 ↗(On Diff #63602)

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.