HomeFreeBSD

arm64: Ensure sctlr and pstate are in known states

Description

arm64: Ensure sctlr and pstate are in known states

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
Differential Revision: https://reviews.freebsd.org/D45528

(cherry picked from commit 034c83fd7d85f57193850a73cc0ac957a211f725)

Details

Provenance
andrewAuthored on Jul 23 2024, 9:18 AM
Differential Revision
D45528: arm64: Ensure sctlr and pstate are in known states
Parents
rG94865825c014: arm64: Fix the gicv3 check in locore.S
Branches
Unknown
Tags
Unknown