diff options
author | Marc Zyngier <maz@kernel.org> | 2021-02-08 10:57:28 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-02-09 14:50:57 +0100 |
commit | a762f4ffc3c8a434da1b712e57a80d8d10404198 (patch) | |
tree | d7e52cfa399bc671d8064b9d853f12cac0595f82 /arch/arm64/kernel/idreg-override.c | |
parent | KVM: arm64: Document HVC_VHE_RESTART stub hypercall (diff) | |
download | linux-a762f4ffc3c8a434da1b712e57a80d8d10404198.tar.xz linux-a762f4ffc3c8a434da1b712e57a80d8d10404198.zip |
arm64: Move "nokaslr" over to the early cpufeature infrastructure
Given that the early cpufeature infrastructure has borrowed quite
a lot of code from the kaslr implementation, let's reimplement
the matching of the "nokaslr" option with it.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: David Brazdil <dbrazdil@google.com>
Link: https://lore.kernel.org/r/20210208095732.3267263-20-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/idreg-override.c')
-rw-r--r-- | arch/arm64/kernel/idreg-override.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index b994d689d6fb..70dd70eee7a2 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -37,8 +37,22 @@ static const struct ftr_set_desc mmfr1 __initconst = { }, }; +extern struct arm64_ftr_override kaslr_feature_override; + +static const struct ftr_set_desc kaslr __initconst = { + .name = "kaslr", +#ifdef CONFIG_RANDOMIZE_BASE + .override = &kaslr_feature_override, +#endif + .fields = { + { "disabled", 0 }, + {} + }, +}; + static const struct ftr_set_desc * const regs[] __initconst = { &mmfr1, + &kaslr, }; static const struct { @@ -47,6 +61,7 @@ static const struct { } aliases[] __initconst = { { "kvm-arm.mode=nvhe", "id_aa64mmfr1.vh=0" }, { "kvm-arm.mode=protected", "id_aa64mmfr1.vh=0" }, + { "nokaslr", "kaslr.disabled=1" }, }; static int __init find_field(const char *cmdline, |