diff options
author | Marc Zyngier <maz@kernel.org> | 2021-02-08 10:57:23 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-02-09 14:50:56 +0100 |
commit | 361db0fca7affafa920f7d91bf93b9d9da44712f (patch) | |
tree | 4b2d1e5917bb049bdbec7c811681a415f4dfba57 /arch/arm64/kernel/idreg-override.c | |
parent | arm64: cpufeature: Add an early command-line cpufeature override facility (diff) | |
download | linux-361db0fca7affafa920f7d91bf93b9d9da44712f.tar.xz linux-361db0fca7affafa920f7d91bf93b9d9da44712f.zip |
arm64: Allow ID_AA64MMFR1_EL1.VH to be overridden from the command line
As we want to be able to disable VHE at runtime, let's match
"id_aa64mmfr1.vh=" from the command line as an override.
This doesn't have much effect yet as our boot code doesn't look
at the cpufeature, but only at the HW registers.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: David Brazdil <dbrazdil@google.com>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210208095732.3267263-15-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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 3a347b42d07e..2da11bf60195 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -11,6 +11,7 @@ #include <linux/libfdt.h> #include <asm/cacheflush.h> +#include <asm/cpufeature.h> #include <asm/setup.h> #define FTR_DESC_NAME_LEN 20 @@ -25,7 +26,17 @@ struct ftr_set_desc { } fields[]; }; +static const struct ftr_set_desc mmfr1 __initconst = { + .name = "id_aa64mmfr1", + .override = &id_aa64mmfr1_override, + .fields = { + { "vh", ID_AA64MMFR1_VHE_SHIFT }, + {} + }, +}; + static const struct ftr_set_desc * const regs[] __initconst = { + &mmfr1, }; static int __init find_field(const char *cmdline, |