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)
Dec 20 2023, 4:02 AM
Unknown Object (File)
Nov 30 2023, 2:03 AM
Unknown Object (File)
Nov 26 2023, 5:30 PM
Unknown Object (File)
Nov 23 2023, 11:40 AM
Unknown Object (File)
Oct 27 2023, 10:05 PM
Unknown Object (File)
Sep 4 2023, 4:01 PM
Unknown Object (File)
Mar 21 2023, 8:31 PM
Unknown Object (File)
Mar 4 2023, 10:41 AM

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.