diff options
author | Mark Rutland <mark.rutland@arm.com> | 2020-11-13 12:49:25 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2020-12-02 19:44:03 +0000 |
commit | d87a8e65b5101123a24cddeb7a8a2c7b45f7b60c (patch) | |
tree | 0dbcdc05dc2f0824c6202e82f4f8080a1cbf51a3 /drivers/cpufreq/davinci-cpufreq.c | |
parent | 2ffac9e3fdbd54be953e773f9deb08fc6a488a9f (diff) |
arm64: head.S: always initialize PSTATE
As with SCTLR_ELx and other control registers, some PSTATE bits are
UNKNOWN out-of-reset, and we may not be able to rely on hardware or
firmware to initialize them to our liking prior to entry to the kernel,
e.g. in the primary/secondary boot paths and return from idle/suspend.
It would be more robust (and easier to reason about) if we consistently
initialized PSTATE to a default value, as we do with control registers.
This will ensure that the kernel is not adversely affected by bits it is
not aware of, e.g. when support for a feature such as PAN/UAO is
disabled.
This patch ensures that PSTATE is consistently initialized at boot time
via an ERET. This is not intended to relax the existing requirements
(e.g. DAIF bits must still be set prior to entering the kernel). For
features detected dynamically (which may require system-wide support),
it is still necessary to subsequently modify PSTATE.
As ERET is not always a Context Synchronization Event, an ISB is placed
before each exception return to ensure updates to control registers have
taken effect. This handles the kernel being entered with SCTLR_ELx.EOS
clear (or any future control bits being in an UNKNOWN state).
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201113124937.20574-6-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'drivers/cpufreq/davinci-cpufreq.c')
0 files changed, 0 insertions, 0 deletions