diff options
author | Marc Zyngier <maz@kernel.org> | 2021-02-24 09:37:36 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-02-24 11:32:28 +0000 |
commit | f1b6cff7c98be2747d2fe16e42dcdcf2fc02c7e6 (patch) | |
tree | e187d288f505f10a933b3f5956add57fabcd3791 /tools/perf/scripts/python/sched-migration.py | |
parent | 610e4dc8ac463815f5180ae2e6fadae834891b86 (diff) |
arm64: VHE: Enable EL2 MMU from the idmap
Enabling the MMU requires the write to SCTLR_ELx (and the ISB
that follows) to live in some identity-mapped memory. Otherwise,
the translation will result in something totally unexpected
(either fetching the wrong instruction stream, or taking a
fault of some sort).
This is exactly what happens in mutate_to_vhe(), as this code
lives in the .hyp.text section, which isn't identity-mapped.
With the right configuration, this explodes badly.
Extract the MMU-enabling part of mutate_to_vhe(), and move
it to its own function that lives in the idmap. This ensures
nothing bad happens.
Fixes: f359182291c7 ("arm64: Provide an 'upgrade to VHE' stub hypercall")
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Tested-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210224093738.3629662-2-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions