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)
Tue, Sep 8, 3:40 AM
Unknown Object (File)
Sun, Sep 6, 5:55 AM
Unknown Object (File)
Sun, Sep 6, 12:06 AM
Unknown Object (File)
Sat, Sep 5, 10:32 AM
Unknown Object (File)
Sat, Sep 5, 8:59 AM
Unknown Object (File)
Sat, Sep 5, 12:30 AM
Unknown Object (File)
Fri, Sep 4, 7:14 PM
Unknown Object (File)
Thu, Sep 3, 4:10 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.