Page MenuHomeFreeBSD

arm64: Ensure sctlr and pstate are in known states
ClosedPublic

Authored by andrew on Jun 7 2024, 2:25 PM.
Tags
None
Referenced Files
F173525380: D45528.id141249.diff
Sat, Sep 26, 2:35 PM
F173515785: D45528.id.diff
Sat, Sep 26, 12:45 PM
Unknown Object (File)
Fri, Sep 25, 5:17 PM
Unknown Object (File)
Tue, Sep 22, 6:35 PM
Unknown Object (File)
Fri, Sep 18, 4:32 AM
Unknown Object (File)
Sun, Sep 6, 6:14 AM
Unknown Object (File)
Sun, Sep 6, 3:27 AM
Unknown Object (File)
Sat, Aug 29, 11:30 PM
Subscribers

Details

Summary

Before entering the kernel exception level ensure sctlr_el2 and
sctlr_el1 are in a known state. The EOS flag needs to be set to ensure
an eret instruction is a context synchronization event.

Set spcr_el1 when entering the kernel from EL1 and use an eret
instruction to return to the caller. This ensures the CPU pstate is
consistent with the value in spcr_el1 as it is the only way to set it
directly.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58347
Build 55235: arc lint + arc unit

Event Timeline

Readd the isb at the end of enter_kernel_el. It seems to be needed.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 23 2024, 9:52 AM
This revision was automatically updated to reflect the committed changes.